Thursday, February 17, 2011

Re: Streaming Player API – Bringing the Big Screen to the Small Screen

It’s out, folks – the Streaming Player API has now been published with full source code!

During the BlackBerry Developer Conference in 2009, I hosted a session where we discussed the best practices for developing Media Streaming applications. I want to give a big round of thanks to all the participants for sharing their stories – you really helped me to come up with an open source API module for streaming audio and video that simply works out of the box! Sample code or API, whatever you’d like to call it – the central idea was to provide you with something that was as simple as saying “play this URL over HTTP” or “seek to 2:20.”

The StreamingPlayer class is the starting point of this API. It does all the heavy lifting related to implementing a DataSource and a SourceStream, managing a ring buffer, synchronizing playback, download and user action threads, and last but not least, handle OS and user-initiated seek calls in an efficient way by fully considering the limitations of HTTP streams.

On top of the features mentioned above, the API also has enough public methods and constants for all you adventurers out there. A StreamingPlayerListener interface can notify an application about every streaming event you will ever need, as well as a mechanism (my favorite) to preprocess each chunk of downloaded data before it’s sent to the underlying Player. This preprocessing should be useful for decrypting encrypted content, or if you would like to parse meta information from the raw stream.

I welcome everybody to join me in making this a success by providing your valuable feedback and comments. A Knowledge Base article, Streaming media – Start to finish, has already been published; you can read more about it and download the code there. If you have any questions, feel free to point and shoot at me but do not hesitate to submit any issues or feature requests in the BlackBerry® Issue Tracker. I will be following the issue tracker on a daily basis.

Until next time, happy streaming!


View the original article here

No comments:

Post a Comment