Friday, January 07, 2005

Loading Video from a Database Table

While playing with Java Player class, I came to the following problem: How to feed the Player with a multimedia stream from a database table, instead of an URL or a MediaLocator. The Java Media Framework (JMF) provides the PullDataSource, but it is useful only when you extend it. So, here is my (very simple, and definitely non-perfect) implementation available for download - the InputStreamDataSource.java, with documentation. It uses my BlobImage class, and loading a media stream from a database table is as simple as:
Player player = Manager.createPlayer(
  new InputStreamDataSource(
      blobImage.load(index), blobImage.getContentType()));

Enjoy!

1 Comments:

At 5:08 AM, Blogger Shirley B. Houghton said...

Enjoyed reading the article above, really explains everything in detail,the article is very interesting and effective. Thank you and good luck for the upcoming articles. Find here a all free roblox music codes at Roblox music codes 2020

 

Post a Comment

<< Home