0

Flutter application is implemented for both mobile and web versions. We have a player to stream DRM content. And for android native by using ExoPlayer support we are able to play the DRM content. Below is some package used for providing the license for player.

com.google.android.exoplayer2.source.dash.DashMediaSource
com.google.android.exoplayer2.drm.DrmSessionManager
com.google.android.exoplayer2.source.smoothstreaming.SsMediaSource
com.google.android.exoplayer2.source.ProgressiveMediaSource
com.google.android.exoplayer2.source.hls.HlsMediaSource

Now we would like to play the same DRM content with web version. We are using 'VideoElement' to play the stream url. VideoElement is working fine for normal video url's but we are not finding the way to play DRM content in it. In other way, we are not able to provide license URL in VideoElement of web version to play DRM content.

Present web video player code is mentioned below.

 videoElement = VideoElement()
      ..src = uri
      ..autoplay = false
      ..controls = false
      ..style.border = 'none';

    videoElement.setAttribute('playsinline', 'true');

    ui.platformViewRegistry.registerViewFactory(
        'videoPlayer-$textureId', (int viewId) => videoElement);

Any suggestions to add license url/ play the DRM url.

Raghu Mudem
  • 6,793
  • 13
  • 48
  • 69
  • If I understand correctly, you want to play an encryted media in web. This is definitely possible as per my understanding. You will have to do the the decryption and using dart or js interops and then set the src content of the video tag. One example how its done in JS is available [here](https://github.com/samdutton/simpl/blob/gh-pages/mse/js/main.js). Main article to understand EME is [here](https://www.html5rocks.com/en/tutorials/eme/basics/) – Abhilash Chandran Apr 15 '21 at 11:16
  • Additional information is also available in this SO [post](https://stackoverflow.com/questions/2983555/is-there-a-way-to-use-drm-on-html5-video) – Abhilash Chandran Apr 15 '21 at 11:18
  • @AbhilashChandran Thanks for the reply. I will check your url reference will workout for me. – Raghu Mudem Apr 15 '21 at 12:33
  • 1
    @MeetParsaniya I can give a minimal clues. It can be done with the help of a html page + shaka-player.ui.js + javascript interface. I do not have sample codes for this. But you can find in internet. The key to load the licenseUrl should be similar to the code: player.configure({ drm: { servers: { 'com.widevine.alpha': licenseServerURL } } }); – Raghu Mudem Jan 19 '23 at 09:19

0 Answers0