- Sort Posts
- 12 replies
- Last post
Inserting Video and Soundclips on Image target using Javascript
Inserting Video and Soundclips on Image target using Javascript
sir.. this is my new topic. hope you can help me.
Inserting Video and Soundclips on Image target using Javascript
sir. i've downloaded the videoplayback package in the asset store , i got the sample scene on that package and run it to my android device , when i scan the image target it show a play button but it won't play, i can't even tap or touch the play button.? what's the problem with that? is there a separate code for tap and touch ?
Inserting Video and Soundclips on Image target using Javascript
No, there is not a single script to do that; you need to use the Video Prefab and a set of scripts (such as VideoPlaybackBehaviour and VideoPlayerHelper) that you can find in the VP sample.
Basically it boils down to instantiating the Video prefab and attach it to the Image Target of your choice, but I recommend looking at the sample for the complete scene and code setup.
Inserting Video and Soundclips on Image target using Javascript
Inserting Video and Soundclips on Image target using Javascript
If the sounds gets distirted this could depend on the fact that the distance to the camera is changing, and the 3D sounds settings are affecting this.
As explained in the tutorial, you need to adjust the 3D Sound Settings of the audio source to get good results. You may also want to check the Unity 3D documentation about handling Audio Source in a 3D scene.
http://docs.unity3d.com/Documentation/ScriptReference/AudioSource.html
Inserting Video and Soundclips on Image target using Javascript
Inserting Video and Soundclips on Image target using Javascript
Inserting Video and Soundclips on Image target using Javascript
Inserting Video and Soundclips on Image target using Javascript
If you look at this tutorial:
https://developer.vuforia.com/forum/faq/unity-how-can-i-play-audio-when-targets-get-detected
This explains how to do thtis using C#.
We don't have an equivalent tutorial for Javascript, and I would recommend to use C# since the Vuforia API for Unity is written in that languagfe (there is no Javascript API for Vuforia).
If you really want to use Javascript, then you will need to implement the basic part on C# as explained in the article above (in particular because the TrackableEventHandler needs to be implemented in C#, and there is not much you can do in Javascript about that), and then connect the event somehow to your Javascript to play the sound.
But mixing Javascript and C# scrips will be much harder than just doing everything straight in C#.
I replied there.