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

PDC 2010: Top 5 Reasons Why Microsoft Completely Screwed up their web strategy with HTML 5

Update 11/1/2010:  Officual update from Bob Muglia: http://team.silverlight.net/announcement/pdc-and-silverlight/

This is an article in response to Microsoft's new web strategy that was announced this week at the PDC 2010.  In a nutshell,  Microsoft is fully embracing HTML 5 and re-purposing Silverlight for rich client development (Windows Phone 7).

Here are my 5 reasons why Microsoft really messed this one up (coming from a perspective of timing, tooling and corporate means of making money):

  1. HTML 5 is not ready yet...and don't know when it will be
  2. Internet Explorer 6-8 problem
  3. No Microsoft HTML 5 Tooling announced 
  4. The CIO/CTO effect
  5. Silverlight is in limbo...wait til MIX 2011 to find out more

HTML 5 is not ready yet...and don't know when it will be

HTML 5 has become an abstract term already before being released.  When someone tells you they implemented a site in HTML 5; what does that mean?  Are they just using some HTML 5 tags like Canvas?  Have they implemented CSS 3, SVG, Web Workers, WebGL?  HTML 5 has several related technologies that are being developed in parallel or as part of the HTML 5 specification.  No current browser supports the entire gamut of "HTML 5 and related technologies".

When is HTML 5 being released?  HTML 5 is not a true language from a purist perspective.  It is a set of standards that are accepted and implemented in web browsers.  Here in lies the problem...even if the full HTML 5 spec is done; then all the browsers need to implement it.  Finally, all the browsers the billions of people have installed need to be replaced with "full HTML 5 compliant browsers"

Example 

I wanted to highlight Google's YouTube as an example.  Google is very pervasive with HTML 5 and Ian H. runs the HTML 5 spec essentially.  Look at their youtube site and HTML 5 is there, but NOT the default.  If HTML 5 was so ready, then why need Flash?  Well simply a majority of the browsers don't support it....even Google's current browser version does not.  Their WebM standard uses VP8 codec, which is the open source one that everyone fought over in the "HTML 5 codec wars".  If you are on IE 6-8 you need to INSTALL Google Frame...lol.  Imagine you are an architect, CIO....are you going to write an app in all of HTML 5 now if you need RIA functionality?

Internet Explorer 6-8 problem

Internet Explorer 9 will be Microsoft's first browser to support HTML 5.  However, it is in beta and probably won't be released until April 2011.  So, did Microsoft just dump Silverlight for a platform they don't support?  YES!  Even if Internet Explorer 9 was RTM'ed today, over 63% of the world is using Internet Explorer which is NOT HTML 5 compliant!  It will literally take years for everyone to get Internet Explorer 9 widely supported.  This is not even mentioning older versions of Chrome, Opera or Firefox.  I would bet that about 70% of the CURRENT browsers do not support HTML 5 even partially.

No Microsoft HTML 5 Tooling Announced

So what are Microsoft's great new tools to create HTML 5 web sites?  Uhhhh.....I don't know.  Microsoft was very mum on this.  One would think that when you are shifting to HTML 5 you would show something a little more than just Internet Explorer 9 Beta.  However, that is exactly what Microsoft did:

  • no new Expression Web shown
  • no export from Silverlight to HTML 5 (like Adobe has)
  • no HTML 5 helpers for ASP.NET MVC announced 

In my opinion, this is completely ridiculous.  I know no one "owns" HTML 5.  However, don't you want developers (that buy your software and OSes) to develop using YOUR software?  What is to stop an Adobe Flash or Silverlight developer dropping Windows and Visual Studio 2010 and going on a Mac with open source HTML 5 tools?

The CIO/CTO Effect

Every headline today about the shift in strategy has been HTML 5 wins and Silverlight loses.  Imagine what a CIO/CTO will think, when they get their tech info from these "high level technology summary" web sites or periodicals.

It doesn't take a genius to figure out the clear message here in the headlines (even without reading the article).  So I would bet if you were deciding on which technology to work on that upcoming project...this shift in strategy might scare senior management away from Silverlight.

Silverlight is in limbo...wait til MIX 2011

So what is going on with Silverlight?  When is the next release?  Is Microsoft discontinuing Silverlight?

If you have a vested interest in Silverlight, you have to wait 5 months until MIX 2011 (Microsoft's web conference) to find out what is going to happen next.  For someone who has invested in this technology, I find it insulting.  The problem is that you don't know anything clear.  This is very akin to Wall Street..."the market hates not knowing";  they want to know where to invest based on the news.  If you don't know where Silverlight is going; how seriously are you going to champion or invest in the technology?

 

What would you have done?

I listed all the reasons, why I think Microsoft screwed up the web strategy this week.  This is what I would have done: 

  • DELAY the shift in strategy to "re-purpose" Silverlight and declare HTML 5 the winner UNTIL Microsoft had the tooling, Internet Explorer RTM'ed
    • (credit to Paul Litwin for this one)  How about waiting until Windows Phone 7 matures.  Don't you need as many devs creating Windows Phone 7 apps using Silverlight?  If people leave Silverlight, then this will drop the pool of devs creating WP7 apps.
  • Be very explicit in Silverlight's role on the web, cloud and the client
  • Either commit to or scrap Silverlight's future (don't leave it in limbo)
  • Show how Microsoft is going to revolutionize HTML 5.  Don't be a Steve Jobs sheep and jump on HTML 5.
 
