qais qais - 1 year ago 256
Ajax Question

HTML5 Video is not working with AngularJS ng-src tag


doesn't work with HTML5 Video element in this fiddle:

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

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

Answer Source

Just Create a Filter:

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

In View File:

<audio src="{{Your_URL | trustUrl}}" audioplayer controls></audio>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download