• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Using a variable to specify Video Component / Parameters / Source / Value? HTML5 Canvas

Engaged ,
Oct 07, 2019 Oct 07, 2019

Copy link to clipboard

Copied

Can the value of the source be a variable, so I can change the video sources via a function?

 

Video component Instance Name is Video_Display

 

Something like:

 

video_01 = "some.url";

this.Video_Display.source = video_01;

 

Has anyone made that sort of thing work? I can't find any information on that. 

 

Thanks! 

Views

111

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 07, 2019 Oct 07, 2019

Copy link to clipboard

Copied

LATEST

Hi.

 

Sure.

 

It could be something like:

var source0 = "your_video.mp4";

window.setTimeout(function() // a delay is needed to access components instances
{
    document.querySelector("#video0").src=source0; // "video0" is the video component instance name
}, 0);

 

I hope this helps.

 

 

Regards,

JC

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines