Reputation: 390
I am trying to develop a player using AVFoundation and enable fast forward and rewind. I am setting the player's rate property to 0, 0.25, 0.5, 1, 1.5, 2.0. rate property of 0,1 is working as expected and setting it to pause and play. 0.25, 0.5 also works and displays video in slow motion.
My question is that setting the property of 1.5, 2.0 is not working, it just keeps playing. This works for .mp4 videos though. Is this not supported for HLS? I am using the sample HLS stream's provided by Apple. http://devimages.apple.com/iphone/samples/bipbopgear4.html
How do we do enable rewind and fast forward? Should I somehow use seekToTime?
Any help will be appreciated !
Upvotes: 1
Views: 3330
Reputation: 390
Looks like if I have an i-Frame playlist, FF/RW is supported. But then thats only from iOS5.0+.
Confirmed from Apple Dev Forums. Rate is supported only for I-Frame Playlists for HLS content. For normal playlist, only rate = 0, 1 is supported(which is essentially play/pause)
For non-HLS content, rate can be use for <0, =0,>0 to support FF/RW/Slow forward etc.
Upvotes: 3
Reputation: 84
The rate property only controls playback speed. 0 for stopped and up to 1 for the normal rate of the current item. Any value over 1 is treated as 1. If you want to "fast forward" to a specific point you will need to use the method you mentioned, "seekToTime". There is no way (AFAIK) to play a movie faster than it's normal rate using public API's. Hope that helps.
Upvotes: 0