1- iOS by design can only play <x> concurrent videos as decoding is done on hardware. <x> depends on the device, for iPhone 6, it is 32. 2- If a video is "paused" it still occupies the hardware decoder and is considered part of the <x> concurrent videos limit. 3- This is all fine but default behaviour of the API is not. Essentially on <x>+1 video play, the call to `play()` method fails. It should instead evict one of the existing videos and play the x+1 instead of failing on the last one. The heuristics for evict could be FIFO based or something else, does not really matter. 4- The reason the current way the API works is bad, is that it pushes all the pool management back to the app developer and given this is iOS only and high-level, it is super easy to miss the need for this and it is a pain to code a state management here given the webpage may not even have access to all the playing videos to evict them ( they could be in an iframe). To see this in action, visit: https://s.codepen.io/aghassemi/debug/VqgzjV on a real device (not sure what the # of hardware decoders of iPhone > 6 is but try with 6 if you can). As you scroll this page, when a video comes into view, it plays, as it exists the view it gets paused. Notice that video #33 does not play because 32 other videos have been paused. Thanks! -Ali
<rdar://problem/47299934>
Created attachment 359263 [details] Testcase Reduced testcase that does not require AMP tags.
This testcase is crashing in iOS 12.2 beta 1 (january 24), so I'm setting this as critical. I tried to debug this quickly last week, but I haven't got a chance to go deeper. Also it's actually not reproducible with the simulator (it only happens with hardware) so that makes the task tricky. I see that we arrive in platformPlay() from MediaPlayerPrivateAVFoundationObjC.mm . IIUC, the failure is likely to happen when we call MediaPlayerPrivateAVFoundationObjC::createAVPlayer() to create an AVPlayer: https://developer.apple.com/documentation/avfoundation/avplayer I'm wondering if instead of failing, we should release an existing AVPlayer as Ali suggested. Any suggestion?
Please attach a crash log
Created attachment 360458 [details] iPad crash log This is the file generated in /Users/fred/Library/Logs/CrashReporter/MobileDevice/
I don't see the security issue here. Can you clarify why this is in the Security component?
(In reply to Brent Fulgham from comment #6) > I don't see the security issue here. Can you clarify why this is in the > Security component? Sorry I had no idea what this crash was about so I thought it should be safer to move it to security before commenting on this publicly. If not please, remove it from the security component.
Moved out of Security component since it is not a security issue.
(In reply to Frédéric Wang (:fredw) from comment #5) > Created attachment 360458 [details] > iPad crash log > > This is the file generated in > /Users/fred/Library/Logs/CrashReporter/MobileDevice/ Crash still happens in iOS 13.3 beta (17C5046a)