I have probably done this before, but I cannot stop the audio when I close a video. I pause the video but the audio continues.
How can I stop the audio? Thanks in advance
Are you just playing 1 video with audio?
The pause should stop it. make sure to pause before closing. it may not be getting the pause if its still playing.
Steve
Thanks Steve… Is this right?
const IntroVideo = symbol.nodes.Video_Player3;
parent.on(“pointerdown”, (e) => {
// Runs when pointerdown occurs on the parent node
// The argument e contains useful info about this event:
// https://docs.zap.works/studio/scripting/reference/object/events/pointerdown/
//Stop Video
IntroVideo.nodes.control.pause;
//Turn Intro Off
symbol.controllers.Intro_CNT.elements.Intro_Off.activate();
//Turn Enter my World Icon Off
symbol.controllers.EnterWorld_CNT.elements.EnterWorldOff.activate();
//Turn 360 World On
symbol.controllers.n360_CNT.elements.n360_On.activate();
//Turn On UI
symbol.controllers.UI_CNT.elements.UI_On.activate();
});
Still not working
yes, 1 video with audio
try
IntroVideo.nodes.control.pause();
Steve
Thanks Steve. it works now ;-). But we separated the video from the audio at the end. One more question, how can I tell the audio to delay a few seconds before playing?
Hello @digitalpopups,
Try something like:
Z.after(time, ()=> symbol.nodes.audio.start());
You may also open a block:
Z.after(time ()=>{
symbol.nodes.audio.start();
});
In “time” you put how much time you want to delay, like 250, 1000 and etc. Remember that each 1000 is a sec, so 2000 is 2 sec, 3000 is 3 sec and so.
Also, here is the article about this:
Hope this helps you!
Att, HigĂŁo.
I was just going to say the same thing.
Steve
Thank you both !! ;-). Such an easy thing ! I believe I only use 10 % of zapworks really.
Thank you again
Milenne
Well. I had no idea that 1000 was one second.
It’s in millisecond if I remember correctly.
Steve
Thanks a lot, it worked for me!