Javascript 现在如何知道在SHAKA PLAYER中传递ContentProtectionCallback?
现在有谁能帮我知道如何传递ContentProtectionCallback,以便我可以在shaka player中处理drm许可证url的预处理器 [ 请阅读此页。在此页中,将解释如何在请求之前或之后处理许可证。我假设ContentProtectionCallback是一个处理程序,用于在向服务器发出许可证请求之前对其进行处理。在这种情况下:Javascript 现在如何知道在SHAKA PLAYER中传递ContentProtectionCallback?,javascript,html,mpeg-dash,media-source,shaka,Javascript,Html,Mpeg Dash,Media Source,Shaka,现在有谁能帮我知道如何传递ContentProtectionCallback,以便我可以在shaka player中处理drm许可证url的预处理器 [ 请阅读此页。在此页中,将解释如何在请求之前或之后处理许可证。我假设ContentProtectionCallback是一个处理程序,用于在向服务器发出许可证请求之前对其进行处理。在这种情况下: player.getNetworkingEngine().registerRequestFilter(function(type, request)
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方法对响应应用相同的过程
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)
}
});