Re: AVSimplePlayer in Swift?

2017-02-11 Thread Uli Kusterer
On 13 Jan 2017, at 00:42, Charles Jenkins wrote: > Here is the code I promised to post. This version is using didSet instead > of KVO. In both cases, if I imitate the way AVSimplePlayer seeks in the > setter for currentTime, the video won’t play. Just a thought: Does

Re: AVSimplePlayer in Swift?

2017-02-09 Thread Charles Jenkins
Here is the code I promised to post. This version is using didSet instead of KVO. In both cases, if I imitate the way AVSimplePlayer seeks in the setter for currentTime, the video won’t play. // // ViewController.swift import Cocoa import AVFoundation // Swift offers the #keyPath() directive

Re: AVSimplePlayer in Swift?

2017-01-09 Thread Charles Jenkins
I will post code later today. In the meantime, I think I know what’s happening, but not yet why. In short, the IB message is worthless, and KVO is actually working. Ironically, proved that to myself by ditching it altogether and switching currentTime back to using a local (non-computed) property

Re: AVSimplePlayer in Swift?

2017-01-08 Thread Charles Srstka
> On Jan 8, 2017, at 1:12 PM, Quincey Morris > wrote: > > On Jan 8, 2017, at 05:49 , Charles Jenkins > wrote: >> >> changing to CDouble didn’t help > > This is one of those cases where I regretted pressing

Re: AVSimplePlayer in Swift?

2017-01-08 Thread Quincey Morris
On Jan 8, 2017, at 05:49 , Charles Jenkins wrote: > > changing to CDouble didn’t help This is one of those cases where I regretted pressing “Send” just 2 minutes later. What I wrote was a thought process that didn’t make complete sense. There are 4 possibilities and you’ll

Re: AVSimplePlayer in Swift?

2017-01-08 Thread Quincey Morris
On Jan 7, 2017, at 13:24 , Charles Jenkins wrote: > > If I take that working code and the ONLY changes I make are to (a) change > currentTime to the code below and (b) add the binding in IB, the video will > not play. The strange thing is when I do this, I think KVO is

Re: AVSimplePlayer in Swift?

2017-01-07 Thread Charles Srstka
> On Jan 7, 2017, at 3:24 PM, Charles Jenkins wrote: > > I did try after you asked, and KVO may be working, but the video doesn’t > play. If I delete the KVO bindings from IB and change my code like this: > > var currentTime : Double = 0 { > didSet { >

Re: AVSimplePlayer in Swift?

2017-01-07 Thread Charles Jenkins
I did try after you asked, and KVO may be working, but the video doesn’t play. If I delete the KVO bindings from IB and change my code like this: var currentTime : Double = 0 { didSet { timeSlider.doubleValue = currentTime } } var duration: Double = 0 { didSet {

Re: AVSimplePlayer in Swift?

2017-01-06 Thread Charles Srstka
> On Jan 6, 2017, at 9:32 PM, Charles Jenkins wrote: > > - If I imitate the ObjC version and try to do the bindings in IB, the > time slider’s maxValue and value bindings don’t work (won’t compile) > because duration and currentTime are not NSNumbers. They don’t have to

AVSimplePlayer in Swift?

2017-01-06 Thread Charles Jenkins
Has anyone recoded Apple's AVSimplePlayer example in Swift? I’m trying to do that in order to get some AVFoundation experience in Swift, and I’m having a bit of trouble. I can’t figure out how to do the bindings to currentTime and duration. - If I do them the easy way, using didSet clause