Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRM content #33

Open
TDUser91 opened this issue Jul 19, 2023 · 1 comment
Open

DRM content #33

TDUser91 opened this issue Jul 19, 2023 · 1 comment

Comments

@TDUser91
Copy link

how do I play drm streaming content using this library ? Thank you

example dataSource:

url : https://storage.googleapis.com/shaka-demo-assets/angel-one-widevine/dash.mpd
license: https://cwip-shaka-proxy.appspot.com/no_auth
@pluvd7j
Copy link

pluvd7j commented Jan 2, 2024

@TDUser91 you can go with this way

import React, { useRef, useEffect } from 'react'
import ShakaPlayer from 'shaka-player-react'
import 'shaka-player/dist/controls.css'

const Player = () => {
const shakaRef = useRef(null)
const drmLicenseUrl = 'https://cwip-shaka-proxy.appspot.com/no_auth'
const { player, ui, videoElement } = shakaRef?.current

useEffect(()=>{
if (drmLicenseUrl !== '') {
          player?.configure({
            drm: {
              servers: {
                'com.widevine.alpha': drmLicenseUrl,
              },
            },
            })
            }
},[)

            
          
return(
 <ShakaPlayer
        autoPlay
        ref={shakaRef}
        src={'https://storage.googleapis.com/shaka-demo-assets/angel-one-widevine/dash.mpd'}
      />)
            }
    export default Player;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants