Migrating from version 0.6

The following improvements on version 0.6 may require minor tweaks to existing code. Such changes however, should only take a few minutes to rectify.

Code Refactoring

The library is now split into different modules consisting of:

  • com.bramosystems.oss.player.core.Core - The core classes of the API (including the base player widgets)
  • com.bramosystems.oss.player.core.event.Event - The new event classes (inherited by the Core module)
  • com.bramosystems.oss.player.capsule.Capsule - The sample custom sound player (inherits the Core module)
  • com.bramosystems.oss.player.flat.FlatVideoPlayer - The sample custom video player (inherits the Core module)

Consequently, existing codes that inherits the com.bramosystems.gwt.player.BSTPlayer module will now need to inherit:

com.bramosystems.oss.player.core.Core - if using only the base player widgets (such as WinMediaPlayer, QuickTimePlayer etc)

com.bramosystems.oss.player.capsule.Capsule - if using the sample custom sound player

com.bramosystems.oss.player.flat.FlatVideoPlayer - if using the sample custom video player

New Event Handlers

GWT 1.6 introduced a new EventHandler system which makes the development of complex, decoupled applications easier. Inline with this, the MediaStateListener class has been replaced with the following handlers in the com.bramosystems.oss.player.core.event.client package:

PlayerStateHandler handles events that are fired when the state of the player changes
PlayStateHandler handles events that are fired when the state of media playback changes
MediaInfoHandler handles MediaInfoEvent fired whenever media metadata is available
LoadingProgressHandler handles events that are fired when the progress of a loading media changes
DebugHandler handles events that are fired when info/error level messages are generated by the embedded plugin

Also, VolumeChangeListener used for volume control is replaced with VolumeChangeHandler, while SeekChangeListener used for seek controls is replaced with SeekChangeHandler.

Existing codes that use:

player.addMediaStateListener{ new MediaStateListener() {
...
}};
                

will now need to do:

player.addPlayerStateHandler { new PlayerStateHandler() {
    // if interested in player state changes
}};
player.addPlayStateHandler { new PlayStateHandler() {
    // if interested in play state changes
}};

etc...
                

Please check the API for details.

New FlashMediaPlayer

The FlashMP3Player and FlashVideoPlayer widgets has been removed in favour of FlashMediaPlayer widget. The new widget is designed to handle all media types supported by the Adobe Flash player including MP3 sound, FLV video and MP4 sound/video.

New CustomPlayerControl widget

The FlatCustomControl widget has been replaced with the new CustomPlayerControl widget. The widget provides a simple player UI with play/pause/stop buttons as well as a seekbar to control the supported media plugins.