AngularJS ng-src
doesn't work with HTML5 Video element in this fiddle: http://jsfiddle.net/FsHah/5/
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?
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>
To play the video I just used the following method have a button called play and in the ng-click of the button you have to write this
var myVideo = document.getElementsByTagName('video')[0];
myVideo.src = vidURL;
myVideo.load();
myVideo.play();
to play video in ng-repeat use index. hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With