Creating and On / Off tap trigger for video
Hello,
I'm working on a code that would make a movie pop on the screen when its tapped and disappear when the screen is tapped again. This is my code so far, what would I need to do to tweak it?
// -----JS CODE-----
// Plays a video texture
//@input Asset.Texture movie
var loops = 100;
var provider = script.movie.control;
if (provider.getStatus() != VideoStatus.Playing)
{
provider.play(loops);
}
else
function onTapped(eventData) && (provider.getStatus() == VideoStatus.Playing)
{
stop() : void
}
var event = script.createEvent("TapEvent");
event.bind(onTapped);
you can just use behavior script and enable or disable the object
Hi,
You can use behavior script to toggle the video/picture.
Hi puji,
If your want image with movie to appear/disappear from screen you need set its "enabled" property to true/false. The code can look something like this: