I am using below code to play video store on local machine but I am getting error in chrome like Not allowed to load local resource: file:/// while in Firefox web browser I am getting video format or MIME type is not supported.
<video src="{{trainingVideoURL | trustAsResourceUrl}}" width="500" height="300" style="margin-left:200px;" controls="controls" type="video/mp4">
</video>
Below is the controller where getting url
function loadPreReqs() {
$scope.trainingVideoIdPk=$routeParams.trainingVideoIdPk;
trainingFactory.getTrainingVideoPath($scope.trainingVideoIdPk).success(function(data) {
$scope.trainingVideoURL= data;
}).error(function(error){
alert(error.status);
});
}
filter with $sce to avoid blocking loading a resource from an insecure URL
.filter('trustAsResourceUrl', function ($sce) {
return function(videoPath) {
return $sce.trustAsResourceUrl('file://'+ videoPath);
};
});
and I am getting below error while trying to play video Not allowed to load local resource: file:///home/abc/project/Training/videos/Oral%20&%20Maxillofacial%20Surgery.mp4 in chrome
I tried other solution as well as suggested in this post Getting "Not allowed to load local resource" error while trying to attach a MediaSource object as the source of a HTML5 video tag
but got the error: GET http://home/abc/project/Training/videos/Oral%20&%20Maxillofacial%20Surgery.mp4 net::ERR_NAME_NOT_RESOLVED