Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AVPlayer streaming delay

I have ios application which streams music from server. It takes 4 to 5 seconds to start playing audio. it seems the AVPlayer downloads entire audio file then starts playing. How to decrease long delay of AVPlayer?

like image 575
Karen Karapetyan Avatar asked Dec 21 '25 11:12

Karen Karapetyan


1 Answers

iOS devices currently support streaming the following audio formats:

  • E-AAC or AAC-LC up to 48 kHz, stereo audio
  • MP3 (MPEG-1 Audio Layer 3) 8 kHz to 48 kHz, stereo audio
  • AC-3 (for Apple TV, in pass-through mode only)

If your audio is in one of the these formats, AVPlayer should be able to stream it instead of needing to download it before starting to play.

Here's a link to the Apple doc where I got this info: https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/FrequentlyAskedQuestions/FrequentlyAskedQuestions.html

like image 120
ronb Avatar answered Dec 23 '25 00:12

ronb



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!