Hey!
I recently started trialing with playback using ClearKey instead of Widevine.
I have basically two functions in my code.
First one is PlayVideo
function, which fetches the video data from the API which returns the needed data for playlist.
My playlist is built as following;
{
"dash": "videourl.mpd",
"description": "desc",
"drm": {
"clearkey": [{
"key":"valid-key",
"kid":"valid-kid"
}]
},
"title":"title-of-video"
}
And once I have that playlist string, I use player.load(playlist)
which starts the playback of the video normally with no issues.
But then I have function PlayNextVideo()
, which again recalls my API, fetches the ID of the next video, and then with that ID calls the PlayVideo
function again. And here is where the issue comes up, when the player.load(playlist)
is called 2nd time on the same page, it loads the video source, title, description, everything properly to the player element on the page, but the video doesn’t get decrypted despite including the correct set of ClearKeys on the playlist.
I’m 99% sure the issue is lying somewhere in the ClearKey feature, because everything else loads properly on the player, expect it doesn’t just get decrypted.
So my question is that is there any function / API which I could use to a) verify which ClearKeys are currently active on the player b) to possibly forcefully to wipe off the old ClearKeys from the player before loading the new source.
Before shifting to use of ClearKey, I used Widevine DRM with the same playlist format and exactly same functions and it worked wonderfully with no issues on loading follow up videos.
This issue only started when I shifted from Widevine to ClearKey, and only thing separating those is the use of ClearKey instead of Widevine DRM.
Right now my hotfix to this issue has been destroying the player when calling PlayNextVideo and then creating new player, but naturally that isn’t the most optimal solution.