Get $500+ of the best After Effects files, video templates and music for only $20!
Stream Web Video, No Flash Knowledge Required

Stream Web Video, No Flash Knowledge Required

Tutorial Details
  • Topic: Streaming Web Video
  • Estimated Time: 30 minutes

If you’ve ever wanted to include streaming video in your designs, but didn’t want to bother with messy code solutions (or Flash), we’ve got two quick and easy solutions for you. Today, we’re going to take a peek at what each solution offers to web designers and how to use both of them in your own projects.

On the surface, streaming video through a web page isn’t something that a lot of web designers have at the top of their minds… This is understandable because just those two words ("Web" and "Video") imply a knowledge base that is best found elsewhere in the Envato universe…

…But what if I were to told you that adding streaming video to your pages is now easier than adding a jpg. Now that I have your attention… let’s dive into the good stuff:


Streaming Video: A History of Confusing Technology

Before I begin walking you through the step by step process, let’s first look at the history of “streaming web video” from the point of view of web designers:

Let’s pretend that you’re working on a project and you’re handling the basic front-end coding. In the past, adding streaming video to our designs has been a pretty complicated process – requiring you to know (and have a license to) Adobe Flash. Assuming you have Flash and know your way around it, you then have to get the video in the right format, import it to Flash, go through the archaic process of setting up the video, and then export it. Finally, you’d have to embed it properly in your website. Seasoned Flash veterans might be able to pull this off quickly, but for most people on the design side of things, it’s a headache.

Another possible solution would be to use a service like YouTube or Vimeo. This is fine for most people, but what about those of us who simply want to display video on the web without the branding or other extras that sites like YouTube and Vimeo add? Until recently, there really hasn’t been a simple solution for this.

Thanks to the promise of the HTML 5 Video smokescreen, I found myself trying out some of the new “streaming video solutions” recently. Of course, that was precisely when Google brought webM into its loving embrace and things got a lot more complicated than I bargained for. I essentially surrendered and stomped off with a "Let God sort it out" attitude. Clearly, the debate over streaming web video wasn’t resolved yet.

Is There an Easier Way of Doing This?

A few years back I wrote an article , The Rise of Flash Video, that eerily traces a similar debate that started when video actually hit the web and the Flash Video standard took hold. Again, the crux of the argument was, "There has got to be an easier way of doing this." Guess what? Now there is.

For the past couple of years, Adobe has been involved in the Open Source Media Framework. I have always found OSMF to be a bewildering array of technologies and techniques that, quite frankly, make my teeth ache. The technologies are seriously cool, very cutting edge and fun to poke around with – but they are aimed at developers… and if there is a way to overly complicate a simple solution, the hardcore coders of the world will find it. OSMF is no different. If you wander through the site, there is really not much in the way of simple, plug and play solutions for us humble designers to use.

It is only when you step back a couple of paces that the goal of the OSMF project becomes clear: "to provide high quality video playback experiences". That means really smooth video loading, really slick players and none of the extra stuff thrown up by Vimeo and YouTube. Where this whole thing gets really interesting for us is that now we can get in on the fun and you won’t have to learn anything new.

Alright, Let’s Dive In Now

In this tutorial I am going to show you two ways of accomplishing this. The first is "Drop Dead Simple" and the second raises the level to "Dead Simple". To get into the game all you need to do is to upload a video (one is enclosed with this tutorial for each solution) to a directory on a web site. Let’s get started:


Solution One: Use Flash Media Playback

Step 1: Upload Your Video to a Web Server

This part is pretty simple – just upload a video to your web server using an FTP program or something similar. For this demo we’ll be using the “Stockhorn.f4v” file. All you need to get here is the URL to your video. Keep is somewhere you can copy/paste for the next step.

Step 2: Point your browser to Flash Media Playback

Essentially this site offers an OSMF player for the masses. If you want to heave an mp4, flv or f4v file into your web page without knowing a lick of Flash, Actionscript or Flex, this is the place for you. What you need to do is to click the Configure Flash Media Playback button near the bottom of the page. This will open the Flash Media Playback Setup page.

Step 3: Enter the path to the source video along with a width and height for your video

