Hi JD,
hoping your expertise can help me too, awesome! I’ve tried to create a new post on this but seems there is something up with the forum right now not allowing them to be created (bug reported)
So… here it is:
Hello everyone I was wondering whether I could have some help with something. I’m well aware that video can’t be autoplayed with audio but I want to trigger an unmute with buttons on a page that reveal overlay content to go full screen. I’m new to coding on Velo but have almost got it working using the code below for the three text box areas acting as buttons.
Here is the page:
https://www.beyonddesignagency .com/dance-with-me-short-film
Here is the code:
export function text6_click(event) {$w("#videoBox1").unmute();
}
export function text8_click_1(event) {$w("#videoBox1").unmute();
}
export function text10_click_1(event) {$w("#videoBox1").unmute();
}
The trouble I’m having is that the navigation does still hide (triggered by interactions) and the video does unmute but it pauses and requires a further click to start again (with sound). The video behaviours are set to autoplay and to not stop on clicking (if set to stop on clicking the code doesn’t seem to work). I’ve also tried setting the video behaviour to loop and stop on end but it doesn’t make a difference.
As the text boxes are also active via behaviours to hide / show via the same links I’ve also tried adding an independent unmute sound button which you can see top left. This however leads to the same effect - unmuting but pausing the video requiring a further click with this code so an interaction causing a problem can be ruled out:
export function Sound_click_1(event) {$w("#videoBox1").unmute();
}
I’ve tried to add a second action on another page with .play to try to cancel out the pausing but it doesn’t work or perhaps I’ve added this second one incorrectly?
export function text6_click(event) {$w("#videoBox1").unmute();$w("#videoBox1").play();
}
I also have no idea why but but wo of the entries had to take _1 at the end or it wouldn’t work which I discovered by accident.
I’m worried because of autoplay restrictions that the videobox may not be capable of doing what I need?
If this is the case I was wondering whether a complicated workaround could be to set a off a lookup of the video playing time code at the click moment it get paused on triggering the action and set off a new video to start playing at that moment somehow either the same video or another layered on the page which is unhidden and the original video hidden. This would obviously be far from ideal and I guess a small lag but perhaps something to explore if its a brick wall in the first instance. Gasp!
Would be really grateful of any help!