Global VR Videolayer in Panotour

335 views Asked by At

I'm creating a virtual pano tour with several different panoramas linked with a hotspot. On each panorama I have a video hotspot which plays a video.

My problem is, that everytime a new scene loads, I have to touch the display for that the video loads... Panotour also explains, that this behaviour is normal

Now I am looking for a solution, that I can play / stop all the videos with the first touch on entering the vr mode... I've created an array with all the videos and let them play/stop after the first touch but it just loads the videos from the first scene and not from all the other ones.

I've also tried to make a global layer and insert the video source and position with javascript on the play button, but global layers aren't in VR stereo mode

I've tried to put all the video hotspot on the first scene but that doesn't work either because it doesn't allow 2 hotspots with the same ID.

Has anyone an idea how I can get all the videos playing with the first touch on entering the vr mode?

Thank you very much Alex

Panotour Pro 2.5.5

1

There are 1 answers

0
Alex Baur On

For anybody who looks for the same answer, I've managed to play videos all over the tour... I have 5 different scenes with videos on it and it works on all devices

I had to load all the videospots inside the first scene and set them to alpha="0.0". On the first touch, the one to enter the vr mode, I play all the videos and stop them again with javascript.... Additionally I've set the videohotspots to keep="true" so that they stay after a pano change... Then I check which scene is loaded and just set the videos to alpha="1.0"...

The larger part is to set all the videos on the right spot where they should be in the second, third scene... So I manually changed the settings inside index_vr.xml... it takes a lot of time but it works... I've exported the whole tour with the videos inside the correct scenes so that I have the right settings ( ath,atv,width,height,rx,ry,rz) and then I've exported the tour with all the videos on the first scene

The next problem was that the video sound just played inside the mainscene and not where the video should be displayed... So I exported the videos without sound and created with javascript some html5 audio tags inside the body with... On load I play and pause them and then I can control them with javascript. So when I play a video at the same time it plays the audio.

It's a big workaround bit it works really well

Have fun

function player(){
    if(tourplayer == null){
        tourplayer = document.getElementById('krpanoSWFObject');
    }   
return tourplayer; } 

var _objIDs = ['spotvideo2869','spotvideo2870','spotvideo2871','spotvideo2872','spotvideo2873','spotvideo2874','spotvideo2875','spotvideo2876','spotvideo2877','spotvideo2878'];

$.each(_objIDs,function(index,value){
    player().call('hotspot['+value+'].play()');
    player().call('hotspot['+value+'].stop()');
});

$.each(_videoSounds,function(index,value){
    $('#container').prepend(
        '<audio preload="auto" controls style="display: none" id="'+index+'_sound"><source src="indexdata/sounds/'+value+'" type="audio/mpeg"></audio>'
    );      
    document.getElementById(index+'_sound').muted = false;
}); 

function playVideoSound(videoID) {
$.each(_videoSounds,function(index,value){
    $('#'+index+'_sound').trigger('pause');
});
$('#'+videoID+'_sound').trigger('play'); }