这是我app.js中的一个播放功能
$scope.play = function(src){
console.log("Play called");
console.log("SCR : "+src);
var media = new Media(src, null, null, mediaStatusCallback);
$cordovaMedia.play(media);
}
var mediaSuccess = function(){
console.log("success");
}
var mediaError = function(){
console.log("Error called");
}
var mediaStatusCallback = function(status) {
console.log("media status call back called.!");
if(status == 1){
$ionicLoading.show({template: 'Loading'});
} else {
$ionicLoading.hide();
}
}
它返回错误:
error TypeError: undefined is not a function
at Scope.$scope.play (http://192.168.1.103:8100/js/app.js:42:17)
at $parseFunctionCall (http://192.168.1.103:8100/lib/ionic/js/ionic.bundle.js:21044:18)
at http://192.168.1.103:8100/lib/ionic/js/ionic.bundle.js:53458:9
at Scope.$eval (http://192.168.1.103:8100/lib/ionic/js/ionic.bundle.js:23100:28)
at Scope.$apply (http://192.168.1.103:8100/lib/ionic/js/ionic.bundle.js:23199:23)
at HTMLButtonElement.<anonymous> (http://192.168.1.103:8100/lib/ionic/js/ionic.bundle.js:53457:13)
at HTMLButtonElement.eventHandler (http://192.168.1.103:8100/lib/ionic/js/ionic.bundle.js:11713:21)
at triggerMouseEvent (http://192.168.1.103:8100/lib/ionic/js/ionic.bundle.js:2863:7)
at tapClick (http://192.168.1.103:8100/lib/ionic/js/ionic.bundle.js:2852:3)
at HTMLDocument.tapTouchEnd (http://192.168.1.103:8100/lib/ionic/js/ionic.bundle.js:2975:5)
我已经尝试了我能找到的所有互联网,但仍然无法正常工作。