This issue was under opus - I deleted it from there and reposted it with its own thread so it wouldn't confuse others.
I want to add simple encryption to the generated HLS, The encryption should work on all major browsers (including IOS, Safari, Chrome, Edge, etc.), After research, I understand that I'm looking for a Clear Key encryption with a server key so the browser asks the server to give the key and decrypt the fragments.
In the end, we should get something like this: HLS AES-128/ClearKey - and this should work on all browsers.
and when I try to load it in https://shaka-player-demo.appspot.com/demo/#audiolang=en-US;textlang=en-US;uilang=en-US;panel=CUSTOM%20CONTENT;build=uncompiled I get the following error: [Shaka Error DRM.REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE ()](https://shaka-player-demo.appspot.com/docs/api/shaka.util.Error.html#value:6001).
I tried it on a Chrome browser on a Windows 11 machine.
I'm not sure what I do rung, can you help me, please?
----- update with player configuration ----
When I configure the shaka player like this:
const manifestUri =
'https://www.httpstest.com:616/hls.m3u8';
function initApp() {
shaka.log.setLevel(shaka.log.Level.V2);
shaka.polyfill.installAll();
if (shaka.Player.isBrowserSupported()) {
initPlayer();
} else {
console.error('Browser not supported!');
}
}
async function initPlayer() {
const video = document.getElementById('video');
const player = new shaka.Player(video);
player.configure({
drm: {
clearKeys: {
// 'key-id-in-hex': 'key-in-hex',
'8858d6731bee84d3b6e3d12f3c767a26': '1ae8ccd0e7985cc0b6203a55855a1034'
},
}
});
window.player = player;
player.addEventListener('error', onErrorEvent);
try {
await player.load(manifestUri);
console.log('The video has now been loaded!');
} catch (e) {
onError(e);
}
}
function onErrorEvent(event) {
onError(event.detail);
}
function onError(error) {
console.error('Error code', error.code, 'object', error);
}
document.addEventListener('DOMContentLoaded', initApp);
The video is played.
In addition, when I switch the drm configuration to:
I can also see the video (the player sends a request to get the key, and gets in response: { "keys": [ { "k": "GujM0OeYXMC2IDpVhVoQNA", "kty": "oct", "kid": "iFjWcxvuhNO249EvPHZ6Jg" } ], "type": "temporary" } and play the video.
When I don't configure the player with drm at all, I get: "Shaka Error DRM.ENCRYPTED_CONTENT_WITHOUT_DRM_INFO ()" and the player does not try to send a request for the key at all.
This issue was under opus - I deleted it from there and reposted it with its own thread so it wouldn't confuse others.
I want to add simple encryption to the generated HLS, The encryption should work on all major browsers (including IOS, Safari, Chrome, Edge, etc.), After research, I understand that I'm looking for a Clear Key encryption with a server key so the browser asks the server to give the key and decrypt the fragments.
In the end, we should get something like this: HLS AES-128/ClearKey - and this should work on all browsers.
This is the pipeline.yaml I tried:
I edited the shaka-streamer code here: https://github.com/shaka-project/shaka-streamer/blob/f2d3445e4582cd21ec5ae5143549f744e91d5e86/streamer/packager_node.py#L238 and added the following to support key_server_url:
to have support in
hls_key_uri
.The problem is, I get the following
m3u8
file:and when I try to load it in
https://shaka-player-demo.appspot.com/demo/#audiolang=en-US;textlang=en-US;uilang=en-US;panel=CUSTOM%20CONTENT;build=uncompiled
I get the following error:[Shaka Error DRM.REQUESTED_KEY_SYSTEM_CONFIG_UNAVAILABLE ()](https://shaka-player-demo.appspot.com/docs/api/shaka.util.Error.html#value:6001)
. I tried it on aChrome
browser on aWindows 11
machine.I'm not sure what I do rung, can you help me, please?
----- update with player configuration ----
When I configure the
shaka player
like this:The video is played.
In addition, when I switch the
drm
configuration to:I can also see the video (the player sends a request to get the key, and gets in response:
{ "keys": [ { "k": "GujM0OeYXMC2IDpVhVoQNA", "kty": "oct", "kid": "iFjWcxvuhNO249EvPHZ6Jg" } ], "type": "temporary" }
and play the video.When I don't configure the player with
drm
at all, I get:"Shaka Error DRM.ENCRYPTED_CONTENT_WITHOUT_DRM_INFO ()"
and the player does not try to send a request for the key at all.