Closed zalazarc20 closed 1 year ago
I am using mpd link which need drm clearkey, when i use
player.configure({ drm: { clearKeys: {"123":"456"} // example clearkey } })
I get this error
Cannot read properties of null (reading 'configure')
Is it not possible to use drm with this component? I'll keep investigating because I'm also getting the same error from myplayer.load
, but if someone has already encountered this error, your help would be usefulSorry for my bad English and thanks for reading my problem.
I just found the solution by reading the base code.
my solution was the following
const Player = ({ link, ck = null }) => {
const controllerRef = useRef(null);
const [drm, setDrm] = useState({})
useEffect(() => {
setDrm({drm: {
clearKeys: ck != null ? JSON.parse(atob(ck)) : {}
}});
}, [link, ck]);
return <ShakaPlayer config={drm} autoPlay ref={controllerRef} src={link} />;
}
Sorry I didn't realize how simple it was to figure it out and this project is great. :heart:
I am using mpd link which need drm clearkey, when i use
I get this error
Cannot read properties of null (reading 'configure')
Is it not possible to use drm with this component? I'll keep investigating because I'm also getting the same error from myplayer.load
, but if someone has already encountered this error, your help would be usefulSorry for my bad English and thanks for reading my problem.