shaka-project / shaka-player-embedded

Shaka Player in a C++ Framework
Apache License 2.0
239 stars 62 forks source link

Playback failed when app return to foreground and played. #201

Open yukihiro-m-play opened 3 years ago

yukihiro-m-play commented 3 years ago

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:

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 commented 3 years ago

Is there any missing information in the issue description?

TheModMaker commented 3 years ago

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.

yukihiro-m-play commented 3 years ago

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:

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?

TheModMaker commented 3 years ago

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.

yukihiro-m-play commented 3 years ago

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

yukihiro-m-play commented 3 years ago

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

TheModMaker commented 3 years ago

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

yukihiro-m-play commented 3 years ago

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

yukihiro-m-play commented 3 years ago

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

joeyparrish commented 3 years ago

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.