Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/387.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 现在如何知道在SHAKA PLAYER中传递ContentProtectionCallback?_Javascript_Html_Mpeg Dash_Media Source_Shaka - Fatal编程技术网

Javascript 现在如何知道在SHAKA PLAYER中传递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)

现在有谁能帮我知道如何传递ContentProtectionCallback,以便我可以在shaka player中处理drm许可证url的预处理器

[

请阅读此页。在此页中,将解释如何在请求之前或之后处理许可证。我假设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方法对响应应用相同的过程

  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)
    }
  });