Now, it looks as if pano2VR with loop = 0 would start playing immediately upon page load.
However, as far as I can tell browsers don't allow this behavior (in the past it has been abused by advertisers).
A user must manually hit the play button to hear the sound.
So although the sound doesn't play, the method pano.isPlaying( sound ) returns TRUE.
As a result, hitting the play button initially doesn't start the player.
Only after hitting the play button a second time the player actually starts playing.
Here is the relevant code snippet:
Code: Select all
function toggleSoundPlayer( sound ){
$("#soundPlayerGUI").on("click", function(){
console.log( pano.isPlaying( sound ) ); ====> TRUE
if ( pano.isPlaying( sound ) ) {
pano.pauseSound( sound )
showPlayGUI()
} else {
pano.playSound( sound )
showPauseGUI()
}
return false;
})
}
Thank you for your help