pano.player() API bug?

Q&A about the latest versions
Post Reply
ffurger
Posts: 105
Joined: Mon Mar 24, 2014 11:45 am

I have included a sound in my project and set the loop parameter to 0.
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;
	})
}
Any ideas as how to fix this, or did I misunderstood how the loop parameter work?

Thank you for your help
User avatar
Hopki
Gnome
Posts: 13025
Joined: Thu Jan 10, 2008 3:16 pm
Location: Layer de la Haye, Essex UK
Contact:

HI,
With loop set to 0, what should happen is on player click you it should start to play the media.
If set to -1, then you will need a button click to start the media.
If start muted is selected the video should autoplay but with no sound, but as soon as you click in the pano the sound should play.
This is what the browsers are looking for, media with sound.
Regards,
Garden Gnome Support
If you send an e-mail to support please send a link to the forum post for reference.
support@ggnome.com
https://ggnome.com/wiki/documentation/
Post Reply