VideoPlayer
VideoPlayer copied to clipboard
TypeError: Cannot read property 'streamingMedia' of undefined
After installing the plugin using command:
cordova plugin add com.hutchind.cordova.plugins.streamingmedia
and then calling it from AngularJs app from ng-click="playBack(movie.MovieID)"
$scope.playBack = function (movieId) {
//console.log(movieId);
var url = 'http://<someurl>';
window.plugins.streamingMedia.playVideo(url); //error
}
Am I missing something? And also would it play m3u8 live stream as well?
Did you ever figure this out?
Sorry, I don't recall. Here is the code that I find in that project that worked on ios + android + emulators, but not in browser:
... if (angular.isUndefined(window.plugins)) { var msg = 'Sorry, playback is available on device only, media url: ' + movieUrl; $scope.dialogOkDisplay(msg); } else { window.plugins.streamingMedia.playVideo(movieUrl); } ...