In summary, Microsoft really fumbled the web strategy this week.  What amplifies the fumbling is that they did this AT THE PDC (Professional Developer's Conference).  Doing this to developers at "their" conference and not explaining Silverlight's future is totally unacceptable.  I think senior management is to blame and wanted to have a "direct message about the web".  This should have been done when Microsoft had HTML 5 "ready to go" with tooling and IE 9 was released. Microsoft has a great platform in Silverlight that can compliment the web.  However, they are shifting their strategy to a platform that is not ready, don't know when it will become "released" nor do they have their own tools to develop for....HUGE MISTAKE. 
Posted: Oct 29 2010, 16:10 by Bart Czernicki | Comments (29) RSS comment feed |
  • Currently 4.888889/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: HTML 5 | Silverlight
Tags:
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us

HTML 5 is Born Old - Quake in HTML 5 Example

One of the big news stories for HTML 5 this past week was the demo of Quake running in HTML 5. This was done by Google engineers for Webkit-based browsers like Chrome and Safari.  This is one of those demos that gets a lot of "OMG...that's awesome".  This inevitably leads to the next round of comments "see Flash is RIP; long live HTML 5".

Video of Quake 2 in HTML 5 using WebGL extensions 

 

This news made the front pages of DiggReddit and Engadget.  A lot of people are obviously excited by this and they should be.  However, once again, a lot of comments are simply misguided. I really like kenjura's comments on Digg about this article.  "HTML5 is getting the Obama treatment: You fanboy idiots are giving them a Nobel Peace Prize and the technology hasn't even materialized yet!" I cannot agree more.  

How soon people forget that this was done in Flash back in 2007 and in Silverlight in 2008.  Granted, both demos used Quake 1 (not Quake 2) but the overall concept is the same.

Quake in Flash (2007)

 

Quake in Silverlight (2008)

 

HTML 5 is born Old

It is cool to see HTML evolve to be able to do this.  Don't get me wrong; I think it is a very impressive achievement.  However, think about this objectively.  The last HTML 4 spec governed the web for 11 years.  HTML 5 is not even ratified and it is going to be accomplishing what we could have done in other RIA technologies 2-3 years ago!  What is the web going to look like in 5-8 years?  Is HTML 5 going to be relevant to keep up with the future web? Will it be behind Silverlight/Flash?  Those are the questions I would be asking if I am excited about a technology doing what was done 2-3 years ago!

In its current form, HTML 5 brings you: audio, video, WebGL, Web Sockets, Web Workers, SVG, canvas.  So far, so good.  But it is still missing some core functionality that Silverlight/Flash have:

  • No device support for web cams or microphones
  • No font management.  In Silverlight/Flash, you can just embed the font in the SWF/XAP package.  In HTML, the OS needs to have the font installed.
  • No good/common design tools.  Where is the design tools integration: HTML, CSS, SVG, JavaScript, WebGL all into a holistic design package?  Expression Blend allows designers to mock up entire applications with animation and behaviors with no code.
  • No DRM protection for media playback
  • No "Out of the browser" applications for disconnected scenarios
  • JavaScript is your programming language.  In Silverlight, you can choose from C#, F#, VB.NET, Iron Ruby, etc.
  • Since Silverlight leverages .NET, I can share assemblies and components between WPF, server assemblies, ASP.NET assemblies with Silverlight.  Do you have any server components written in JavaScript? :)
  • No COM support for Windows scenarios
  • Performance.  For example, in this video, we can see on the Droid platform Flash is 2-3x times faster than the HTML 5 Canvas.  Granted for most RIA modules this is overkill.  However, imagine a vey complex data visualization or a game with 2D physics that will want to utilize max performance.
  • Data-Service support.  Silverlight has tight integration with scalable data service frameworks like WCF RIA Services to handle SOAP, REST and pub-sub services.

 

HTML 5 will no doubt evolve slowly and replace Adobe Flash in many places.  However, comments about the demo of the "Quake in HTML 5" that claim other RIA technologies are dead is simply nonsense. In 2011 or 2012 when Silverlight 6 is out, what is the state going to be for HTML 5 features?  As you can see from the list above, HTML 5 is already missing some big features.  In two years' time as Adobe and Microsoft evolve their RIA technologies, HTML 5 will look like an older and older technology.

Isn't it great that HTML 5 is going to allow you to "democratize" RIA functionality without a plug-in?...yes.  Is HTML 5 revolutionizing RIA or taking it where RIA has not gone before?....absolutely not.

kick it on DotNetKicks.com
Posted: Apr 02 2010, 19:26 by Bart Czernicki | Comments (4) RSS comment feed |
  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Filed under: HTML 5 | Silverlight
Tags:
Social Bookmarks: E-mail | Kick it! | DZone it! | del.icio.us