Create an HTML5 Video Gallery with jQuery and Dreamweaver

with Chris Converse
please wait ...
Create an HTML5 Video Gallery with jQuery and Dreamweaver
Video duration: 0s 1h 10m Intermediate


In this course, author Chris Converse develops an interactive video gallery for the web, working in a Dreamweaver environment using a combination of HTML5 with a Flash fallback, CSS, and the open-source JavaScript library jQuery. The course shows how to design the site layout and construct the code for a player that works on multiple web browsers, platforms, and mobile devices. Techniques to enable HTML5 video on Android and ensure that Internet Explorer defaults to Flash instead of HTML5 are also demonstrated.

Topics include:
  • Preparing the graphics
  • Adding and linking thumbnail buttons
  • Designing the layout
  • Adding jQuery and JavaScript
  • Including video information in the thumbnail links
  • Styling the thumbnails with CSS rules
  • Creating a DIV container to hold the video player code
  • Setting up click events for the thumbnails
  • Incorporating the FancyBox lightbox plug-in
Developer Web
Dreamweaver HTML jQuery

Previewing the project across browsers and devices

- [Voiceover] Hi, This is Chris Converse and this is a course on creating an interactive video gallery. So, I wanna start by showing the final project that we're gonna be creating. In the Final Project folder we have two HTML files. We have an index_option_1 and index_option_2. Inside of the includes, we have two different JavaScript file options as well. Both of these options have to do with how the video player is gonna work on mobile devices. So we'll take a look at those in a moment. But first, let's come over to Safari and take a look at how this interactive experience is working in Safari.

So, when I roll over each of these thumbnails I get at a rollover state. When I click on a thumbnail, it loads a video up in a light box. And then each browser is going to use its own built-in HTML5 support to show the video controls as well. So, clicking outside will make the video go away. Click on the next video. (upbeat music) Close that as well. So, this is how the user experience looks in Safari. In Firefox, instead of using MPEG4, which is the video format that all of the browsers and devices are gonna use except Firefox, we're gonna be using the Ogg Theora or OGV video file format.

So again, I can come in here and click and get the same user experience. The controls are gonna look a little different based on how Firefox's controls are going to be rendered as opposed to other browsers. (upbeat music) These videos work great. Let's come into Chrome. Now, Chrome doesn't allow auto play by default, so we click on the video, it loads up, but I do have to come down here and click Play in the Chrome browser to see these rendering. Now, if your browser doesn't support HTML5 video we also have a Flash fallback that we're gonna be programming in.

So we have some Flash video players and a video skin that you can put into your project. So for browsers like IE 7 and 8 that don't have HTML5 video support, what's actually going to happen is it's gonna use Flash instead of HTML5. So if I were to right-click on this, I would see that we're actually using Flash here instead of HTML5 video. Now, the options I was referring to before have to do with how the different mobile devices are gonna handle video. If we look at this running on an iPad, you'll notice that the iPad user's experience is very similar to that of the computer screens.

I tap on a video, an overlay comes up. I can tap on the overlay, the video will start to play right in line inside of the FancyBox overlay. And then I can also click the full-screen view to come out of the container, go into full- screen view using the device's video player, and then condense that down and go back to the light box. The two options that we really were talking about for mobile devices have to do with the phones. The Android platform doesn't support HTML5 video unless we use an onClick JavaScript event and we don't specify the codec.

And in both cases for the iPhone and Android, we can see that the video overlay comes up. I can tap on the video and then they will each jump into their respective video players and play the video. The second option has to do with bypassing the overlay altogether since neither platform supports playing the video inside of the overlay. So the second option is to just change the link. Instead of having the link invoke the overlay, we're gonna have the link change the URL to go directly to the actual video file itself. Now, on the iPhone platform, this means that it opens another window in mobile Safari, requiring us to hit the Back button.

And during this course, we're actually gonna show you how to do JavaScript detection so you can change the user experience depending on the individual devices. So I hope this sounds interesting to you and if so, let's get started with the first movie.

please wait ...