Copy link to clipboard
Copied
Hi - In Adobe Animate CC (CreateJS) I have a video component nested within a movieclip. This movieclip is then added from the library via script. That works.
I now want to dynamically add or remove the video file path/src to it in CreateJS, This doesn't work no matter what I try. How do you change the source of a video once the component is loaded? Please help!
e.g.,
this.mc.videocompinside_mc.src="videopath.mp4";
1 Correct answer
have you tried using the code snippet??
Under Window>Code Snippets>HTML5 Canvas>Components>Load a Video
/* Load a Video
Change the URL below.
*/
var videoURL = "https://MYwebsite.com/My-Video.mp4";
this.instanceName.on("added", function() {
$("#instanceName")[0].src = videoURL;
}, this, true);
Hope that works! Or a possible work around is to have each of your videos in a MC, and then just swap out the MC's from the library.
Cheers,
mark
Copy link to clipboard
Copied
have you tried using the code snippet??
Under Window>Code Snippets>HTML5 Canvas>Components>Load a Video
/* Load a Video
Change the URL below.
*/
var videoURL = "https://MYwebsite.com/My-Video.mp4";
this.instanceName.on("added", function() {
$("#instanceName")[0].src = videoURL;
}, this, true);
Hope that works! Or a possible work around is to have each of your videos in a MC, and then just swap out the MC's from the library.
Cheers,
mark
Copy link to clipboard
Copied
haven't gotten a cahnce to try yet, but thank you for the swift reply! I'll let you know.

