Implemented widevine drm with videojs for dash streams and it works great on desktop and mobile, however I get an error message playing it in a mobile app's webview. The error is:
Uncaught (in promise) NotSupportedError: Unsupported keySystem or supportedConfigurations.
Explain in detail the exact steps necessary to reproduce the issue.
Playing video content
No playback and error message
Uncaught (in promise) NotSupportedError: Unsupported keySystem or supportedConfigurations.
Please include any additional information necessary here. Including the following:
chrome webview?
Android 8+
videojs-contrib-eme
_vjs.eme();
_source = {
src: options.url,
type: _mime,
keySystems: {
'com.widevine.alpha': {
getLicense: function(emeOptions, keyMessage, callback){
var message = new Uint8Array(keyMessage);
videojs.xhr({
uri: 'https://wv-keyos.licensekeyserver.com/',
method: 'POST',
responseType: 'arraybuffer',
body: message,
headers: {
customdata: App.player.drm.key
}
}, function(err, response, responseBody){
if (err) {
callback(err);
return;
}
callback(null, responseBody);
});
}
}
}
};
An Android webview doesn't support DRM by default. You need to override onPermissionRequest in the webview's WebChromeClient, something like
public void onPermissionRequest(PermissionRequest request) {
// Crude example, you need to check which permissions were requested
String[] perms = {PermissionRequest.RESOURCE_PROTECTED_MEDIA_ID};
request.grant(perms);
}
Even then you may find support varies by device.
Thanks @mister-ben for the answer, we'll add this to a FAQ in videojs-contrib-eme
An Android webview doesn't support DRM by default. You need to override
onPermissionRequestin the webview'sWebChromeClient, something likepublic void onPermissionRequest(PermissionRequest request) { // Crude example, you need to check which permissions were requested String[] perms = {PermissionRequest.RESOURCE_PROTECTED_MEDIA_ID}; request.grant(perms); }Even then you may find support varies by device.
@mister-ben Thank you very much Se帽or 馃挴 It worked successfully. 馃憤
An Android webview doesn't support DRM by default. You need to override
onPermissionRequestin the webview'sWebChromeClient, something likepublic void onPermissionRequest(PermissionRequest request) { // Crude example, you need to check which permissions were requested String[] perms = {PermissionRequest.RESOURCE_PROTECTED_MEDIA_ID}; request.grant(perms); }Even then you may find support varies by device.
You are the best, thanks a lot !
I'm having this problem with videojs "7.7.6" on web with m3u8 links also, when I have DRM enable...

@slash197 @mister-ben Can this be related some how with this ?
Thanks in advance.
I'm having this problem with videojs "7.7.6" on web with m3u8 links also, when I have DRM enable...
@slash197 @mister-ben Can this be related some how with this ?
Thanks in advance.
Which drm do you use? playready?
If it is playready, you can try the code whic is shown below,
```
var headers['Authorization'] = yourDRMToken;
this.player.src([
{
type: 'application/x-mpegURL',
src: source,
keySystemOptions: [
{
name: 'com.microsoft.playready',
options: {
serverURL: this.licenseUrlPlayready,
httpRequestHeaders: headers
}
}
]
}
]);
```
Most helpful comment
An Android webview doesn't support DRM by default. You need to override
onPermissionRequestin the webview'sWebChromeClient, something likeEven then you may find support varies by device.