Immerse yourself in a world of virtual reality with the cutting-edge VR Vide

Currently, I am in the process of developing a virtual panoramic tour that features various panoramas linked together with hotspots. Each panorama contains a video hotspot that plays a video.

However, I have encountered an issue where every time a new scene loads, I have to physically touch the display for the video to load. Panotour has mentioned that this behavior is normal.

My goal now is to find a solution that allows all the videos to play or stop with just one touch when entering VR mode. I attempted to create an array of all the videos and control their playback following the first touch, but this method only works for the videos in the initial scene and not the subsequent ones.

Another approach I attempted was using a global layer to insert the video source and position via JavaScript on the play button. However, global layers do not support VR stereo mode.

Furthermore, I explored consolidating all the video hotspots in the first scene, but this strategy failed as it does not allow for the presence of multiple hotspots with the same ID.

If anyone has any suggestions on how I can achieve the goal of having all videos play with just one touch upon entering VR mode, I would greatly appreciate it.

Thank you, Alex

Panotour Pro 2.5.5

Answer №1

After much trial and error, I have successfully created a tour with videos that play seamlessly on all devices. I have incorporated 5 different scenes with videos, and they all function correctly.

The key was to preload all the videospots in the first scene and set them to alpha="0.0" initially. Upon the user's first touch to enter VR mode, I play and then stop all the videos using JavaScript. I also made sure to set the videohotspots to keep="true" so they remain visible after a pano change. Depending on the loaded scene, I adjust the videos to alpha="1.0" accordingly.

The most time-consuming part was manually adjusting the video settings in the index_vr.xml file to ensure they were in the right position in the second and third scenes. By exporting the tour with the videos in their respective scenes first, I was able to obtain the correct settings (ath, atv, width, height, rx, ry, rz) before exporting the entire tour with all the videos in the first scene.

To address the issue of video sound playing only in the mainscene, I exported the videos without sound and used JavaScript to add HTML5 audio tags to play the audio separately. This way, I can control the audio and video playback simultaneously.

While it may be a workaround, this method has proven to be effective. Enjoy!

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

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

When trying to retrieve an XML file that contains an escaped ampersand, a jQuery AJAX call is throwing an error

Before sending text input to a server to be stored in a MySQL database using XML, I first escape the "&" characters: var copyright = copyright.replace(/&/g,"&amp;"); The wrapped XML data block is then sent to the server through jQuery's ...

The nth-child selector fails to function properly with a customized MUI component in CSS

I've created a styled component as shown below: const FormBox = styled(Box)(({ theme }) => ({ width: "47vw", height: "25vh", backgroundColor: theme.palette.grey[100], borderRadius: theme.shape.borderRadius, marginLeft: ...

Update MYSQL table values using AJAX and jQuery, then dynamically refresh the updated values on the web page

Hey there! I am fairly new to utilizing ajax and encountering some difficulty with a fundamental concept. In my MySQL table called "users," I have various user information stored, including the balance they pledge to donate. My goal is to create a div elem ...

Show or conceal a class

Hello there! I've been attempting to create a toggle effect using an anchor link with an "onclick" event to show and hide content. Despite my efforts with jQuery and JavaScript functions, I just can't seem to figure out the right approach. Here& ...

Is there a way to access and troubleshoot the complete source code within .vue files?

I've been struggling for hours trying to understand why I'm unable to view the full source of my .vue files in the Chrome debugger. When I click on webpack://, I can see the files listed there like they are in my project tree, but when I try to o ...

Guide to developing a reusable component or partial in react.js

My first experience with React.js involved a relatively simple task. I started by creating an app.js file that loads the initial page, containing my navigation menu and rendering the children props. However, I realized that instead of keeping the navigat ...

Flask fails to recognize JSON data when transmitted from Nodejs

I am encountering an issue when trying to send JSON data from Node to Flask. I am having trouble reading the data in Flask as expected. Despite attempting to print request.data in Flask, no output is being displayed. Additionally, when I tried printing req ...

Troubles with Geocoding functionality on Google Maps integration within Wordpress

I have a challenge where I want to utilize the title of a Wordpress post (a specific location) as a visible marker on a Google map. The code provided by Google successfully displays the map without any markers: <script>function initialize() { va ...

Backend framework

Currently, I am in the process of developing a robust web application that heavily relies on JavaScript and jQuery, with ajax functionality included. Additionally, there will be a database in place, managed using mySQL with several tables. I'm undeci ...

Creating an Image Slideshow on Your Website

I'm looking to create an image slideshow on my website that functions similarly to the one found at . However, I want the images to occupy the entire screen rather than having smaller images like the reference site. Can anyone offer guidance on how t ...

Execute the function once the audio has finished loading

I need help running a function once an audio file has finished downloading. This is my JavaScript code: // https://freesound.org/people/jefftbyrd/sounds/486445/ var audioFile = "https://raw.githubusercontent.com/hitoribot/my-room/master/audio/test/test.m ...

Is there a method in bootstrap that reveals the elements with the hidden class?

Currently, I am loading data into a bootstrap table on my JSP. The table class is hidden at the moment. After successfully uploading the data into the bootstrap table, I have implemented the following code: $(function() { var table = $('#Table') ...

JQuery Script Perform an Action - Pause - Execute Another Action

I'm working on a function that involves running some jQuery code, pausing for around 5 seconds, and then executing something else. Here's an example of what I'm trying to achieve: function myFunc() { var str1 = 'This is the starti ...

Simple steps to access a feature on an AngularJS application

I have my angular application stored in a variable (initialized with:) var app = angular.module('app', [...]); Now, I need to access the $timeout service. How can I retrieve this service from it? I am looking for something like: var timeout ...

Bot in Discord designed to provide varying tiered rewards for designated roles on payday

I'm trying to configure the bot to distribute different amounts of payment to various roles. However, no matter what I attempt, it keeps indicating that the role is undefined. Being new to JavaScript and coding in general, I've researched this ...

When toggling visibility with JS, the Bootstrap Grid Row may not center-align as expected

Sorry for the odd spacing issue that might occur. I currently have a basic Bootstrap Grid setup as follows: <div class="row justify-content-center" align="center" id="details"> <div class="col-sm-2"> ...

Pressing on an HTML element using JavaScript via the Selenium driver does not trigger the action

I'm attempting to use Selenium with Python to click on an element using JavaScript. Here's a snippet of my code: driver.execute_script("els=document.getElementsByClassName('buttons');\ for (var i = 0; i < els.length; i++) { ...

Tips for preventing the occurrence of a final empty line in Deno's TextLineStream

I executed this snippet of code: import { TextLineStream } from "https://deno.land/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7201061632425c4341445c42">[email protected]</a>/streams/mod.ts"; const cm ...

What is the process for transferring data between components in React?

Currently, I have set up a system to display an employee table from the database. Each record in the table includes an "edit" link which, when clicked, should trigger the display of a form below the table containing the corresponding records for editing. T ...

Can you explain the concept of "Import trace for requested module" and provide instructions on how to resolve any issues that

Hello everyone, I am new to this site so please forgive me if my question is not perfect. My app was working fine without any issues until today when I tried to run npm run dev. I didn't make any changes, just ran the command and received a strange er ...