videojs-contrib-eme
videojs-contrib-eme copied to clipboard
FairPlay: Occurred an error when loading a decrypted HLS content
I've tried to load and play a decrypted HLS content, but It' doesn't work. because occurred an error as bellow.

I guessed It's because of Videojs attempt to request http with sdk://
It plays normally on the test page of Pallycon.
execution environments:
- OS: macOS High Sierra 10.13.6
- Safari: 13.1.2
using libraries
- videojs: ^7.8.4
- videojs-contrib-eme: ^3.7.0
DRM Vendor
- Pallycon
Source
`
const playerConfig = {
src: "https://mz-cm-transcoding-output.s3.ap-northeast-2.amazonaws.com/mz-cm-v1/assets/1604917161khae8nfj/Beach+-+19987.m3u8",
type: 'application/x-mpegurl',
keySystems: {
'com.apple.fps.1_0': {
getCertificate: function (emeOptions, callback) {
videojs.xhr({
url: "https://license.pallycon.com/ri/fpsKeyManager.do?siteId=<SITE_ID>",
method: 'GET',
}, (err, response, responseBody) => {
if (err) {
callback(err)
return
}
callback(null, base64DecodeUint8Array(responseBody));
})
},
getContentId: function (emeOptions, initData) {
const contentId = arrayToString(initData);
return contentId.substring(contentId.indexOf('skd://') + 6);
},
// return content ID
getLicense: function (emeOptions, contentId, keyMessage, callback) {
videojs.xhr({
url: <license_url>,
method: 'POST',
responseType: 'text',
body: 'spc=' + base64EncodeUint8Array(keyMessage),
headers: {
'Content-type': 'application/x-www-form-urlencoded',
'pallycon-customdata-v2':
player.src(playerConfig);
`