HTML5视频无法正常工作与AngularJS NG-SRC标签无法正常、标签、工作、视频

2023-09-10 13:27:36 作者:屌姐 o┤*`□′ *├o

AngularJS NG-SRC HTML5的视频元素在这拨弄不起作用:的 http://jsfiddle.net/FsHah/5/

AngularJS ng-src doesn't work with HTML5 Video element in this fiddle: http://jsfiddle.net/FsHah/5/

看视频元素,将src标签被填入正确的SRC URI,但不能播放视频。

Looking at video element, the src tag is being populated with the correct src uri, but the video doesn't play.

难道这不支持中的 AngularJS ,有什么解决方法吗?

Is this not supported in AngularJS, what is the workaround for this?

推荐答案

只需创建一个过滤器:

app.filter("trustUrl", ['$sce', function ($sce) {
        return function (recordingUrl) {
            return $sce.trustAsResourceUrl(recordingUrl);
        };
    }]);

在查看文件:

<audio src="{{Your_URL | trustUrl}}" audioplayer controls></audio>