• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
AVSimplePlayer in Swift?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AVSimplePlayer in Swift?


  • Subject: AVSimplePlayer in Swift?
  • From: Charles Jenkins <email@hidden>
  • Date: Fri, 06 Jan 2017 22:32:13 -0500

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, everything works and I
   can play the video and use the Rewind and Fast Forward buttons to alter
   playback rate, but I can’t scrub using the time slider.



   - 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.



   - And if I change duration and currentTime to computed variables based
   on NSNumber, the video won’t play at all.


Any suggestions?

--

Charles
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: AVSimplePlayer in Swift?
      • From: Charles Srstka <email@hidden>
  • Prev by Date: UICollectionView cells sometimes drawn on top of section header
  • Next by Date: Re: AVSimplePlayer in Swift?
  • Previous by thread: UICollectionView cells sometimes drawn on top of section header
  • Next by thread: Re: AVSimplePlayer in Swift?
  • Index(es):
    • Date
    • Thread