Haven't logged in to this site for years, and now I need some help. I also don't know if this is the right forum, but here it goes.

I'm trying to write a site a hosts some of my own videos. I want to have a list of videos, each as a link, and when I click on one I want it to load on that same page by graying out everything else but the video. I'm using html 5 and css and I can get the video to come up, but the problem is that when I go to that page, all of the videos load. If I play a video from the pop up window and then close the window, the video will keep playing.

How can I make this work?

Recommended Answers

All 5 Replies

I don't know those HTML5 videos too well, but I believe they have an autoload attribute? You need to remove it. Or set it to false. Or something. And as for the window closing, does the video object not have a stop() or something method? If so, call it :) (or pause(), even better?)

What about listing each video link, and when the link is clicked it opens up in a foreground frame (eg. Fancybox) that loads the video based on parameters sent to the frame via javascript?

That way, when the foreground frame is closed, it could trigger a function that stops or pauses the video.

I don't know those HTML5 videos too well, but I believe they have an autoload attribute? You need to remove it. Or set it to false. Or something. And as for the window closing, does the video object not have a stop() or something method? If so, call it (or pause(), even better?)

Thanks, that makes sense. Although I noticed that each browser acts differently. Safari doesn't load anything until you click play, chrome loads everything, and firefox doesn't support mp4 for some reason.

What about listing each video link, and when the link is clicked it opens up in a foreground frame (eg. Fancybox) that loads the video based on parameters sent to the frame via javascript?

That way, when the foreground frame is closed, it could trigger a function that stops or pauses the video.

That doesn't sound too hard. I'll look into that and post my results.

In the meantime what I've done is have a page with link to the videos, so when they're clicked on, they play in a new tab. Works for the mean time, but I'm gonna make it look nicer.

Member Avatar for iamthwee

^^Christ, which that many gotchas using youtube over HTML5 for videos seems a lot rosier from where I'm sitting.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.