Embed video in web page (HTML)

14,535

Solution 1

There are a few ways to combine HTML5 video with fallbacks for non-supporting browsers. A few specific solutions have been demonstrated.

One example is Video for Everybody by Camen Design, which conforms to HTML5, and uses conditional comments for IE and a nested object tag for older browsers. This should be standards-compliant, backwards-compatible, and future proof.

Solution 2

HTML 5 is not standard. It is a draft. It will probably become standard one day. It will probably change first.

If you want to embed video in a page then, today at least, Flash is the best supported option you have available. I'd provide a link to a regular downloadable version as an option for people who don't have Flash (or who just want to watch the video in a dedicated video player).

Telling people to upgrade their browser won't help a great deal. As far as I know, the only browser with video support in a stable release is Firefox. Chrome doesn't support it except in the development version. I don't think Opera has brought out a stable build with support. Microsoft certainly hasn't added it to Internet Explorer yet. Safari I'm not sure about.

If you really want to avoid Flash, then you could use an HTML 4.01 object.

<object data="myVideo.ogv" type="video/ogg">
  <!-- fallback content here -->
</object>

… and hope the user has a plug-in capable of handling the video installed.

Solution 3

I've just come across Cortado. It's a Java applet that plays an OGG. I actualy have to thank David Dorward for this, since checking up HTML5's status made me come across it. Firefox suggests using something like:

 <video src="my_ogg_video.ogg" controls width="320" height="240">  
   <object type="application/x-java-applet"  
           width="320" height="240">  
      <param name="archive" value="cortado.jar">  
      <param name="code" value="com.fluendo.player.Cortado.class">  
      <param name="url" value="my_ogg_video.ogg">  
      <p>You need to install Java to play this file.</p>  
   </object>  
 </video>  

Java is available to FAR MORE platforms than flash, and, in this case, if just a fallback to HTML5.

(source)

Solution 4

I know it's a bit late, but did you have a look at VLC ?

It can be embedded in a website, runs on Windows, Mac OS & Linux, is free, open source, supports a lot of video/audio format...

The drawback is that it doesn't have a nice GUI with play/pause/set volume/ ... functions , you have to create them yourself.

You can have a look at this article: http://www.videolan.org/doc/play-howto/en/ch04.html#id310965

Share:
14,535
WhyNotHugo
Author by

WhyNotHugo

Updated on June 15, 2022

Comments

  • WhyNotHugo
    WhyNotHugo almost 2 years

    I want embed a video in a webpage.
    I don't want to use flash because it's unavailable for a huge number of platforms.
    I'm reluctant to use HTML5 becase it's not too standard yet (It IS standard, but most people don't have browsers that support it)

    Is there any other way? Or should I stick to HTML5 and a HUGE banner telling people to upgrade their browser?

  • Rabeel
    Rabeel over 14 years
    Lets just assume flash isn't an option for Hugo. What should he use?
  • WhyNotHugo
    WhyNotHugo over 14 years
    Even if it's only 10% of the people that are left out, I want to avoid it. I have some other reasons to hate flash anyway, so I just won't use it.
  • Quentin
    Quentin over 14 years
    It is probably more like 0.1% of people.
  • Daan
    Daan over 14 years
    @BW: What he should use depends on the goal / target users of the website. The general public: use a format for which most users have a plug-in (not sure which that would be). Specific user group / company / technical environment: use the format that is available in that context.
  • WhyNotHugo
    WhyNotHugo over 14 years
    Probably. Even x86 linux users aren't excluded in this case.
  • WhyNotHugo
    WhyNotHugo over 14 years
    I've never come across this. What plays the video in this tag? Do mayor browsers actually have a plug-in that makes this work, or is this a 5%-of-the-people thing?
  • WhyNotHugo
    WhyNotHugo over 14 years
    I want as much people as possible to be able to view this. Personally, I use an OS with no flash support, and where gnash has dropped development as well, so no chance. That fact aside, flash usually "breaks consistency" in many browsers. Browser hotkeys are unusable as flash has focus; doesn't respect accessibility (font size) settings, etc.
  • Daan
    Daan over 14 years
    @Hugo: all very true, and these are indeed shortcomings of Flash, but if Flash can make the difference between your content being available to a lot of people or not (provided that's the intention of course), it might be worth putting up with all that.
  • Quentin
    Quentin over 14 years
    It is standard HTML 4.01. Whatever plug-in registers itself to handle video/ogg (in this example) data handles it. Installing VLC gave me the support I needed for that (and Firefox prompted me to look for a plugin when it wasn't installed). I've never investigated the install base of suitable plug-ins so I don't know what the support level is like out in the wild.
  • WhyNotHugo
    WhyNotHugo over 14 years
    Cool. It's a pretty good fallback for the <video> tag (or viceversa)
  • Asela Liyanage
    Asela Liyanage over 14 years
    I don't think that you're going to find any in-browser video solution that has a wider availability than Flash at this time.
  • Quentin
    Quentin over 14 years
    @Wahnfrieden Hi! Welcome to the 2009. Things might be a little different from what you are used to. w3.org/TR/html5/video.html#video
  • Asela Liyanage
    Asela Liyanage over 14 years
    @David Dorward, no need to be sarcastic. I'm mistaken - the <video> tag has been left in, but the codec used is no longer specified and will vary by implementation. I thought when they dumped Ogg Theora that the tag was also removed. But it still doesn't offer a clear advantage over <object> since you still have to hope the client is using a browser that supports your codec.
  • Quentin
    Quentin over 14 years
    It does offer a clear advantage over <object> - a consistent API and a means to test if the video format is supported. Codecs will almost certainly standardise quickly anyway.
  • WhyNotHugo
    WhyNotHugo about 14 years
    Thanks, I actually came across this the other day. I ended up using HTML5 with java fallback, but this isn't a very bad idea either. Only problem would be clients without VLC installed.
  • WhyNotHugo
    WhyNotHugo about 14 years
    WOW! This totally rules, love it!
  • Matthew Scharley
    Matthew Scharley almost 13 years
    @David two years later, and the battle still rages. I wish you'd been right :(