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

load a video into component HTML5

Explorer ,
May 23, 2024 May 23, 2024

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!

TOPICS
How to
1.3K
Translate
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

correct answers 1 Correct answer

Community Expert , May 25, 2024 May 25, 2024

this.stop();

var videoURL=whatever;

$("#yourvideocomponentname")[0].src=videoURL;

Translate
Community Expert ,
May 24, 2024 May 24, 2024

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.

Translate
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
Explorer ,
May 24, 2024 May 24, 2024

video path using component parameter. (original video is in a folder outside where the fla file and published files will be)

Screen Shot 2024-05-24 at 11.32.12 AM.pngexpand image

published folder:
Screen Shot 2024-05-24 at 11.33.36 AM.pngexpand image

test from animate, and browser console

 

Screen Shot 2024-05-24 at 11.32.48 AM.pngexpand image

Translate
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 ,
May 24, 2024 May 24, 2024

and that loaded your video, correct?

Translate
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
Explorer ,
May 24, 2024 May 24, 2024

yes

Translate
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 ,
May 24, 2024 May 24, 2024

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?

Translate
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
Explorer ,
May 24, 2024 May 24, 2024

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:
Screen Shot 2024-05-24 at 12.15.42 PM.pngexpand image

test on browser:
Screen Shot 2024-05-24 at 12.15.26 PM.pngexpand image

this is the publish folder. (note the video folder was already there, generated before when we used ths comp parameters to load the video.
Screen Shot 2024-05-24 at 11.33.36 AM.pngexpand image

Translate
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 ,
May 24, 2024 May 24, 2024

is movieclip_1 the video component or a movieclip that contains the video component?

Translate
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
Explorer ,
May 24, 2024 May 24, 2024

movieclip_1 is the video component.   

Translate
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 ,
May 24, 2024 May 24, 2024

zip the folder that contains your fla and other files

upload it to a file server 

post a link to the zip here

Translate
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
Explorer ,
May 24, 2024 May 24, 2024
Translate
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 ,
May 24, 2024 May 24, 2024

there was no mp4 in your zipped files.  do you now why?

Translate
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 ,
May 24, 2024 May 24, 2024

wait a minute. it is in your zip,.

Translate
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 ,
May 24, 2024 May 24, 2024

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.

Translate
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
Explorer ,
May 24, 2024 May 24, 2024

hi,

stop and code on frame 2.

still doesnt work.

Screen Shot 2024-05-24 at 10.00.38 PM.pngexpand image

Screen Shot 2024-05-24 at 10.04.17 PM.pngexpand image

 

 

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?

Translate
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 ,
May 24, 2024 May 24, 2024

the added event doesn't fire. just assign the url on the 2nd frame.  no listener/function needed.

Translate
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
Explorer ,
May 25, 2024 May 25, 2024

im not sure how to do that.

 

assign url on second frame.

 

do i need a different code?

Translate
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 ,
May 25, 2024 May 25, 2024

this.stop();

var videoURL=whatever;

$("#yourvideocomponentname")[0].src=videoURL;

Translate
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
Explorer ,
May 25, 2024 May 25, 2024

doesent work,

 

Screen Shot 2024-05-25 at 9.34.19 AM.pngexpand image
Screen Shot 2024-05-25 at 9.35.09 AM.pngexpand image

using:

./videos/vid_1.mp4
/videos/vid_1.mp4

videos/vid_1.mp4

Translate
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 ,
May 25, 2024 May 25, 2024

in what frame is your code?

 

and did you change the name of your vid component?

Translate
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
Explorer ,
May 25, 2024 May 25, 2024

Frame 2

 

yes i renamed the component to  video_component

 

this.stop();


var videoURL = "/videos/vid_1.mp4";

$("#video_component")[0].src=videoURL;

Translate
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 ,
May 25, 2024 May 25, 2024

is the component in the first frame with no other keyframes in its layer?

Translate
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
Explorer ,
May 25, 2024 May 25, 2024

could this be the error?

Screen Shot 2024-05-25 at 10.42.32 AM.pngexpand image

Translate
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
Explorer ,
May 25, 2024 May 25, 2024

its in the second frame.

 

Translate
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
Explorer ,
May 25, 2024 May 25, 2024

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

 

 

 

 

Translate
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 ,
May 25, 2024 May 25, 2024
LATEST

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.

Translate
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