You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Thursday, October 27th 2016, 12:06am

Multiple playsounds in VR mode

Hi Guys,

I wasn't too sure where to ask this question within the thread. I am trying to have multiple sounds being played on VR mode. I have a few panos each pano with a certain number of hotspots who's onclick activates the sounds. Since the VR mode requires an initial user-interaction for the playsound, I created an event where the user presses on the VR button headset and records this as a user interaction. Then my code fires a set of playsound(id,...,...); methods to have the sound objects created.





I chose to keep the mute paramter to true, that way the sounds are being played without the user realising it. Then at this point i am in VR mode and I go onto a specific hotspot in a different scene, which only plays the sound of the last playsound () method. Then later on in my code for each hotspot I set


At this point the played sound will be that of the sound.




I would very much appreciate your help if anyone could give me any insight on this issue.


Thank you so much *smile* *smile*

This post has been edited 1 times, last edit by "Aladdin_VR" (Jan 19th 2017, 2:31pm)


spacerywirtualne

Professional

Posts: 959

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

2

Friday, October 28th 2016, 11:20am

Hello

You do not succeed to do this using the standard Sound Interface Plugin.

Try this:
http://krpano.com/plugins/userplugins/html5vraudio/#top

Best regards
Your own online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube

cms4vr team *thumbsup*

3

Thursday, November 3rd 2016, 10:30am

Figured out a way

Hi Thanks for your reply spacerywirtualne.

I managed to figure it out by loading all the sounds at the very first touch and then the rest is just calling the preloaded sound.

I am trying to do the same thing in order to bypass the constraints for videos (which require a user interaction). Creating an event where onmousedown calls an action that plays and pauses all the videos. That way second I click on the VR headset the user has already interacted with the pano (using the touchworkaround). However as soon as I move to another scene where there is another video. It still requires a touch. Do you have any idea about this ?

Thanks once again ;) ;-) ;-)

spacerywirtualne

Professional

Posts: 959

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

4

Thursday, November 3rd 2016, 10:51am

Hi

I know that, and it is strange. Video VR mode does not start automatically. You have to touch the screen and it is troublesome, but only on Android and Google Chrome. On the IOS video starts immediately without touching. Android Firefox works well. I do not know if this Android or Chrome bug *huh*


Maybe Klaus write something in this matter.



Piotr
Your own online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube

cms4vr team *thumbsup*

5

Thursday, November 3rd 2016, 12:19pm

Hey thanks for your reply ;)
Yes i agree it's weird. I'm assuming since it works on android firefox, it must surely be a chrome issue and not an android one.

I used the same trick with the sound to bypass the need for a user interaction. I set up the onmousedown event to playall the sounds (muted) thus creating the objects, and the onmouseup to stopall the sounds. This preloads all the sound and creates the sound object. Therefore upon wondering the scenes, it remembers the sound objects. Unfortunately, the video is not created the same way since I am calling it off a hotspot.

I can use this method when the videos are on the same scene and make them work in VR mode, but as soon as I go in VR mode and move to another scene, it requires a user interaction.

No of any smart tricks to keep the flow going while changing scenes in VR mode. *tongue* *squint* ?

Best

A.E

spacerywirtualne

Professional

Posts: 959

Location: Poland, Europe

Occupation: krpano developer : virtual tours

  • Send private message

6

Thursday, November 3rd 2016, 1:21pm

Hi

I have no problem with the audio, only distorted video hotspot in VR mode does not runs on start .


Piotr
Your own online, cloud tool for creating virtual tours - www.cms4vr.com

facebook page :: youtube

cms4vr team *thumbsup*

7

Thursday, November 3rd 2016, 3:27pm

have found a trick to bypass it

Hi,


Until Klaus helps shed some light onto this I've managed to find a way that makes it seem like it's working up until, Chrome decides to support autoplay. (temporary fix)

The logic is to have an event that plays the all the videos on the first touch (using the onmousedown function). Then when navigating to the other scenes, simply play around with the keep= "true" attribute and the onstart="true/false" attrbutes to have the video you would like to be clicked on when in VR to "autoplay".

The idea here is to make use of the first click when the user clicks on the VR headset and take that as a userinteraction to load all the videos required, so when in VR mode we can have a functionality that looks like autoplay.

I hope this could help Piotr.

A.E

azureart

Beginner

Posts: 1

Location: Z├╝rich, Switzerland

  • Send private message

8

Friday, January 13th 2017, 6:37pm

Does it really worked?

Good evening at all.
@aelboudali did you ever tested this way?

We created some scripts, wich catch the first touch event, to control some Audio and Videos at the Start-Scene.
So actually we can play or handle with javascript all videos / audios in the first screne (also we can play multiple audio files at the same time without some problems).
If we change the scene, we lost every control of the videos. we also tried to put all videos in the first scene also with keep="true" but there going to be lost on change in VR mode?!
We use the <audio> Tags outside of krpano in the normal HTML Template, we still can handle them on changing the scene with Javascript, because they don't need some "visible" in VR mode.

Do you have an example of playing videos in VR on changing the scene? and u still can control them after the change without a touch on iOS and Android?

P.S. We found out, if you bookmark a tour as a Home-Screen-Bookmark on iOS, it doesen't need a touch anymore! Hope this help some other Peoples! Like an Trusted-Web-App for iOS!

Thanks for the help and have a nice weekend!

Similar threads