Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.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
Angularjs 使用videogular请求受保护的音频源_Angularjs_Http_Jwt_Videogular_Json Web Token - Fatal编程技术网

Angularjs 使用videogular请求受保护的音频源

Angularjs 使用videogular请求受保护的音频源,angularjs,http,jwt,videogular,json-web-token,Angularjs,Http,Jwt,Videogular,Json Web Token,我目前正在尝试从后端获取一些音频资源,每个请求都需要一个JWT,我无法禁用安全性,大部分音频文件来自私人会议 问题是,我找不到在videogular请求中设置所需的标题字段的位置 我已经用$httpProvider和angular jwt在所有路由上设置了头 angular.module('bnApp').config(['$compileProvider', '$httpProvider', 'jwtInterceptorProvider', function ($compileProvid

我目前正在尝试从后端获取一些音频资源,每个请求都需要一个JWT,我无法禁用安全性,大部分音频文件来自私人会议

问题是,我找不到在videogular请求中设置所需的标题字段的位置

我已经用$httpProvider和angular jwt在所有路由上设置了头

angular.module('bnApp').config(['$compileProvider', '$httpProvider', 'jwtInterceptorProvider', 
function ($compileProvider, $httpProvider, jwtInterceptorProvider) {
    $compileProvider.debugInfoEnabled(true);

    jwtInterceptorProvider.tokenGetter = [function() {
        return localStorage.getItem('token');
    }];
    $httpProvider.interceptors.push('jwtInterceptor');
}]);
但这似乎对音频文件不起作用

希望这是足够的信息


谢谢你

你有没有想过这个问题?不是官方的,这更像是一个解决办法,而不是一个solution@CodingFerret我也有同样的问题,你能解释一下你的解决方法吗?你有没有弄明白这个问题?不是正式的,这更像是一个解决方法而不是一个解决方法solution@CodingFerret我也有同样的问题,你能解释一下你的解决方法吗?