Ste*_*evo 14 javascript audio html5 angularjs
我试图使用角度ngRepeat与html5音频标签.我有html:
<li ng-repeat="recordings in recordinglist">
<audio controls ng-src="{{recordings}}"></audio>
</li>
Run Code Online (Sandbox Code Playgroud)
和js:
$scope.$apply($scope.recordinglist.push("blob:http%3A//localhost%3A9000/67ecfa65-3394-45a6-8f29-42f3421a2727"));
Run Code Online (Sandbox Code Playgroud)
但是,角度相同的原点检查会导致插值错误:
Error: [$interpolate:interr] Can't interpolate: {{recordings}}
Error: [$sce:insecurl] Blocked loading resource from url not allowed by $sceDelegate policy. URL: blob:http%3A//localhost%3A9000/67ecfa65-3394-45a6-8f29-42f3421a2727
Run Code Online (Sandbox Code Playgroud)
这看起来很傻.它不是内插本地资源.我想有一种方法可以正确地做到这一点 - 或者我应该提交错误报告?
fra*_*rxu 20
我之前尝试为webrtc视频显示blob src时遇到同样的问题,我使用$ sce服务修复了它:
angular.module('moduleName', ['ngSanitize'])
.controller('ctrName', ['$sce', function($sce) {
$scope.recordings = $sce.trustAsResourceUrl(recordings);
}])
Run Code Online (Sandbox Code Playgroud)
您也可以在这里查看文档.
| 归档时间: |
|
| 查看次数: |
15646 次 |
| 最近记录: |