- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
谁能帮我知道现在要传递ContentProtectionCallback
,以便我可以在shaka播放器中处理drm许可证网址的preProcessor
[http://v1-6-2.shaka-player-demo.appspot.com/docs/tutorial-network.html][1]
var manifestUri =
'<mpd url>';
function initApp() {
// Install built-in polyfills to patch browser incompatibilities.
shaka.polyfill.installAll();
// Check to see if the browser supports the basic APIs Shaka needs.
if (shaka.Player.isBrowserSupported()) {
// Everything looks good!
initPlayer();
} else {
// This browser does not have the minimum set of APIs we need.
console.error('Browser not supported!');
}
}
function initPlayer() {
// Create a Player instance.
var video = document.getElementById('video');
var player = new shaka.Player(video);
player.configure({
drm: {
servers: {
'com.widevine.alpha': '<server url>',
}
}
});
// Attach player to the window to make it easy to access in the JS console.
window.player = player;
// Listen for error events.
player.addEventListener('error', onErrorEvent);
// Try to load a manifest.
// This is an asynchronous process.
player.load(manifestUri).then(function () {
// This runs if the asynchronous load is successful.
console.log('The video has now been loaded!');
}).catch(onError); // onError is executed if the asynchronous load fails.
}
function onErrorEvent(event) {
// Extract the shaka.util.Error object from the event.
onError(event.detail);
}
function onError(error) {
// Log the error.
console.error('Error code', error.code, 'object', error);
}
document.addEventListener('DOMContentLoaded', initApp);
[1]: http://v1-6-2.shaka-player-demo.appspot.com/docs/tutorial-network.html
最佳答案
请阅读此tutorial 。在此页面中,解释了如何在请求之前或之后处理许可证。我假设 ContentProtectionCallback 是一个处理程序,用于在向服务器发出许可证请求之前对其进行操作。对于本例:
player.getNetworkingEngine().registerRequestFilter(function(type, request) {
// Manipulate request before is sent.
if (type == shaka.net.NetworkingEngine.RequestType.LICENSE) {
const body = request.body;
// Do something with the body. Then, assign it back.
request.body = manipulateBody(body)
}
});
您也可以使用 registerResponseFilter
方法对响应应用相同的过程
关于javascript - 现在如何知道在 SHAKA PLAYER 中传递内容保护回调?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52835532/
我正在尝试在 shaka 播放器上加载 VOD。这是我的网址: https://5b48f8f32d3be.streamlock.net/023a27950bd44774/mp4:22436e792e
Class: shaka.offline.Storage 有一个构造函数 new Storage(player) Class: shaka.Player 有一个构造函数 new Player(vide
即使我在播放器配置中提供了无效的解密 key ,我还是无法弄清楚 shaka 播放器如何能够解密我的 CENC 保护内容。 player.configure({ drm: { cl
谁能帮我知道现在要传递ContentProtectionCallback,以便我可以在shaka播放器中处理drm许可证网址的preProcessor [http://v1-6-2.shaka-pla
我们正在寻求使用 Shaka 播放器,我已经在此处试用了该播放器的演示:https://shaka-player-demo.appspot.com/demo/ .我们的要求之一是让用户能够更改隐藏式字
我想使用 Shaka Player 播放具有多种分辨率的视频。具有多种质量的单个视频。 我已经检查了 shaka 播放器的所有 api。但我不知道该怎么做。 我应该有一个视频标签,我必须传递一个 DA
我已经创建了一个测试 html 页面来播放受 MPEG-CENC 保护的 MPEG-DASH 视频,如果我在 player.configure() 中指定 kid: key 对,我就可以播放。 然后我
我正在尝试为视频大小可能不同的 LMS 网站编码和打包上传的视频。如何编写 sh 脚本,根据其大小转换和打包给定视频(例如,如果给定的视频分辨率大于 720p 且小于 1080p FFmpeg 应该转
我一直在尝试在 ShakaPlayer 中播放加密的 .WEBM 媒体文件,但没有取得多大成功,我在这里寻求任何经历过这种情况的人的建议。如果这个很棒的开发者社区中的某个人可以在这里指导我,那就太好了
我尝试执行 Shaka Player在我的 Go 项目中。这是项目结构: . ├── client │ ├── index.html │ ├── shaka.js │ └── shaka-
我正在构建基于订阅的视频点播服务。对于内容保护,我选择 Widevine 和 Azure Media Services 进行许可证交付,100 个许可证的费用为 0.20 美元。用于媒体打包的 Sha
我遵循与 DASH 视频一起使用的 shaka 的基本用法,但在尝试加载 M3U8 时抛出错误代码 4032。 import * as muxjs from 'mux.js'; import * as
我遵循与 DASH 视频一起使用的 shaka 的基本用法,但在尝试加载 M3U8 时抛出错误代码 4032。 import * as muxjs from 'mux.js'; import * as
我正在开发一个小型系统,用于使用 MSE/EME API 在 Web 上流式传输 protected 内容。 这是我正在使用的一些工具: FFMPEG Google 的 Shaka-Packager
我是一名优秀的程序员,十分优秀!