Simple autoplay video script?


Hey all - just started using studio to work on a project that puts an alpha video on a business card. Got everything looking great except I just need the video to autoplay one time. Any easy way for a newbie?


Hello @andyzilker,

Try this:

parent.on("show", ()=>{;


This will make your video plays when the experience finish the loading screen.

If you want to your video plays only when the tracking image is recog. you should try this:

let isFirst:boolean = false;

Tracking_pngzpt.on("seen", ()=>{
        isFirst = true;

This code will check if is the first time that the tracking is seen and then will play the video.

att, Higão.


Thank you!!! so add this script to the video file itself? Do I need to add the name or anything to this script?


Hello @andyzilker,

The first script you may put anywhere in your project. The second script needs the tracking to be working so I recomend you to insert it in the main script where your tracking is. About changes, yes. You have to change the name of what’s dif in your project. Like the tracking name, the video node’s name and etc.

I made then very generic just for your understanding.

att, Higão.


OK - I would just need the 1st script. I might add that I have the video on a plane (to make it look like it’s coming up from the page) The video is named just “bookmark.mp4”.