Video not playing in angularjs -
i have url of video. video not playing properly. tried $sce
don't know problem. new in angularjs.
$scope.videoapi = function(id) { $http({ method: "post", url: "http://192.168.1.16:8070/courseapi/getpdf", data: { 'id_course': id } }).then(function mysucces(response) { alert("listapi" + json.stringify(response.data)); var videourl = response.data; $scope.trustedurl = $sce.trustasresourceurl(videourl); }, function myerror(response) { $scope.message = response.statustext; console.log(response.statustext); alert("courseenrolled"); }); }
the view code
<video width="320" height="240" controls> <source ng-src="{{trustedurl}}" type="video/mp4"> <source ng-src="{{trustedurl}}" type="video/ogg"> </video>
Comments
Post a Comment