Defining a Custom Media Configuration

To create a custom media configuration you need to include some Javascript code in your publication (for details of how to do this, see Including Javascript Code). The code required varies depending on what type of media player you want to configure.

Flowplayer
WFPlayerPlugins.registerPlayerPlugin({
    name : 'configuration-name',
    type : WFMedia.type.video,
    playerPlugin : FlowplayerPluginFactory({
        your-configuration
    })
});

where:

configuration-name

is the name of your custom configuration.

your-configuration

is a JSON object containing your custom configuration parameters. For details of the structure of this object and the values it can contain, see https://flowplayer.org/docs/setup.html#configuration. Note that: video title, google analytics configuration, posterImageURL is not configurable using the custom configuration.

MediaElement.js
WFPlayerPlugins.registerPlayerPlugin({
    name : 'configuration-name',
    type : WFMedia.type.audio,
    playerPlugin : MediaElementPluginFactory({
        your-configuration
    })
});

where:

configuration-name

is the name of your custom configuration.

your-configuration

is a JSON object containing your custom configuration parameters. For details of the structure of this object and the values it can contain, see http://mediaelementjs.com/#api.

JWPlayer
WFPlayerPlugins.registerPlayerPlugin({
    name : 'configuration-name',
    type : WFMedia.type.video,
    playerPlugin : JWPlayerPluginFactory({
        your-configuration
    })
});

where:

configuration-name

is the name of your custom configuration.

your-configuration

is a JSON object containing your custom configuration parameters. For details of the structure of this object and the values it can contain, see setup options.

Example

The following example shows a configuration called custom-jwplayer-instance that sets up JWPlayer in Flash mode with a width of 50%, a specified Flash file location and a companion ad banner:

WFPlayerPlugins.registerPlayerPlugin({
    name : 'custom-jwplayer-instance',
    type : WFMedia.type.video,
    playerPlugin : JWPlayerPluginFactory({ 
       width: ‘50%’, 
       flashplayer:‘location/to/flash/file.swf’,
       adConfig : {
           comapaniondiv : {
               id : “companionBanner”,
               width : 300,
               height : 250
           }
       }
    })
});