videojs / videojs-contrib-eme

Supports Encrypted Media Extensions for playback of encrypted content in Video.js
Other
200 stars 71 forks source link

How to refetch Fairplay license on player.src changing #178

Open EugenPulup opened 1 year ago

EugenPulup commented 1 year ago

How i can make player re-fetch Fairplay license for new video, if i start play new video via player.src(source) . On changing sources player dont fetch new Fairplay license , and fall with error. As i understood fairplay cant start to play new DRM protected source if its dont the same video.

Also i found same issue at fairplay npm module, comment from there : "New Fairplay content cannot be played once MediaKeys have been attached to the video element (Unless its the same source). To get around this issue we need to clear those keys."

As i understood i need to clear/close some DRM session or data, that eme create.

EugenPulup commented 1 year ago
delete videojs.getAllPlayers()[0].eme;
await videojs.getAllPlayers()[0].eme();

I found that if I remove the eme object from the player and re-create it, the eme plugin will get DRM for new sources.

But i think there are way to do it more nicely 🤔

kaiiisaka commented 4 months ago

I have same problem and deleting eme object don't fix this :-(