Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

JW Embedder Modes

The JW Embedder is a powerful new addition to the JW Player toolkit. It drastically simplifies the process of embedding video and ensures that your content is viewable on as many devices as possible.

Modes

The JW Embedder currently offers 3 modes:

The player can only run in one mode at a time, and certain features (including plugins, skins, and the JavaScript API) are disabled in download mode. For more information on how the Embedder selects a mode, see the Mode Selection Algorithm section below.

Setting Mode Order

By default, the JW Embedder will check to see if your configuration is playable in Flash, then HTML5, and finally the Download mode. However, you can change that order by adding the modes parameter to your configuration, like so:

Note - Don't set the flashplayer property if you're using the modes block. Instead, set the src attribute of the element flash type with the path to the Flash player.

Because each mode is checked in order, you'll need to specify modes in terms of an array. Each object in the array must have a type, which corresponds to either flash, html5, or download.

Specifying an Alternate Configuration for a Mode

A situation may arise where you'd like to use a different configuration for each mode. For example, you may want to use Flash with RTMP by default, but fall back to an mp4 when in HTML5 or download mode. This can be done by setting the config attribute of any mode in the modes block, like so:

The embedder will then merge these values with your "default" configuration when embedding, with the mode specific configuration getting precedence.

Mode Selection Algorithm

The JW Embedder's mode selection algorithm is the brain of the embedder. It checks each mode (either in the default order, or in the order you specify) to see if the configuration you've provided can be played in that mode on your device. If no mode supports your configuration, the Embedder will leave the original HTML in place.

To determine if a given mode is playable, the Embedder looks at:

To determine if your file can be played in a specific mode, follow the decision trees below:

Flash

  1. Does the browser support Flash? If no, don't use Flash. If yes, move to 2.
  2. Is the provider option set? If yes, use Flash. If no, move to 3.
  3. Is a supported file extension detected? If yes, use Flash. If no, don't use Flash.

Supported extensions

3g2, 3gp, aac, f4a, f4v, flv, gif, jpg, m4a, m4v, mov (h.264), mp3, mp4, png

Supported providers

All

HTML5

  1. Is the provider option set? If no, move to 3. If yes, move to 2.
  2. Is the provider supported? If so, move to 3. If no, don't use HTML5.
  3. Is a supported file extension detected? If yes, go to 4. If no, don't use HTML5.
  4. Can the current browser play this file (canPlayType)? If yes, use HTML5. If no, don't use HTML5.

Supported extensions

Supported providers

video, http, and YouTube

Download

  1. Is the provider option set? If yes, move to 2. If no, use Download.
  2. Is the provider option supported? If yes, use Download. If not, don't use Download.

Supported extensions

All

Supported providers

Video, http, image, sound, and YouTube