You need to enter the absolute path to the video and the video’s file extension. The three formats used by Flash are flv,f4v and H.264.If you are unsure as to how these are created feel free to check out my Flash Video Basics series over at active.tutsplus. You also need to enter the width and height values of the video – the values for the enclosed video are 720 X 405. Once you have done that, click the Preview button in the Preview Player area and your video should start to play.

Step 4: Copy the Embed Code in the Preview Player and paste it into an HTML page.

If you are using Dreamweaver, open the page, select the <object> </object> tags and simply paste the code from the player into the Code view. If you test the page , you will see your video playing in the browser. At this point you only need to upload the html page to the diectory containing the video on your site.

Those are the steps and if you head over here you will see the video playing. The only thing I did differently was to include a poster frame. More on that in the next section.


Solution Two: Using Strobe Media Playback

As I said at the top, I am not going to go "all techie" here, but there is another way that is slightly more complicated than what I just showed that’s worth noting, called Strobe Media Playback.

Strobe Media Playback uses the same approach as Flash Media, but there is a ton more power under the hood. For example you can use multiple bitrates to detect connections and feed the proper vid based on the users connection speed. You can customize the controls, use it to play audio, display jpg’s and just about any media that will appear in a Flash SWF. In this example we are going to take the same "no code" approach as we did in the previous solution, but I am going to add a "twist". If you want to work along with me all of the files you will need are in the Strobe folder in this tutorial’s download.

Step 1: Upload Your Video to a Web Server

Same as before – just upload a video to your web server using an FTP program or something similar. For this part of the demo we’ll be using the “GeorgeSquare.mp4″ file. All you need to get here is the URL to your video. Keep is somewhere you can copy/paste for the next step.

Step 2: Download the Strobe Media Playback file

The version you want is Strobe Media Playback 1.5.1 release. With Strobe ,beta versions are called "Sprints" and the current Sprint includes support for such things as the new Stage Video feature of the Flash Player. When you unzip the file you have a couple of choices: place the folder at the root of your computer’s web server or upload it to the root of your web site. I created a directory named "smp" and uploaded all of the files to my web server.

Step 3: Create a Poster frame in Fireworks CS5 or Photoshop CS5

A poster frame is a great opportunity to do some branding with a video.If the first frame of the video is just going to sit there and resemble an image, why not put that image to work. In this case I simply opened a new Fireworks CS5 document that matched the dimensions of the video – 1280 by 720-, assembled the assets and saved it out as a flattened .jpg image to the same folder as the video.

Step 4: Open the setup.html document found in the for Flash Player 10.1 folder

This folder is located in the Strobe download. When it opens it will look rather familiar.The main difference between this document and the one you encountered with Flash Media Playback is the choices are far more extensive and the player is one you own …. not one located on Adobe’s site. When the page opens you will see that there are a lot of choices. The important ones, for the purposes of this tutorial are:

Embed parameters:

  • source: This is the location of the Strobe Player in thew for Flash Player 10.1 folder on the server.
  • width: 720. Use this width if you are using the video accompanying this tutorial. Otherwise enter the width value of your video.
  • height: 405.

Flash vars:

  • src: Enter the full path to the video on the server.
  • poster: Enter the full path to the .jpg image used as a poster frame.
  • controlBarAutoHide: false. This way the video controller is placed under the video and the poster frame.

If you want a more complete explanation of this page and the Flash Vars, my colleague Joseph Labreque, has posted a rather extensive technical overview of Strobe Media Playback at active.tutsplus.

Step 5: Click the Preview and Updates button

You should see your poster frame appear in the player. If you don’t want that big Play button over the poster frame set the playButtonOverlay property to False in the Flash vars area.

Step 6: Copy and paste the Preview Code into your web page and test in a browser.

When the file opens play the movie. The really neat thing is all of the controls are active – meaning that if you are using an HD mp4 file , your video will grow to fill the screen with little or no pixelization.

Finally! Welcome to the world of streaming Flash video without you neeeding to know anything about Flash. Click here to see this project on my site.


Conclusion

