HTML5 Video is not working with AngularJS ng-src tag

后端 未结 10 1154
北恋
北恋 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:27

    You can use ng-media module.

    angular.module('app', ['media'])
        .controller('mainCtrl', function($scope) {
            
            $scope.videoSources = [];
            
            $scope.loadVideos = function() {
                $scope.videoSources.push('http://www.w3schools.com/html/mov_bbb.mp4');
                $scope.videoSources.push('http://www.w3schools.com/html/mov_bbb.webm');
            };
        });
    
    
    
    

    Plunker.

提交回复
热议问题