-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 protected content only plays when in remote debugjs mode #1921
Comments
If you override the |
@EyMaddis I tried adding the third parameter also and its not playing. Is there a sample I can look into? |
Unfortunately not, I also do not use this right now. I was just trying to implement my DRM service (Axinom) and was hacking around with manually decoding the base64 (third parameter). However, for me the fix was to avoid getLicense and only set the header Maybe you can post your getLicense and I can take a look. Edit: Check if your getLicense code is used at all. See here: https://github.com/react-native-community/react-native-video/pull/1445/files#diff-2a97390647ad4fd466bccc2c92e7864eR236 Related Issue: #1445 Another edit: getLicense: async (
spc: string,
contentId: string,
spcBase64: string
) => {
try {
console.warn('sending license request!', spcBase64)
const blob = Buffer.from(spcBase64, 'base64')
// const blob = Buffer.from(spcString, 'ascii')
console.warn('sending license request!', blob)
const license = await fetch(fairplay.licenseUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/octet-stream',
},
body: blob,
})
.then(response => {
console.warn('got license as blob!')
return response.blob()
})
.then(response => {
// React Native does not properly handle
console.warn('blob2base64')
return new Promise((resolve, reject) => {
const reader = new FileReader()
reader.onload = () => {
const dataURL = reader.result
console.warn('Got DATA URL!')
resolve(
// @ts-ignore
dataURL.replace(
'data:application/octet-stream;base64,',
''
)
)
}
reader.onerror = err => {
reject(new Error('could not turn '))
}
reader.readAsDataURL(response)
})
})
.catch(error => {
console.error('Fairplay error', error)
})
return license
} catch (e) {
console.error('could not get license', e)
}
},``` |
This is based on the approved PR:
|
Then go into your node_modules folder, and find this line: Then change it to |
yep that fixed it. thanks @EyMaddis |
Please close this ticket and maybe offer your support on the other PR, if possible :) |
I have a video streaming app and plays DRM protected content. The video only plays when i debug mode only. If I turn off the debug mode the video doesn't play and displays, video not available.
Which player are you experiencing the problem on:
The text was updated successfully, but these errors were encountered: