Return to Snippet

Revision: 27620
at June 18, 2010 00:49 by mennyj


Updated Code
<!-- first try native HTML5 video playback -->
<video width="640" height="360" controls="controls" autoplay="true">
	<source src="__MY_VIDEO__.ogv" type="video/ogg" />
	<source src="__MY_VIDEO__.mp4" type="video/mp4" />
	<!-- fall back to Flash *do not* include 'classid' so as to be compatible with non-IE browsers -->
	<object width="640" height="380" type="application/x-shockwave-flash" data="__FLASH_PLAYER__.swf" 
		flashvars="autostart=true&amp;file=http://tinyvid.tv/vfe/video_for_everybody.mp4"
	>	<!-- IE compatibility for the above -->
		<param name="movie" value="__FLASH_PLAYER__.swf" />
		<param name="flashvars" value="autostart=true&amp;file=__MY_VIDEO__.mp4" />
		<!-- no Flash? fall back to a QuickTime object iPhone OSv2 will use this file. ensure your MP4 is compatible: <tinyurl.com/qmmss6> IE6 does not allow object-within-object, Flash is the only option. this object tag (with classid) is  hidden from non-IE browsers, as it causes a plugin-install prompt to occur even if the plugin is not needed because it�s been superseded by HTML5 video -->
		<!--[if gt IE 6]>
		<object width="640" height="375" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B">
			<param name="src" value="__MY_VIDEO__.mp4" />
			<param name="autoplay" value="true" /><!
		[endif]--><!-- the odd line-break above is *required* or QuickTime fallback fails -->
		<!--[if gt IE 6]><!-->
		<!-- that self-closing comment after the conditional tag is the only way to reveal the conditional comment to other browsers that is compatible with serving as XHTML (application/xhtml+xml). a normal closing comment marker would be visible in IE7, and other workarounds cause an XML parser error (comment-in-comment) -->
		<!-- QuickTime height is height+15 to leave room for the controls -->
		<object width="640" height="375" autoplay="true"
			type="video/quicktime" data="__MY_VIDEO__.mp4"
		>	<!-- params for Safari/Chrome compatibility (they ignore the attributes above) -->
			<param name="src" value="__MY_VIDEO__.mp4" />
			<param name="autoplay" value="true" />
		<!--<![endif]-->
		<!-- finally, if all else fails, fall back to a warning message: *always* tell the user *what* it is they can't see�give a title or description -->
			<hr />
			<h3>Video: __TITLE_OF_MY_VIDEO__</h3>
			<p>
				<strong>No video playback capabilities detected.</strong>
				Why not try to download the file instead?<br />
				<a href="__MY_VIDEO__.mp4">MPEG4 / H.264 .mp4
				(Windows / Mac)</a> |
				<a href="__MY_VIDEO__.ogv">Ogg Theora &amp; Vorbis .ogv
				(Linux)</a>
			</p>
			<!-- and try to give them genuinely helpful information to rectify the problem -->
			<p>
				To play the video here in the webpage, please do one of the following:
			</p><ul>
				<li>Upgrade to <a href="http://getfirefox.com">Firefox v3.5</a>,
					or <a href="http://apple.com/safari">Safari v4</a></li>
				<li>Install <a href="http://get.adobe.com/flashplayer/">Adobe Flash Player</a></li>
				<li>Install <a href="http://apple.com/quicktime/download/">Apple QuickTime</a></li>
			</ul>
			<hr />
		<!--[if gt IE 6]><!--></object><!--<![endif]-->
		<!--[if gt IE 6]></object><![endif]-->
	</object>
</video>

Revision: 27619
at June 18, 2010 00:49 by mennyj


