Silverlight vs Flash: Passing Query String / Parameters My First Flash Ecard
Nov 27

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~

Vote for this sample

Flash is Better? (248 votes)
Silverlight is Better! (301 votes)

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

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)
{

}

Related Post

20 Responses to “Flash vs Silverlight: Media / Video Player”

  1. John Says:

    Cool review. Silverlight is really much better than flash

  2. Ako Says:

    Flash is much better, silverlight doesn’t work at all (linux/firefox)

  3. Jonako Says:

    Silverlight might be better, but Flash works in linux/firefox. Hence Silverlight must DIE.

  4. Ayman Says:

    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

  5. Lawrence Says:

    Its amazing how many flash supporters remain in denial. Ayman what you decribe as upcoming benefits of flash were already achieved in Silverlight beta1.

  6. Remco Says:

    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!)

  7. Levi Says:

    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.

  8. admin Says:

    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.

  9. Nariman Says:

    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

  10. media player | Dell.com Says:

    [...] 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) [...]

  11. NetNan Says:

    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)…

  12. Silverlights_Cool Says:

    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.

  13. Nick Says:

    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.

  14. JT Says:

    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.

  15. Rylese Says:

    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.

  16. Damon Carr Says:

    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

  17. sdsdjj Says:

    dfsjkdfojq

  18. Manoj Limbachiya Says:

    Flash or Silver light , whiich one is good i don’t know?

  19. john Says:

    i think silverlight is better i saw helnix company try to provide new silvelright video players at http://www.helnix.com

  20. derka Says:

    Silverlight is waaay better, even homos dont use other browsers than internet explorer anyways

Leave a Reply