showing results for - "stream videos using angularjs"
Eric
01 Nov 2019
1
2https://github.com/2fdevs/videogular
3OR
4creating your own custom directive can does the job for you (Preferred and reusable),
5
6The simplest way is using angular.element and selecting the required video element from the DOM using its functionalities.
7
8 <video autoplay="autoplay" preload="auto" ng-click="pauseOrPlay()">
9 <source src="{{url }}" type="video/mp4" />
10 </video>
11//controller
12
13function myCtrl($scope) {
14   $scope.url = "url of video or audio"
15   $scope.pauseOrPlay = function(ele){
16     var video = angular.element(ele.srcElement);
17     video[0].pause(); // video.play()
18   }
19}