Fixing failing 'should return MediaError for bad filename' Media test case

This commit is contained in:
Simon MacDonald 2012-08-31 12:50:23 -04:00
parent 4d5e452ece
commit 12e5b39c05

View File

@ -468,7 +468,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
try {
this.loadAudioFile(file);
} catch (Exception e) {
e.printStackTrace();
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', "+MEDIA_ERROR+", { \"code\":"+MEDIA_ERR_ABORTED+"});");
}
return false;
case MEDIA_LOADING:
@ -493,7 +493,6 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
try {
this.loadAudioFile(file);
} catch (Exception e) {
e.printStackTrace();
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', " + MEDIA_ERROR + ", { \"code\":" + MEDIA_ERR_ABORTED + "});");
}
//if we had to prepare= the file, we won't be in the correct state for playback