Silverlight Hack

Silverlight & related .NET technologies

About Me

Welcome to Silverlighthack.com.  This is a site where you can find many articles on Silverlight, Windows Phone 7 and .NET related technologies.  

My name is Bart Czernicki.  I have been working with computers since 1988 and have over 12 professional years in the IT field focusing on architecture, technology strategy and product management.  I currently work as a Sr. Software Architect at a large software development company.

Below is the cover of my new book that shows how Silverlight's unique RIA features can be applied to create next-generation business intelligence (BI 2.0) applications.

Silverlight 4 Business Intelligence Soft 

Contact: bartczernicki@gmail.com

View Bart Czernickis profile on LinkedIn

NONE of the comments or opinions expressed here should be considered ofmy past or current employer(s).  The code provided is as-is without anyguarantees or warranties.

Five Things that HTML5 Video Currently will not do, but Silverlight or Flash will

Abstract:  This article will cover 5 pieces of functionality that are not built-in currently into the HTML5 video specification that Silverlight and Flash can solve.  This article covers potential workarounds and how HTML5 will handle these limitations in the future.  Note a great deal of conent of this article comes from Nigel Parker's talk at MIX 2011 "Things You Need To Know To Start Using <video> and <audio> Today".

Note: this post is meant to be informational about HTML5 video compared to Silverlight/Flash. Even if you don't like Silverlight or Flash, I hope you learn something by reading sme of the current limiations of HTML5 video. For more info check out Robert Reinhardt's article (<Hype>Flash video is coming to iPad.</Hype><Reality>Yet another streaming solution will be available for H.264 to iOS.</Reality>) that covers the topic from another perspective.

Update 10/01/2011: Updated some information below, however the content in this article is still current.

1) Digital Rights Management (DRM) - Cannot protect video content over HTML5

The HTML5 does not and will not ever include Digital Rights Management.  One of the owners of the the HTML5 draft is quoted as saying: "If we provided DRM in the HTML5 draft, it would be hacked in 2 days".  Therefore, content that includes sports, Hollywood movies, tv shows etc. will never be provided over HTML5 video legally.  This can be confusing for some people, because you hear many people post blogs or tweets "Youtube is going full HTML5".  This is partly true.  User content on Youtube will be HTML5, but you will never see copyright music videos or movies on Youtube surfaced over HTML5 containers or codecs.  

Workaround: None (use Silverlight or Flash)

Probability of being included in future HTML5 draft: None

2) No Smooth Streaming or Adaptive Streaming

The HTML5 draft/spec does not include conventions for smooth streaming/adaptive streaming.  Silverlight with IIS 7.x Smooth Streaming extensions can provide this for you.  There do exist third-party solutions for HTML5 adaptive streaming.  For example, Apple's HTTP Live Streaming (HLS).  However, this is not part of the current HTML5 draft/spec.

There is work currently being done to take an adaptive streaming recommendation to the HTML5 council for approval.  The data visualization below (taken from w3.org ) shows this in better detail:

 

Workaround: Use Silverlight, Adobe Flash or Apple's native solutions

Probability of being included in future HTML5 draft: Very High
 
3) No Standard Video Codecs for HTML5
 
The HTML5 draft/spec does not include an explicit definition of what codec should be used for surfacing HTML5 videos.  This has been a contraversial decision that has led to developers of browsers to determine which codecs they allow to play on their browser.  The main contraversy surrounds the use of a proerietary codec (H.264), which both Apple and Microsoft support.  Conversely, the Mozilla, Opera and Google browsers have rallied around an open-source encoder called WebM and Ogg.  Neil Parker's slide from his MIX 2011 talk shows a great breakdown of the codec support in current browsers: 
 
 
Workaround: In the HTML5 markup, you can provide multiple different encoding sources and resolutions targeting mobile or desktop/laptop clients.  Furthermore, you can also fallback to Silverlight or Flash if the browser is not HTML5 compliant.  It is up to the developer to provide all these fallback scenarios.  This is equivelant to providing different CSS or JavaScript depending on browser support.
 
Probability of being included in future HTML5 draft: Very Low (the HTML5 spec would have to change their decision and prescribe a default codec for all HTML5 video tags)
 
4) Full Screen Support 
 
HTML5 currently does not support full screen video.  (Update 10/01/2011) For an example, check out a video from the Microsoft BUILD Conference.  While viewing the video in HTML5 format, you cannot view it in fullscreen (in Silverlight you can).  To me it is kind of a big deal especially when you are looking at source code on a partial screen.
This is not a technology problem or not possible to implement in browsers, however the current debate of full screen HTML5 video centers around what keyboard functions are available and what happens when you exit full screen mode.  The main reason for this is security:
 
"User agents should not provide a public API to cause videos to be shown full-screen. A script, combined with a carefully crafted video file, could trick the user into thinking a system-modal dialog had been shown, and prompt the user for a password. There is also the danger of "mere" annoyance, with pages launching full-screen videos when links are clicked or pages navigated. Instead, user-agent specific interface features may be provided to easily allow the user to obtain a full-screen playback mode." 
 
Note: Silverlight 4 and Adobe Flash 10.2 allow a user with dual monitors to play a video in full screen HD while the other monitor remains responsive to full user input.  It will be interesting how HTML5 browsers solve this, as this could be a potential security problem (since everything to manipulate in HTML5 is done via JavaScript libraries).  Example here of Silverlight 4 dual monitor pinning. 
 
Workaround: Use the VideoFullScreen.js provided by Martin Rauscher: here
 
Probability of being included in future HTML5 draft: High (HTML5 draft spec needs to explicitly define how browers interact with full screen.  For example, initially Silverlight 3 allowed full screen video but limited the keyboard functionality for the same security reasons as mentioned above).
 
5) No Standard Conventions/Look and Feel
 
One of the nice thing about plug-ins like Silverlight or Flash is that you essentially publish your video and let Microsoft or Adobe handle all the compatibility implementations across browsers or operating systems.  For HTML5 video tags it is up to the browsers to implement this themselves.  For example, Neil Parker had a great slide that showed an HTML5 video with a rounded corner border applied.  These are the results: 
 
 
 
This also includes the standard controls that are rendered with each video by different browsers.
 
Workaround: You can create a custom HTML5 video player control or use one of the third party ones.  Some are open source and some you can purchase.
 
Probability of being included in future HTML5 draft: Some of this already is.  It is up to the browser developers to fix their CSS and HTML5 video implementations (or use HTML polyfill patterns).  However, the HTML5 spec is not going to perscribe the very detailed looked of the progress bar of the video control (Note: in Silverlight and Flash you get a consistant look and feel across the browsers since Microsoft and Adobe control this; although you can create your own custom video players as well).
 
Summary 
 
In summary, the current HTML5 specification and implementations for video have some gaps.  It is important to note the current limitations of HTML5 video, especially with DRM.  A naive web developer wil be surprised to know that they can't just put a video tag with an encoded video and have it work as expected across all browsers just like Flash/Silverlight do.  There are some workarounds & solution available to provide Flash-like video.  However, the naive approach that HTML5 solves everything about video for you because its "new" or "better" will quickly get you in trouble.
 
Posted: Apr 16 2011, 13:05 by Bart Czernicki | Comments (10) RSS comment feed |
  • Currently 3.142857/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: HTML 5 | HTML5 | Silverlight
Tags:
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us
blog comments powered by Disqus