Updated Code
<!-- first try native HTML5 video playback -->
<video width="640" height="360" controls="controls" autoplay="true">
	<source src="__MY_VIDEO__.ogv" type="video/ogg" />
	<source src="__MY_VIDEO__.mp4" type="video/mp4" />
	<!-- fall back to Flash *do not* include 'classid' so as to be compatible with non-IE browsers -->
	<object width="640" height="380" type="application/x-shockwave-flash" data="__FLASH_PLAYER__.swf" 
		flashvars="autostart=true&amp;file=http://tinyvid.tv/vfe/video_for_everybody.mp4"
	>	<!-- IE compatibility for the above -->
		<param name="movie" value="__FLASH_PLAYER__.swf" />
		<param name="flashvars" value="autostart=true&amp;file=__MY_VIDEO__.mp4" />
		<!-- no Flash? fall back to a QuickTime object iPhone OSv2 will use this file. ensure your MP4 is compatible: <tinyurl.com/qmmss6> IE6 does not allow object-within-object, Flash is the only option. this object tag (with classid) is  hidden from non-IE browsers, as it causes a plugin-install prompt to occur even if the plugin is not needed because it���¢�¯�¿�½�¯�¿�½s been superseded by HTML5 video -->
		<!--[if gt IE 6]>
		<object width="640" height="375" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B">
			<param name="src" value="__MY_VIDEO__.mp4" />
			<param name="autoplay" value="true" /><!
		[endif]--><!-- the odd line-break above is *required* or QuickTime fallback fails -->
		<!--[if gt IE 6]><!-->
		<!-- that self-closing comment after the conditional tag is the only way to reveal the conditional comment to other browsers that is compatible with serving as XHTML (application/xhtml+xml). a normal closing comment marker would be visible in IE7, and other workarounds cause an XML parser error (comment-in-comment) -->
		<!-- QuickTime height is height+15 to leave room for the controls -->
		<object width="640" height="375" autoplay="true"
			type="video/quicktime" data="__MY_VIDEO__.mp4"
		>	<!-- params for Safari/Chrome compatibility (they ignore the attributes above) -->
			<param name="src" value="__MY_VIDEO__.mp4" />
			<param name="autoplay" value="true" />
		<!--<![endif]-->
		<!-- finally, if all else fails, fall back to a warning message: *always* tell the user *what* it is they can't see���¢�¯�¿�½�¯�¿�½give a title or description -->
			<hr />
			<h3>Video: __TITLE_OF_MY_VIDEO__</h3>
			<p>
				<strong>No video playback capabilities detected.</strong>
				Why not try to download the file instead?<br />
				<a href="__MY_VIDEO__.mp4">MPEG4 / H.264 .mp4
				(Windows / Mac)</a> |
				<a href="__MY_VIDEO__.ogv">Ogg Theora &amp; Vorbis .ogv
				(Linux)</a>
			</p>
			<!-- and try to give them genuinely helpful information to rectify the problem -->
			<p>
				To play the video here in the webpage, please do one of the following:
			</p><ul>
				<li>Upgrade to <a href="http://getfirefox.com">Firefox v3.5</a>,
					or <a href="http://apple.com/safari">Safari v4</a></li>
				<li>Install <a href="http://get.adobe.com/flashplayer/">Adobe Flash Player</a></li>
				<li>Install <a href="http://apple.com/quicktime/download/">Apple QuickTime</a></li>
			</ul>
			<hr />
		<!--[if gt IE 6]><!--></object><!--<![endif]-->
		<!--[if gt IE 6]></object><![endif]-->
	</object>
</video>

Revision: 27618
at June 18, 2010 00:42 by mennyj


