[Bug] Fix decryption issue on legacy CDM (e.g. Tizen 3.0)#1656
[Bug] Fix decryption issue on legacy CDM (e.g. Tizen 3.0)#1656KunXi-Fox wants to merge 5 commits intocanalplus:devfrom
Conversation
|
Hi @KunXi-Fox, Thanks for the PR! It's always nice to see external contributions and the implementation makes sense :D For the API, I'm wondering if we could perhaps be higher-level and provide an option like For the latter in worst scenarios, there is the |
|
Hi @peaBerberian , Thanks for the feedback. I'm not very familiar with rx-player codebase, so my changes may not be proper one, that's why I put it as a draft and waiting for any feedback. For more context, the issue only happens under this condition:
The perfect solution from my brain is:
Do you think it's a proper solution? If so, could you pls point me the right direction to implement it, I'm happy to make it happen. Thanks in advance! |
|
If we can pinpoint it to a specific device (Tizen 2017), we could even make it automatic and specific to this device without needing an option. Generally the encryption status change at Period transitions - but it can also happen at track of even Representation transition technically, so there could be a lot of ways this could be implemented depending on if we want to handle all cases or only the most frequent ones. To handle all possible cases: I guess we could create some logic somewhere in To handle only at Period transitions: we'll have to update some code in the code handling Period transitions I guess, in: Alternatively, we could look at other solutions for this problem. E.g. I don't remember if pushing segments only once the license has been communicated fixes the issue? If it does, it may be much simpler to work-around by only pushing media segments once they are known to be decipherable (or clear) on that device. This could be done in This has the advantage of still being able to pre-load Period and keep a smooth transition between them. Though even in those, I'm unsure of what the extent of the issue is on Tizen. For example let's imagine that the audio is encrypted but not the video for a Period A, but the reverse once we transition to a Period B: Does the issue happen or are we good because we initialized the decryption logic? |
In our cases the audio + video was encrypted together, so ⬆️ scenario will not happens, so I can't tell, sorry for that. |
|
Hi @peaBerberian baed on your suggestion, I revert the changes for Could you please help review? Thanks. |
7bce6e2 to
b6a2e75
Compare
00fc806 to
b7216b4
Compare
|
Hi @peaBerberian , Could I please get this PR reviewed? |
|
The current implementation looks good and simple for the most usual case but I have some reservation before integrating it officially:
Those are rarer cases, I think that inevitably people are going to encounter those and not understand why that option didn't work for their cases. Though I get what it solves regarding mixed encryption on some devices and that's a real issue we see multiple applications have issue with. Maybe I could see this being solved by giving the application the power to trigger that?
I would think, without actually testing so I'm not 100% sure here, that the main difference in terms of timing between the
I don't know which step takes the main chunk of the time in your case (maybe it's both, maybe it's neither but some other thing), though both look solvable with some effort (we could save the last manifest worker-side, we could keep some option around to not reset DRM etc.) |
Yeah, I agree with this. For this issue, I tried to solve it from application level via
So if we could expose the a event for period switching and an extra API for just reloading all segments, I think that's enough to solve this issue from application level. |
6d4fed2 to
9b856a5
Compare
6cfd206 to
1e55170
Compare
a42734c to
29372ac
Compare
d4be192 to
9ad6758
Compare
0142e34 to
1fd9df3
Compare
This is a attempt fixes for issue: #1415
We observed a CDM issue on Tizen 3.0, the issue happens when playback starts from non-drm content and switch to drm protected content.
Turns out Tizen 3.0 CDM tries to decrypt the content by using the first init-segment appended to source buffer, if playback starts from non-drm segment, CDM will try to use the unencrypted init segment to decrypt the encrypted segment, which will eventually lead to a screen artifacts or blank screen.
re-create media source seems is the only way to fix this issue.
This PR is to introduce a new load video option
reloadMediaSourceForFirstIncompatiblePeriodSwitchto make the user decide whether to enable the fixes. If so, rx-player will perform a reload media source action when: