[Fixed]-Global VR Videolayer in Panotour

1đź‘Ť

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'); }
👤Alex Baur

Leave a comment