Is it possible to play video after detect image?


#1

Greeting,

This is my first few experiments with ZapWorks, and I testing with Video now.
But I noticed that the video already start playing after I start the WebAR.

Is it possible for the video only start playing after the user scanned the Image Target?


#2

I assume you already found your answer but leaving this here in case anyone drops by as well.

So in your script i assume there’s this:

parent.on("seen", () => {

 });

ignore that, you can even delete it or comment it out using /* code between this */

Drag your image target into the script and itll create a variable for you. Rename it to whatever u want or remain as is:

Target.one("seen", () => {
        Video1.start();
});

i renamed my image target as Target. There’s a controller named “seen”. So what this does is plays the video only when your image target is in view of the camera. The function “one” only triggers it once even if image lost and found again, you can use “on” like Target.on() and whatever you set the script to do when image found will trigger again (like a reset).


#3

Hi, not-a-developer here. How to do this but accessing the video via URL (a URL that ends with .mp4)?
I know this is an extra question but, could it be possible to change the video source by the experience of clicking on different buttons (like pointerdown)?
Thanks and God bless.