HTML5 Video is not working with AngularJS ng-src tag

后端 未结 10 1161
北恋
北恋 2020-11-29 02:25

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 popu

10条回答
  •  旧巷少年郎
    2020-11-29 02:32

    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.

提交回复
热议问题