views:

51

answers:

4

Hello,

I am a little new to embedding videos on a website. What is the best way to go about it? I just started reading up on it.

I read that I should use HTML5 and the browser's native player. -- Does anyone know of a javascript library that will use the browser's player and detect if the browser is not using HTML5 to downgrade to a flash player?

As far as encoding what is the best approach? I am planning on writing a little console app to use FFMPEG to convert the videos. But what encoding should I use? I heard H.264 is promising? But

A: 

I read that I should use HTML5 and the browser's native player

Which idiot told you that? Given that you will loose out on a significant portion of the client population you either run a monoculture of HTML 5 browsers, of whoever said that should be serving burgers at McDonalds, not give advice to people. HTML 5 and the integrated player are nice, but not there yet for the general public. In a couple of years, yes. Now - if I hire a web company for putting videos on a website and they do that, they get sued for gross neglect and incompetence.

Today, playback is mostly flash - that has a high penetration. A flash video player is also what sites like youtube currently use. If you go for less (penetration), Silverlight is very good and has the complete backend infrastructure.

I heard H.264 is promising?

So what? FIRST you need to fix the playback side, then you use whatever format is most efficient given your playback decision.

TomTom
Kind of a hostile response, but this is good information nonetheless.
Kevin Wiskia
You're right, but no need to call people idiots. HTML 5 just isnt there yet.
Jack Marchetti
Given the poor ecosystem of outdated browsers in the wild, your argument will probably still hold weight in 5 years time. That doesn't mean we have to continue using a third-party plugin for all the web's video needs, at least not as the primary implementation. Falling back to Flash from HTML5 <video> for outdated browsers is a pretty trivial task.
Ashley Williams
McDonalds has the highest market penetration when it comes to selling hamburgers, so clearly their hamburgers are the best, right? Wrong. The HTML5 method provides for the best possible user experience right out of the box and, like ashleyw has said, creating a Flash fallback for outdated browsers is pretty simple. YouTube, Vimeo, and other major video sites provide the option to use an HTML5 player if the user prefers, not to mention this affords you the ability to serve video to devices that don't support Flash yet, like most smartphones.
Andrew
+1  A: 

Use Handbrake for video encoding, especially for HTML 5 support.

HTML 5 is an awesome way of embedding video, however it hasn't been standardized yet. You definitely want to use it if you're supporting iOS devices, as they of course don't support Flash which is the most mainstream way of embedding video.

HTML5 is pretty awesome because this is how simple it is:

<video src="video.m4v" />

Here is a fantastic link you will find useful: http://www.robwalshonline.com/posts/tutorial-serving-html5-video-cross-browser-including-ipad/

Jack Marchetti
+3  A: 

This is what you're looking for: http://videojs.com/

Encoding wise, I think H.264 and WebM is a wise choice. That way you'll satisfy all modern browsers and mobile devices (incl. iOS and Android), and only fall back to Flash for older, pre-HTML5 browsers (and FF 3.6, which only supports Theora.)

Ashley Williams
Luckily FF 4.0 will support WebM. IE9 should support it if you have the codec installed, that just leaves us with Safari :(
Kevin Wiskia
Safari supports H.264, which you'll need for the Flash fallback anyway.
Ashley Williams
Right, but no WebM. So hypothetically if we were passed the point of having to worry about a flash fallback, we would still need to different encodings.
Kevin Wiskia
Thank you for responding. I will look at this lib!
gdx
A: 

Downgrading is easy ...

<video ... > your browser does not support html5 video </video>

Place the downgrade code in between the opening and closing of the video tags ... non html5 browsers will ignore the video tag and render the flash or any html code between the opening and closing video tags. HTML5 browsers will render the video and ignore the html code.

This feature can also be used to let people know about chromeframe http://wsmithdesign.wordpress.com/2010/10/03/using-html5-video-tag-with-ie8/ which works with IE 6-8 and allows them to use HTML5 video.

Video format is still a problem; not all browsers support mp4, not all browsers support ogv.

Wayne