Reuse secure decoder while moving from secured -> clear -> secure content
We observe that the decoder deinit and reinit while moving from secured to plain content and plain to secure content.
Is there a way to signal exoplayer so we can avoid de-init and re-init of decoder and ask MediaCodecRenderer to reuse the secured decoder for clear content?
For your use case, does the secure content before and after the clear content use the same keys (e.g. is this like inserting a clear ad into a VOD stream)? Or would the second piece of secure content need a new license request?
@ojw28 yes they use the same key, yes its inserting a clear ad into a live stream, and the content of live stream has same key before and after the clear ad
also since the drm key and license remain same in and out of AD playing secured content. I want to avoid refetching license keys everytime.
A few problems we face here are from the point of view of implementing a general solution are:
- Not knowing if the second secure period will use the same keys. In some cases that period might not even be present in the manifest at the point of transitioning into the clear period, so it's unclear whether we should hold the session open or not (and if we do, should we actively refresh the keys, and when should we give up and close it).
- If the user joins the stream during ads, it's possible we wont even know any part of the content is secure, and so will (correctly) initialize a non-secure decoder. I can't see much we can do to avoid at least one decoder re-init in this case, when we encounter the first period containing secure content.
Are you aware of any signalling in the DASH manifest to help with this? I'd rather not have the application side-load all this information, since it feels like something the content should be able to tell us directly.
The PSSH data for key is unique per key, so if you get new unique PSSH data in the manifest that could be considered a manifest signal that the key has changed. You could keep using the the secure decoder until you see an new unique PSSH element in the manifest.
In the second case I could see being unable to determine that a secure period would come in the future in that case I think you are right, at least one re-init would be required.
So what do you think about the idea of detecting the need for a new license by watching PSSH blocks and associating them with licenses? As soon as a new one pops into the live window you could send the license request, but if there isn't a new one for a period because a) The period didn't have one at all or b) because it didn't change -- Then you would keep using the existing license until it expires.
I think this is one thing we're planning to do, except "as soon as a new one pops into the live window" is something more like "as soon as we start to buffer it" / "X seconds before we're going to play it".
yes, agreed! thats what we want @ojw28 . Let us know of any updates on this thread! thanks 👍
@ojw28 any update on this, is it being prioritized? thanks.
@tonihei any update on this issue?
Is this prioritized ?
I am working on this.
Any content you can send to us would be valuable. If you don't want to make it public, please send it to [email protected]. If you send an e-mail, please post a message below and I'll check it out.
@AquilesCanta you can use following profile as a test stream:
{
"name":"Live - Uplynk DASH Encrypted with UnEncrypted Ads",
"uri":"https://content.uplynk.com/channel/3c367669a83b4cdab20cceefac253684.mpd?ad=cleardashnew",
"drm_scheme":"widevine",
"drm_multi_session":true,
"drm_license_url":"https://content.uplynk.com/wv",
"drm_key_request_properties":{
"X-DASH-SEND-ALL-KEYS":"1"
},
"extension":"mpd"
}
let me know if this stream is sufficient to reproduce the issue and validate your fixes. We can help you get streams with different scenarios! combination of secure/nonsecure content on live/vod streams
Hi @AquilesCanta , is the stream provided here useful to you? let me know if you are looking for specific use case and i can try to get you a test stream for that.
Super useful. I've started looking into this, we should be able to push it to the dev branch relatively soon.
Awesome!
@mikulbhatt, do you think you can provide a VOD stream with at least one encrypted to clear and one clear to encrypted transition? That would ease the testing process.
@AquilesCanta I have some VOD HLS widevine content if that would be helpful for you
That'd be useful too. We just need the clear/encrypted transitions.