Change Video URL


#1

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


#2

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


Multiple video's longer than a minute each causing issues on various devices
#3

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


#4

Hi! Great!!
Thanks!!


#5

Hi! Not-a-developer here… could anyone explain a little more how to make this code work? For example, where it says “new URL” how is it supposed to change the source of the video (a URL ending in .mp4), let say, depending on different buttons clicked at choice?
Thanks and God bless.