Copy link to clipboard
Copied
Hi, im creating an interactive where i need to play different videos.
Im trying to load a video into component using the Load a video code:
/* Load a Video
Change the URL below.
*/
var videoURL = "https://images-tv.adobe.com/avp/vr/15a99ccf-0e7c-4601-b270-87dd82624086/5078a43c-81f9-4a93-836c-8152...";
this.video_player_1.on("added", function() {
$("#video_player_1")[0].src=videoURL;
}, this, true);
I understand i need to change the url address to where my videos are. I have them in a folder where i store the videos inside the folder where my html page is.
var videoURL = "videos/IDLE_SCREEN.mp4";
this.video_player_1.on("added", function() {
$("#video_player_1")[0].src=videoURL;
}, this, true);
But the component doesent load the video. Not sure if this is the corrct way to do this.
any help would be appreciated.
thanks!
1 Correct answer
this.stop();
var videoURL=whatever;
$("#yourvideocomponentname")[0].src=videoURL;
Copy link to clipboard
Copied
use the component parameter panel to navigate to your video
then then test.
that works, correct?
no show a screenshot similar to what you showed previously but also including the publish date/time of your files.
Copy link to clipboard
Copied
video path using component parameter. (original video is in a folder outside where the fla file and published files will be)
published folder:
test from animate, and browser console
Copy link to clipboard
Copied
and that loaded your video, correct?
Copy link to clipboard
Copied
yes
Copy link to clipboard
Copied
check that component parameter panel setting. if it's listed in full
copy that component parameter setting
remove that setting
use your original code, but replace the url with copied path to your video
test
does it work?
Copy link to clipboard
Copied
no,
this is what i did, let me know if i didnt understand.
copied the comp parameter setting (i understood its the video path), and remove it. then copy on the code:
test on browser:
this is the publish folder. (note the video folder was already there, generated before when we used ths comp parameters to load the video.
Copy link to clipboard
Copied
is movieclip_1 the video component or a movieclip that contains the video component?
Copy link to clipboard
Copied
movieclip_1 is the video component.
Copy link to clipboard
Copied
zip the folder that contains your fla and other files
upload it to a file server
post a link to the zip here
Copy link to clipboard
Copied
Copy link to clipboard
Copied
there was no mp4 in your zipped files. do you now why?
Copy link to clipboard
Copied
wait a minute. it is in your zip,.
Copy link to clipboard
Copied
the "added" listener is not firing. i don't know why. i tried in the current v 24.0.3 and 23.0.6 and it failed in both.
just add your code to the 2nd frame and it will work. make sure to also add a this.stop() on the 2nd frame.
Copy link to clipboard
Copied
hi,
stop and code on frame 2.
still doesnt work.
for the path i used:
./videos/vid_1.mp4
/videos/vid_1.mp4
videos/vid_1.mp4
also leaving the url that comes with the snippet
none worked
should i try with an even older version? 23.0 could it be an M1 chip issue?
Copy link to clipboard
Copied
the added event doesn't fire. just assign the url on the 2nd frame. no listener/function needed.
Copy link to clipboard
Copied
im not sure how to do that.
assign url on second frame.
do i need a different code?
Copy link to clipboard
Copied
this.stop();
var videoURL=whatever;
$("#yourvideocomponentname")[0].src=videoURL;
Copy link to clipboard
Copied
doesent work,
using:
./videos/vid_1.mp4
/videos/vid_1.mp4
videos/vid_1.mp4
Copy link to clipboard
Copied
in what frame is your code?
and did you change the name of your vid component?
Copy link to clipboard
Copied
Frame 2
yes i renamed the component to video_component
this.stop();
var videoURL = "/videos/vid_1.mp4";
$("#video_component")[0].src=videoURL;
Copy link to clipboard
Copied
is the component in the first frame with no other keyframes in its layer?
Copy link to clipboard
Copied
could this be the error?
Copy link to clipboard
Copied
its in the second frame.
Copy link to clipboard
Copied
OK, now its working,
with the component on first frame. and code on second...
thanks so much. for all the help and patience.. will now rework the interactive using loading with buttons.
will report how it goes!
thanks
Copy link to clipboard
Copied
sure, and yes that console error explains the problem. you had the component in the first frame where you probably assigned its instance name, but in the 2nd frame it was a different instance because there was a 2nd keyframe in its layer.


-
- 1
- 2