AVPlayer play() does not work if it was paused for 2 minutes. Does not report any error indication too!

Originator:funkenstrahlen
Number:rdar://25953728 Date Originated:27.04.2016
Status:Open Resolved:
Product:iOS Product Version:9.3.1
Classification:Bug Reproducible:
 
Summary:
If AVPlayer is paused for about 2 minutes on a livestream it does not continue playing on play().

The problem is AVPlayer does not communicate that it can not continue playing. It does not change rate back to 0. It does not change to failed state on the AVPlayerItem. It does not change to buffering AVPlayerItem.

Therefore I can not recreate the AVPlayerItem in my code to recover the stream myself. I need to know if AVPlayer fails.

Steps to Reproduce:
I attached a Playground which demonstrates the issue.

1. create AVPlayer and AVPlayerItem with an internet livestream url
2. play()
3. pause() after 2 seconds
4. play() after 120 seconds

Expected Results:
AVPlayer should actually recover and play

OR

report any error that something went wrong, so I can recover in my code.

Actual Results:
AVPlayer.rate = 1
AVPlayerItem.status = ready
AVPlayerItem.caching = false

So it looks like its playing, but there is no sound to hear

Version:
iOS 9.3

Notes:


Configuration:
works on all ios devices. even in a playground as attached

Attachments:
https://gist.github.com/funkenstrahlen/ba0f97c1fb9f88ee63a44470a8ed7b5f

Comments

Attachment

The attachment to my original radar is a ZIP of my playground of course. As I can not append any ZIP File here, I changed it to a link to a Gist.

By funkenstrahlen at May 16, 2016, 9:54 a.m. (reply...)

My response to that

I updated the attached playground to demonstrate my issue. Please take a look at the console output which shows AVPlayer state attributes.

I call * play() pause() after 10s play() again after 120s

After the last play() I see this AVPlayer state:

player.rate = 1.0 player.currentItem.playbackLikelyToKeepUp = true player.currentItem.playbackBufferEmpty = false player.currentItem.playbackBufferFull = false player.currentItem.status = READY

The player IS NOT PLAYING though.

There is no indication in the AVPlayer attributes values if the player is currently buffering, playing or failing.

Because you asked, this is the stream URL I use: http://detektor.fm/stream/mp3/musik/ It is also used in the attached Playground. Please take a look.

By funkenstrahlen at May 16, 2016, 9:52 a.m. (reply...)

First Response from Apple

Engineering has requested the following information in order to further investigate this issue:

Client can check AVPlayerItem property playbackLikelyToKeepUp to determine if playback is in the buffering state. playbackLikelyToKeepUp=NO means that the player does not have sufficient buffering to begin playback.

Please provide a sample stream that will allow us to reproduce the not able to resume playback after pause issue.

Thank you.

Please provide your response or results by updating your bug report and compress any bundled files (e.g. nested folders) prior to uploading.

By funkenstrahlen at May 16, 2016, 9:52 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!