As I pointed out at the start of this piece I really don’t think Flash Video is going to disappear any time soon. Still, with the advent of a multi-screen environment, getting the same video to play on say a Droid, iPhone, Samsung Galaxy Tablet and your HD TV set is now possible. This obviously makes web designers a little nervous because… well … because embedding streaming video in the past has been rather technical. That’s not really the case anymore! As I pointed out in this piece, if you can copy and paste text into a web page, Adobe has a couple of solutions for you.

If you find this to be interesting and really want to dig into OSMF or Strobe you really should start with Joeseph Labreque’s series that kicked off at active. tutsplus, as he goes into a lot more detail about the technical stuff surrounding the streaming video debate.

Add Comment

Discussion 18 Comments

  1. Connor Turnbull says:

    Great article, thanks!

  2. kankuro says:

    It makes a lot of process in configuration, but surely the best solution…. thanks a lot…

  3. Irma says:

    Good article on flash video, but your conclusion is a bit confusing. You write “getting the same video to play on say a Droid, iPhone, Samsung Galaxy Tablet and your HD TV set is now possible”. Thus making it sound like FMP can be used to make a video iPhone / iPad compatible which isn’t the case. Maybe you should mention that.

    Other than that, good article.

    • Actually, Strobe Media Playback does have an HTML5 video fallback that can be configured for iOS. There are examples in the source :)

    • Tom Green says:
      Author

      If you are talking about Flash Media Playback … absolutely. Strobe, though, does allow the streaming of vids aimed at a multi-screen environment thanks to the Flash Media Server (FMS) . FMS allows you to “sniff out” the device and connection and load the appropriate vid.

      As for this being on Nettuts … I disagree. The impending multiscreen environment is going to pose massive design challenges to us. The “promise” of multiscreen is one app/multiple devices which I regard as being simply disingenuous. That thinking only works with data. As designers we need to know the devices we are going to because they all have differing aspect rations for their screens. (Homework: Check out the Motorola Xoom’s aspect ratio). Fitting the same video into 4:3 and 16:9 aspect ratios is a design problem , not a coding issue.

      In regards to the iPhone/iOS silliness making a video iPhone/iPad compatible is simple … create an mp4 using the H.264 and AAC codecs and fire that directly into the web page rather than go the Flash route. Then what you do is bill your client for the extra work and deal with the inevitable “double dip” questions that are going to be increasingly asked.

      • karthik says:

        can we stream video live by using camcorder, ie connecting the camcorder to system and streaming that video while recording live, using flash media server

  4. Drazen Mokic says:

    Shouldn`t this be on Nettuts?

  5. I am one of those that likes to stay away from custom video players and stick with YouTube, Vimeo, etc. But, that has made it easier. Thanks!

  6. Xavier says:

    what about free players like JWPlayer – any advantages here?

  7. Amazing, simply amazing. I always wanted a resource like this. Thank you so much!

  8. Michael says:

    Great stuff. I am a big Flash developer, but am glad to see other views on video playback methods.

    Bookmarked for later review. Thanks again.

  9. Hippomegas says:

    Good article on flash video, thank´s

  10. John Farrar says:

    Streaming video is not hard… but neither is it at a novice level. One could compare the concept to the difference between planting a garden and planting with pots, plants and dirt from the green house. While gardening is not hard in the grand scope it is no where easy as buying prepotted plants and bringing them home and keeping the feed and watered. :)

    Your articles do a great job teaching gardening 101, rather streaming video that is. Good job!

  11. Charles says:

    For the life of me, I can’t get Strobe Media Playback to play mp4 files.

    I can switch the file in the src box to a .swf file then run the embed code for it and it loads, and plays just fine, but not with the mp4 file.

  12. Mr Rudy says:

    An oldie but goodie. I uploaded and played a video in under 20 minutes after reading this tutorial and the documentation on the host site for the SMP player.

    I recommend this method wholeheartedly!!!!!!

    Open source (SMP), options for your own branding and customisation of the skins?
    Who could not love this?

    .mp4 files play brilliantly from my server! Super easy setup!

    Brilliant post!

  13. abhi says:

    I dont want to store video on web server rather I am storing on separate storage and reading that particular video as a file and settng content type etc .

    I cant play video more than once and can’t also seek back and forward

    Please HElp

  14. Ganesh R says:

    Sir i need some code in html to add Flash player and to link a video on it. do you have any options.

Add a Comment