wildside96 / bst-player

Automatically exported from code.google.com/p/bst-player
0 stars 0 forks source link

Player factory #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

Since you are using an interface for three kinds of media, do you have an 
idea on how I could automatically call the good constructor depending on 
the type of media I wish to play?

Ex.: 
if the media is a quicktime, use the QuickTime player
etc....

Should you add a factory returning the good implementation of 
AbstractMediaPlayer?

Ex.: player = PlayerFactory(String url); //analyse the url and detects the 
good constructor (QuickTime, MediaPlayer or others...)

- Erick

Original issue reported on code.google.com by eau...@gmail.com on 17 Feb 2009 at 4:18

GoogleCodeExporter commented 9 years ago
Hello,

That functionality is already available in the PlayerUtil class in the
com.bramosystems.gwt.player.client package.

It's as simple as ...

player = PlayerUtil.getPlayer(url, autoplay, height, width);

The method returns a suitable player depending on the plugin available on the 
client
and ability to handle the specified media.

You may want to check the API docs details.

Original comment by sbrah...@gmail.com on 18 Feb 2009 at 10:53

GoogleCodeExporter commented 9 years ago

Original comment by sbrah...@gmail.com on 18 Feb 2009 at 1:24