The sample below is made based on the Audio Player I implemented before.
Actually, I am not video expert and you may find that the application may not be perfect. For example, the seek function in Flash is not working very well and I have no idea to set the smooth properties in Flash as well. (But may be it’s the problem of Flash)
Anyway, enjoy it~
Comparison
Flash implementation: 1 hour (Implemented First)
Silverlight implementation: 35 minutes
What’s the difference?
- fl.video.VideoPlayer [AS3] vs Window.controls.MediaElement[C#]
Source codes
Media Player [Flash 9, AS3] (519.9 KiB, 1,100 hits)
Media Player [Silverlight 2, C#] (30.4 KiB, 1,738 hits)
Flash
Silverlight
fl.video.VideoPlayer [AS3] vs Window.controls.MediaElement[C#]
There are many ways to load video in Flash. In the sample above, I used the Class VideoPlayer. It’s because it has some standard functions for checking the download progress and status.
Please note that if you want to use the VideoPlayer, you have to drag the FLVPlayback component into the Library first.
// C#
// create a video control
var player:VideoPlayer = new VideoPlayer();
player.addEventListener(ProgressEvent.PROGRESS, on_progress);
player.addEventListener(Event.COMPLETE, on_video_complete);
player.play(URL, 0);
// detect the download progress
private function on_progress(e : ProgressEvent):void{
trace(e.bytesLoaded , e.bytesTotal);
}
// Dispatched once the player finished playing
private function on_video_complete(e:Event):void{
}
For Silverlight, the way you load video is similar to audio. That’s why the implementation time is much less than Flash.
// C#
// create a video control
MediaElement mediaElement;
mediaElement.Source = new Uri(URL, UriKind.Absolute);
mediaElement.DownloadProgressChanged += new RoutedEventHandler(_mediaElement_DownloadProgressChanged);
// detect the download progress
void _mediaElement_DownloadProgressChanged(object sender, RoutedEventArgs e)
{
}

November 28th, 2008 at 9:45 pm
Cool review. Silverlight is really much better than flash
November 28th, 2008 at 10:52 pm
Flash is much better, silverlight doesn’t work at all (linux/firefox)
November 29th, 2008 at 12:04 am
Silverlight might be better, but Flash works in linux/firefox. Hence Silverlight must DIE.
November 29th, 2008 at 12:42 am
flash is the best and when do you see how things going on in actionscript 3 and how could translate it into air , flex application it will be amazing.
good,simple OOP language , that give you the maximum ,
FlashGuy
November 29th, 2008 at 2:23 am
Its amazing how many flash supporters remain in denial. Ayman what you decribe as upcoming benefits of flash were already achieved in Silverlight beta1.
November 29th, 2008 at 3:34 am
The Silverlight version does not work on a Mac. The fact that you can create something for a cross browser/platform plugin that does not work on every platform and browser troubles me. It’s not just about the example that is displayed above (that is probably just a JavaScript error) because i’ve seen this crossplatform/ browser Silverlight issue before.
I’ve seen some working examples of Silverlight and i really like the workflow and performance. Much better then Flash. However the Flash example on this page doesn’t do justice to the platform. If you want some real examples of nice Flash sites/ applications/ games/ animations then just look at: http://www.thefwa.com, http://www.newgrounds.com, http://www.sliderocket.com, https://buzzword.acrobat.com
Now compare that to:
http://www.silverlight.net (the horror!)
November 29th, 2008 at 6:30 am
Lawrence, are you mad? Silverlight, was hyped up to be competition for flash, but didn’t have a version to work on Macs OS, BSD, or Linux. What is even worst, microsoft stopped helping the Mono group, only to have to come back to the table to have them work on moonlight. Bottom line is, flash has been out there longer, it is installed on alot more computers, and more people know how to write for it. If someone comes to me with a project, I am not going to risk my job on a new language that doesn’t even have a good performing media server.
November 29th, 2008 at 4:27 pm
Remco, thanks a lot! I have a lot of fun in the links you provided.
By the way, I think Silverlight is not as good as Flash in the current stage. However, I think we have to get prepared and see how the technology evolved.
November 29th, 2008 at 5:24 pm
size of the flv file in this comparision is 2 times smaller than the wmv file.
video.flv -> 362 KB
video.wmv -> 772 KB
can you repeat this comparision after compressing video played by silverlight control a little bit more? I think it will be nearly same quality, but the test will be more consistent.
thanks
November 29th, 2008 at 6:35 pm
[...] Flash vs Silverlight: Media / Video Player … The sample below is made based on the Audio Player I implemented before. Actually, I am not video expert and you may find that the application may not be perfect. For example, the seek function in Flash is not working very well and I have no idea to set…( read more) [...]
December 9th, 2008 at 9:44 pm
Ako Says:
November 28th, 2008 at 10:52 pm
Flash is much better, silverlight doesn’t work at all (linux/firefox)
Jonako Says:
November 29th, 2008 at 12:04 am
Silverlight might be better, but Flash works in linux/firefox. Hence Silverlight must DIE.
Bla…bla.. bla… Your are a programmer’s experts?? not… then.. shut up!!
I’m working a Flash and is a “patetic” from big projects…
Just now working wiht a Silverlight… IS A BETTER!!….
Flash will be DIE (Adobe is the killer)…
December 30th, 2008 at 7:54 pm
Hi,
Regarding the flash vs Silverlight debate i dont think the silverlight was ever created to replace flash. It was created for a much bigger aim - to provide the same kind of features on the web that Windows Presentation Framework provided on the windows platform. I assume somehow comparisions between silverlight and flash have been unavoidable though and because of its nature i believe silverlight will certainly eat into flash’s share. I have seen and wokred on both and personally find silverlight better and i don’t mean to offend anyone. Adobe doesn’t have anything like WPF and in years to come silverlight is going to grow big like .Net. If silverlight doesn’t run on FF/Linux i am sure it will soon as its just a matter of a plugin to be released. There is no need to compare though , however if you really are on your way to do that then it wont be a fair comparision unless you work on both.
February 6th, 2009 at 11:23 pm
I think it’s fair to say that it doesn’t really matter if Silverlight is better than Flash or not.
Firefox is better than IE — in terms of compliancy, features, innovation of the user experience. Good things could also be said for Opera’s rendering engine. And yet, it holds only a margin of the browser share in comparison to IE (a much less great browser).
To summarize, if IE can’t be trampled — pre-installed, I know — then it is safe to say that Silverlight could/might serve the same fate.
You think the MediaElement is better? I don’t. Try using the Media Element on a video that is bigger than a youtube-sized window. IE performance jumps to 90%, while the Flash/Flex counterpart does little to tax the processor.
Silverlight holds many possibilities, but this evangelism is just gonna kill it.
February 13th, 2009 at 11:37 pm
LOL, THE VIDEO USED CLAIM HOW FAIR YOU ARE.
Does really :
video.flv -> 362 KB
video.wmv -> 772 KB
It’s doesn’t even looks h264.
I agree doesn’t really matter if Silverlight is better than Flash or not, actually it’s still far to be a flash competitor. The main problem is that it’s a microsoft technology (a rip-off as most of MS new applications), so it’s going to be pushed in an unfair way as microsoft used to do. They are going to fight the competitor using their monopoly, which kills free market theories, theories that USA is good at exporting with wars, but they are not able to handle and apply in the right way, as we all know, now.
February 18th, 2009 at 6:38 pm
As for Silverlight not being avaliable on whatever, when Flashed was released, how long did it take for that to be cross platform. I am using Firefox and both of the videos loaded and played fine.
Obviously the video sizes dont make this a fair fight but I think its all personal prefernece. I am a .net programmer and this semester had to take some Web Media modules. My assignment is to compare flash and silverlight, build each to show video,vector and bitmap manipulation. I will post a link when complete, but as a c#.net programmer I can see me swayed towards silverlight.
And if WPF is the future of desktop applications, I can see silverlight being the future of the web.
April 6th, 2009 at 2:24 pm
Here is a silverlight 3 app which plays Adobe Video formats (the best quality ones anyway) WITH hardware acceleration..
http://blog.domaindotnet.com/2009/04/05/silverlight_3_beta_adobe_video_playerworking_now/
Sit down.
Damon Wilder Carr
May 11th, 2009 at 10:08 pm
dfsjkdfojq
May 11th, 2009 at 10:09 pm
Flash or Silver light , whiich one is good i don’t know?
May 16th, 2009 at 12:10 pm
i think silverlight is better i saw helnix company try to provide new silvelright video players at http://www.helnix.com
June 8th, 2009 at 4:43 am
Silverlight is waaay better, even homos dont use other browsers than internet explorer anyways
September 7th, 2009 at 5:20 pm
I’m not used to Silverlight yet, but am trying to understand its basic concepts.
January 24th, 2010 at 4:20 pm
Interesting point you make, very well thought out.
January 30th, 2010 at 6:34 pm
I tried both FLASH Video and Silverlight Video players, it is much each to work with Silverlight, and when it comes to quality with slower bandwidth, Silverlight is the winner.
February 13th, 2010 at 9:04 pm
I have used Adobe flash player forever. Some sites are slow/refuse to play despite every troubleshooting measure known to man. Want to play in Silverlight. How the heck can I get them to play when I am always prompted for flash player? Can anyone help. Appreciate time. Please respond ASAP. Thanks.
March 4th, 2010 at 2:45 pm
stendak, flash and silverlight are not interchangeable. You can’t use a silverlight player to view flash content and vice versa.