Change Video URL

Is there any way to change the URL of a videoplayer programmatically?
I have tried using a Controller with distincts States for each url for the same videoplayer, but it always open the url defined on the default state.

function playVideoSolucoes(controller) {
controller.activate();
const Videoplayer = symbol.nodes.Videoplayer;
Videoplayer.nodes.control.restart();
}

symbol.nodes.btn.on(“pointerdown”, (e) => {
playVideoSolucoes(symbol.controllers.controller.elements.state);
});

Thanks

I had that problem as well when I was making my ISS Zap. I ended up just making one long video and jumping the time to the start of each video.

Steve

Hey Guys,

The following line of code should let you change the source of the video node within the video player subsymbol from the parent symbol:

symbol.nodes.VideoPlayerNodeName.nodes.show0.myvid.source("new URL");

VideoPlayerNodeName = The name of your video player symbol node in the Hierarchy, you can drag it in and use it as a variable if you run into issues with this.

Mark

3 Likes

Hi! Great!!
Thanks!!