debug

The debug plugin displays some overlays on top of the video.
Among other things, it’ll display the player version, playback engine, measured bandwidth and chosen representation.
This plugin will initialize itself automatically if debug querystring param exists in URL.
The value of the debug querystring will determine which tab is initially displayed (see defaultTab).

Init Options

options : object

Initialization options for the debug plugin.

options.defaultTab : string
property

The default tab which will be initially displayed.
You can also set this via the debug querystring’s value.

Default: "player"
See: switchTab
Example

// playerOptions.json
{
    "plugins": {
        "debug": {
            "defaultTab": "consolay"
        }
    }
}

options.extra : string
property

An extra string to be displayed on the top right hand corner.

Default: "null"
See: setExtra
Example

// playerOptions.json
{
    "plugins": {
        "debug": {
            "extra": "MyApp v1.2.3"
        }
    }
}

options.visible : boolean
property

The initial visibility of the debug plugin.

Default: true
See: toggle
Example

// playerOptions.json
{
    "plugins": {
        "debug": {
            "visible": false
        }
    }
}

Properties

player.debug.version : string
propertyreadonly

The debug plugin’s version string.

Example

console.log('The debug plugin version is', player.debug.version);

Methods

player.debug.addTab(name, contents, [options])
method

Add another tab to the debug plugin.

Param Type Description
name string The tab’s name.
contents Element | string The contents of the tab. Could be a DOM element or a string which will become the innerHTML of an element.
[options] object An options object.
[options.title] string The title of the tab.

Example

// Wait for debug plugin to be initialized before adding our tab
player.pluginInited('debug').then(() => {
    player.debug.addTab('mytab', myContentDiv, { title: 'MyTab' });
});

player.debug.getTabContents(name) ⇒ Element
method

Get a reference to a tab contents DOM element.

Returns: Element - The tab contents DOM element.

Param Type Description
name string The tab’s name.

Example

var myContentDiv = player.debug.getTabContents('mytab');

player.debug.switchTab(name)
method

Switch to another tab.

Param Type Description
name string The tab’s name. Special values ‘next’ and ‘prev’ are also supported.

Example

player.debug.switchTab('player');

player.debug.setExtra(label)
method

Set a string label on the bottom right hand corner.
Each call will override previous label.

Param Type Description
label string A string to be displayed on the bottom right hand corner.

Example

player.debug.setExtra('MyApp v1.2.3');

player.debug.toggle()
method

Toggle the visibility of debug overlays.
Pressing the ~ key will invoke this function.

Example

player.debug.toggle();
Rate this page: X
Tell us more!