shaka-player-embedded
shaka-player-embedded copied to clipboard
Playback failed when app return to foreground and played.
Playback failed when playing widevine content using the following procedure. (1) ShakaPlayer load widevine content. (2) Execute ShakaPlayer#pause when enter background by pressing the home button. (3) Select an app and return to foreground. (4) Execute ShakaPlayer#play.
Error Message:
Domain=ShakaPlayerErrorDomain Code=3016 "Shaka Error MEDIA.VIDEO_ERROR (3,,Error decoding frames: -12903)"
UserInfo={NSLocalizedDescription=Shaka Error MEDIA.VIDEO_ERROR (3,,Error decoding frames: -12903), ShakaPlayerErrorSeverityKey=2, ShakaPlayerErrorCategoryKey=3}
And we tried and confirmed the following:
- It occurs for both clear and encrypted content.
ShakaPlayer Embedded Sample Project regenerates ShakaPlayer when returning to foreground. Do I need to do so? If app regenerate it, ShakaPlayer request a license every time when returning to foreground, so I want to avoid.
Is there any missing information in the issue description?
This is probably a duplicate of #3. Even though we aren't using FFmpeg for decoding anymore, it may still be caused by the same thing. -12903 is an iOS error for kVTInvalidSessionErr, so what is probably happening is the session is being invalidated when we go into the background.
Thank you for your answer. We look forward to your fix.
Also, I tried the following as a measure until it was fixed, but playback failed.
Measure overview:
- App regenerate the instance when returning to the foreground, similar to ShakaPlayer Embedded Sample Project.
- The license information is retained and reused as a variable in order to omit the request for the license information when the instance is regenerated.
- Player reused the license information by the network filter.
Error message:
Domain=ShakaPlayerErrorDomain Code=6008 "Shaka Error DRM.LICENSE_RESPONSE_REJECTED (Unknown internal error.)"
UserInfo={NSLocalizedDescription=Shaka Error DRM.LICENSE_RESPONSE_REJECTED (Unknown internal error.), ShakaPlayerErrorSeverityKey=2, ShakaPlayerErrorCategoryKey=6}
What I understand so far is player can't reuse the license information, is that correct?
You are correct, a license response can only be used once and can only be used by the session that asked for it. You can't copy license responses and you can't move them between sessions. This is a security requirement of the CDM.
Thank you for your answer. I think about another measure.
When do you plan to fix this issue? I'm looking forward to your fix.
I'm currently busy working on other projects. Hopefully I can have time in Q2 to work on this project again.
Thank you for your answer. I'm looking forward to your fix.
Could you give us an update on this issue? Could you fix this issue in Q2(April-June 2021)?
We don't have the resources to work on this issue right now. We don't have a timeline for this fix, either. Please accept our apologies. We are always happy to accept PRs if you are interested to contribute.