Initial Code
<!-- first try native HTML5 video playback -->
<video width="640" height="360" controls="controls" autoplay="true">
	<source src="__MY_VIDEO__.ogv" type="video/ogg" />
	<source src="__MY_VIDEO__.mp4" type="video/mp4" />
	<!-- fall back to Flash *do not* include 'classid' so as to be compatible with non-IE browsers -->
	<object width="640" height="380" type="application/x-shockwave-flash" data="__FLASH_PLAYER__.swf" 
		flashvars="autostart=true&amp;file=http://tinyvid.tv/vfe/video_for_everybody.mp4"
	>	<!-- IE compatibility for the above -->
		<param name="movie" value="__FLASH_PLAYER__.swf" />
		<param name="flashvars" value="autostart=true&amp;file=__MY_VIDEO__.mp4" />
		<!-- no Flash? fall back to a QuickTime object iPhone OSv2 will use this file. ensure your MP4 is compatible: <tinyurl.com/qmmss6> IE6 does not allow object-within-object, Flash is the only option. this object tag (with classid) is  hidden from non-IE browsers, as it causes a plugin-install prompt to occur even if the plugin is not needed because it�¢ï¿½ï¿½s been superseded by HTML5 video -->
		<!--[if gt IE 6]>
		<object width="640" height="375" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B">
			<param name="src" value="__MY_VIDEO__.mp4" />
			<param name="autoplay" value="true" /><!
		[endif]--><!-- the odd line-break above is *required* or QuickTime fallback fails -->
		<!--[if gt IE 6]><!-->
		<!-- that self-closing comment after the conditional tag is the only way to reveal the conditional comment to other browsers that is compatible with serving as XHTML (application/xhtml+xml). a normal closing comment marker would be visible in IE7, and other workarounds cause an XML parser error (comment-in-comment) -->
		<!-- QuickTime height is height+15 to leave room for the controls -->
		<object width="640" height="375" autoplay="true"
			type="video/quicktime" data="__MY_VIDEO__.mp4"
		>	<!-- params for Safari/Chrome compatibility (they ignore the attributes above) -->
			<param name="src" value="__MY_VIDEO__.mp4" />
			<param name="autoplay" value="true" />
		<!--<![endif]-->
		<!-- finally, if all else fails, fall back to a warning message: *always* tell the user *what* it is they can't see�¢ï¿½ï¿½give a title or description -->
			<hr />
			<h3>Video: __TITLE_OF_MY_VIDEO__</h3>
			<p>
				<strong>No video playback capabilities detected.</strong>
				Why not try to download the file instead?<br />
				<a href="__MY_VIDEO__.mp4">MPEG4 / H.264 .mp4
				(Windows / Mac)</a> |
				<a href="__MY_VIDEO__.ogv">Ogg Theora &amp; Vorbis .ogv
				(Linux)</a>
			</p>
			<!-- and try to give them genuinely helpful information to rectify the problem -->
			<p>
				To play the video here in the webpage, please do one of the following:
			</p><ul>
				<li>Upgrade to <a href="http://getfirefox.com">Firefox v3.5</a>,
					or <a href="http://apple.com/safari">Safari v4</a></li>
				<li>Install <a href="http://get.adobe.com/flashplayer/">Adobe Flash Player</a></li>
				<li>Install <a href="http://apple.com/quicktime/download/">Apple QuickTime</a></li>
			</ul>
			<hr />
		<!--[if gt IE 6]><!--></object><!--<![endif]-->
		<!--[if gt IE 6]></object><![endif]-->
	</object>
</video>

Initial URL
http://camendesign.com/code/video_for_everybody

Initial Description
[via rtcrm]
Video for Everybody is very simply a chunk of HTML code that embeds a video into a website using the HTML5 `<video>` element which offers native playback in Firefox 3.5 and Safari 3 & 4.

This is native OGG video playback in Firefox 3.5 (you get H.264 playback in Safari). No plugins to install. The video is played by the browser itself. It loads quickly and doesn’t threaten to crash your browser. 

In other browsers that do not support `<video>`, it falls back to Adobe Flash:
You can host locally or embed any Flash file, such as a YouTube video.

If Flash is not installed, QuickTime is used which allows playback on the iPhone.

If QuickTime is not installed then Windows Media Player is used in Internet Explorer 8 for Windows 7. This means that it is actually almost impossible for the video to not play in IE8 on Windows 7. Even without Flash and QuickTime, you’d have to disable Windows Media Player or all ActiveX entirely!

Finally, if all else fails, a warning is issued that provides links to download the video, and links to software relevant to getting the video to play within the browser itself. Since this is just HTML, you can put anything here you want.

Initial Title
Video for Everybody

Initial Tags
html, video

Initial Language
HTML