Permalink
Browse files

playAudio and pauseAudio only accessible from device

  • Loading branch information...
1 parent f6bf161 commit ec939a2719f5dbc53e417e48afbadef68b067c0e @PeterOdeus committed Feb 18, 2012
Showing with 17 additions and 13 deletions.
  1. +17 −13 assets/www/sound.js
View
@@ -5,26 +5,30 @@ var my_media = null;
// Play audio
//
function playAudio() {
- if(shouldPlayPlatformSpecificAudio == true){
- window.JSInterface.playAudio();
- }else{
- // Create Media object from src
- if(my_media == null){
- my_media = new Media(getAudioSource(), onAudioSuccess, onAudioError);
+ if(isInBrowserModeOnly == false){
+ if(shouldPlayPlatformSpecificAudio == true){
+ window.JSInterface.playAudio();
+ }else{
+ // Create Media object from src
+ if(my_media == null){
+ my_media = new Media(getAudioSource(), onAudioSuccess, onAudioError);
+ }
+ // Play audio
+ my_media.play();
}
- // Play audio
- my_media.play();
}
}
//Pause audio
//
function pauseAudio() {
- if(shouldPlayPlatformSpecificAudio == true){
- window.JSInterface.pauseAudio();
- }else{
- if (my_media) {
- my_media.pause();
+ if(isInBrowserModeOnly == false){
+ if(shouldPlayPlatformSpecificAudio == true){
+ window.JSInterface.pauseAudio();
+ }else{
+ if (my_media) {
+ my_media.pause();
+ }
}
}
}

0 comments on commit ec939a2

Please sign in to comment.