shaka-player-embedded icon indicating copy to clipboard operation
shaka-player-embedded copied to clipboard

Playback failed when app return to foreground and played.

Open yukihiro-m-play opened this issue 4 years ago • 10 comments

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.

yukihiro-m-play avatar Dec 09 '20 10:12 yukihiro-m-play

Is there any missing information in the issue description?

yukihiro-m-play avatar Dec 17 '20 08:12 yukihiro-m-play

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.

TheModMaker avatar Dec 17 '20 18:12 TheModMaker

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?

yukihiro-m-play avatar Jan 07 '21 11:01 yukihiro-m-play

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.

TheModMaker avatar Jan 07 '21 17:01 TheModMaker

Thank you for your answer. I think about another measure.

yukihiro-m-play avatar Jan 08 '21 01:01 yukihiro-m-play

When do you plan to fix this issue? I'm looking forward to your fix.

yukihiro-m-play avatar Feb 25 '21 08:02 yukihiro-m-play

I'm currently busy working on other projects. Hopefully I can have time in Q2 to work on this project again.

TheModMaker avatar Feb 25 '21 18:02 TheModMaker

Thank you for your answer. I'm looking forward to your fix.

yukihiro-m-play avatar Mar 02 '21 11:03 yukihiro-m-play

Could you give us an update on this issue? Could you fix this issue in Q2(April-June 2021)?

yukihiro-m-play avatar Jun 10 '21 11:06 yukihiro-m-play

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.

joeyparrish avatar Jun 10 '21 17:06 joeyparrish