I’m going to write a custom multimedia player. It will be embedded into a web-browser and will receive data from a server over SSL connection.
Required functionality is:
- MPEG4 video and different VoIP audio decoding (e.g. G.711 or G.729)
- custom controls
- waveform representation (or just flexible drawing API)
I think about Adobe Flash (or Flex). But I know little about this technology. My biggest concern is multimedia decoding.
Can you recommend Adobe Flex or anything else for this project? What pitfalls can I expect on this way?
EDIT:
Flash Player doesn’t support MPEG4 or VoIP audio codecs. So to use Flash I need to setup multimedia streaming server and transcode my media to supported formats (H.264/AAC). It’s much more costly solution than I expected.
What alternatives should I review? Java applet? ActiveX? Windows Media Player?
Well, you could possibly do this using Silverlight; Silverlight has interfaces that allow you to give it raw H.264 frames and it will display them. In fact, netflix’s online streaming video player is written in silverlight. If that will work, it may be your best bet.
If that doesn’t work, and Flash won’t do it, then you could possibly try java (don’t know enough to know if that would be doable or not, but my guess is that the lack of java on many client machines would be a barrier) or write your own plugin/activex control.
The primary challenge with an ActiveX control, aside from the heavy learning curve, is that you have to somehow install it on client machines. This is even more tricky when you’re talking about a media player, because then you’ll probably need to deal with sound drivers and video rendering; to render high quality video you’ll want to use hardware acceleration, which means directx and/or opengl, assuming you’re targetting windows. Also, an ActiveX control only works on IE, not on any of the other web browsers.
However, if you do choose to go the plugin/activex route, I highly recommend that you look at FireBreath; FireBreath is a browser plugin framework and abstraction for writing cross platform and cross-browser plugins. Flash and Silverlight are themselves activex controls and npapi plugins, and I know of at least two media players written using FireBreath specifically. This is going to be the easiest way to approach the problem from a plugin perspective, but you will have to use C++. don’t get me wrong — this isn’t an easy task even with FireBreath, but at least it solves a lot of the trickiest parts of being hosted in a browser.
The main advantage of a plugin is that you can do pretty much anything — use hardware rendering, access the filesystem, etc. It is the most flexible option. The main disadvantage of a plugin is that you can do pretty much anything — crash the browser, delete files, open up security holes if you aren’t careful, etc.
I suppose the final option would be to use ajax requests, do the decoding in javascript, and render to a web canvas in Chrome, but I’m guessing that’s still not very realistic =]
Good luck, hope that helps.