-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Video starts playing after the whole file is downloaded #12
Comments
I didn't try it with video files so I cannot comment on this. My suggestion is for you to try playing an mp3 file with the same setup. If the behavior doesn't change, chances are you missed something in your code. If everything is ok, then feel free to provide a link to the video file or the source code, I will take a look. And make sure you're testing it on a device, not a simulator. |
@neekeetab thanks for the quick reply. I just tried it with mp3 audio and the playback starts almost instantly and starts before the full download. The status is "ready" after some kilobytes are downloaded and the audio starts playing. So this looks like a a video-only issue. I tried this on a real device and both the mp3 and mp4 files are hosted on the same server with same permissions. Both HTTP and HTTPS connections behave the same. I also tried the Big Buck Bunny video and its playback starts almost instantly and the download continues in the background. So it looks like encoding parameters issue. I will play with those now. |
Waiting for the whole video to download before starting the playback is caused by the |
For those wondering how to achieve what @martinflorek mentioned. Just change this flag of your exporter |
I want to start video playback as soon as possible instead of waiting for the whole file to be downloaded first.
I set the
AVPLayer
'sautomaticallyWaitsToMinimizeStalling
tofalse
andAVPlayerItem
'spreferredForwardBufferDuration
to different values ranging from 0.1 to 2.0 but the AVPLayer always waits for the full download. I also triedAVPLayer
'splayImmediately(atRate: 1.0)
method instead of the plainplay()
.The KVO observed
status
in theCachingPlayerItem
is changed to "ready" only after the data is fully downloaded.How can I start video playback immediately after some data is downloaded instead of waiting for the full download?
The text was updated successfully, but these errors were encountered: