Vimeo Player Provider

The Vimeo Player Provider provides widgets to embed Vimeo videos in GWT applications.

GWT Module Inheritance / Provider Name

Add the following line to your GWT XML application module file to include the player provider in your application:

<inherits name="com.bramosystems.oss.player.provider.vimeo.VimeoPlayerProvider" />

The provider is registered with the API as "bst.vimeo"

Version Dependency Matrix

The following table lists the minimum version of the package dependencies required by the player provider:

Vimeo Player Provider version BST Player API version GWT version
2.0 2.0.2 2.2

Provided player widgets

The following table lists all player widgets available with the player provider package, the supported plugin and the minimum plugin version required on the browser.

Player Widget Provider Name Media Plugin Minimum plugin version
VimeoFlashPlayer FlashPlayer Flash® Player plugin 10.0
VimeoUniversalPlayer UniversalPlayer HTML5 Browser -

All the player widgets class resides in the com.bramosystems.oss.player.provider.vimeo.client package.

Working with the player widgets

The VimeoFlashPlayer widget wraps the basic Vimeo Flash video player and can be used as follows:

SimplePanel panel = new SimplePanel();   // create panel to hold the player
AbstractMediaPlayer player = null;
try {
    // create the player, specifing URL of media
    player = new VimeoFlashPlayer("video-id", false, "width", "height");
    panel.setWidget(player); // add player to panel.
} catch(PluginVersionException e) {
    // required Flash plugin version is not available,
    // alert user possibly providing a link to the plugin download page.
    panel.setWidget(new HTML(".. some nice message telling the " +
        "user to download plugin first .."));
} catch(PluginNotFoundException e) {
    // required Flash plugin not found, display a friendly notice.
    panel.setWidget(PlayerUtil.getMissingPluginNotice(e.getPlugin()));
}

The VimeoUniversalPlayer widget provides the Vimeo player using the latest Universal Embed code which provides improved support for both desktop, mobile and touch-based devices. However, this will only work on HTML5-compliant environments.

The following is an example:

SimplePanel panel = new SimplePanel();   // create panel to hold the player
AbstractMediaPlayer player = null;
try {
    // create the player, specifing URL of media
    player = new VimeoUniversalPlayer("video-id", false, "100%", "350px");
    panel.setWidget(player); // add player to panel.
} catch(PluginVersionException e) {
    // not thrown for now.  Only provided for Base API support...
} catch(PluginNotFoundException e) {
    // browser is not HTML5 compliant ..
    panel.setWidget(PlayerUtil.getMissingPluginNotice(e.getPlugin()));
}

All the widgets can also be used with the Base API utility methods as follows:

SimplePanel panel = new SimplePanel();   // create panel to hold the player
AbstractMediaPlayer player = null;
try {
    // retrieve the basic information about the VimeoUniversalPlayer as registered with the API
    // using the provider name and the player name
    PlayerInfo pi = PlayerUtil.getPlayerInfo("bst.vimeo", "UniversalPlayer");

    // create the player, using the PlayerInfo object and specifing URL of media
    player = PlayerUtil.getPlayer(pi, "video-id", false, "width", "height");
    panel.setWidget(player); // add player to panel.
} catch(PluginVersionException e) {
    // required plugin version is not available, alert user
    panel.setWidget(PlayerUtil.getMissingPluginNotice(e.getPlugin(), 
            e.getRequiredVersion()));
} catch(PluginNotFoundException e) {
    // catch PluginNotFoundException and display a friendly notice.
    panel.setWidget(PlayerUtil.getMissingPluginNotice(e.getPlugin));
}