videojs / videojs-contrib-eme

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

Clear video state when reusing the same video element #197

Open ion-cojocaru opened 8 months ago

ion-cojocaru commented 8 months ago

I am encountering an issue while using a shared video element to play different video types. Specifically, I have implemented a 360 player using Three.js. However, I observed an issue following a prior setting of keySystems in the player.src for a DRM video. This retained state affects the 360 player, resulting in a black screen display.

I discovered that setting the video element's media keys to null resolves the issue with the 360 player, but it adversely affects subsequent DRM video playback.

I'm seeking guidance on how to reset the video element's state after changing the src without causing any unintended side-effects. Is there a way to achieve this?