Our player

Methods

Player(config)

Item Value
Scope Constructor
Returns Akita

Parameters

Parameter Description
Object config A valid config object

Constructor - Initialises player, loads dependencies etc


load(index)

Item Value
Scope public
Returns Akita

Parameters

Parameter Description
Number index The index of the item you want to play

Loads a specific item in the schedule. The index starts at 0 for the first item.

load(3); //loads the fourth item in the schedule 

play()

Item Value
Scope public
Returns Akita

Plays the current video. This is a convenience method for playVideo event


pause()

Item Value
Scope public
Returns Akita

Pauses the current video. This is a convenience method for pauseVideo event


stop()

Item Value
Scope public
Returns Akita

Stops the current video, completely unloading it. This is a convenience method for stopVideo event


seek(timecode)

Item Value
Scope public
Returns Akita

Parameters

Parameter Description
Number timecode A timecode to seek to

Seeks the video to a timecode in seconds. This is a convenience method for seekVideo event

video.seek(10);

setVolume(level)

Item Value
Scope public
Returns Akita

Parameters

Parameter Description
Number level A url to play

Sets the volume level must be a Number between 0 and 1. This is a convenience method for setVolume event

video.setVolume(0.8);

toggleFullscreen()

Item Value
Scope public
Returns Akita

Toggles fullscreen status. This is a convenience method for toggleFullscreen event


next()

Item Value
Scope public
Returns Akita

load next item in schedule


previous()

Item Value
Scope public
Returns Akita

load previous item in schedule


disable(message)

Item Value
Scope public
Returns Akita

Parameters

Parameter Description
String message The message to be displayed to the user once the player has been disabled

Disables this instance of the player, removing all event listeners and removing the player from the dom. It will show an error message.


destroy()

Item Value
Scope public
Returns Akita

Destroys this instance of the player, removing all event listeners and removing the player from the dom


addToSchedule(item, index)

Item Value
Scope public
Returns Akita

Parameters

Parameter Description
Object item A item to add to the schedule. Must be a valid Video | Playlist object
Number index Optional The numeric index of where in the schedule you want to insert the object

Adds a valid Video | Playlist object to the schedule. By default the item is pushed onto the end, but you can specify a position by setting the index parameter.

var item = {
    object_id: '12345',
    type: 'video',
    title: 'my Video',
    description: 'my video description',
    duration: 20,
    poster_frame: 'http://s3.com/poster.png',
    uri: 'https:\/\/d3lkew8zknjt1t.cloudfront.net\/butotv\/live\/videos\/Bt5xk\/1\/NFSdb\/NFSdb_1200.mp4',
    captions: {
        cn9Cwym: {
            label: 'English captions',
            language: 'en'
        },
        cnBsjmq: {
            label: 'French captions',
            language: 'fr'
        }
    },
    overlays: {
        iafqLtj: {
            show: {
                at_end: false,
                during: {
                    start: 60,
                    end: 87
                },
                pause_video: false
            },
            title: "Free 30 Day Trial",
            description: "These in-player ads are easy to build in Buto, and deliver great click-through rates.",
            image_path: "",
            link_text: "Free Trial",
            link_action: "url",
            link_url: "http:\/\/get.buto.tv\/trial\/?ref=movie",
            link_target: "_blank",
            link_javascript_code: null,
            language: "en-GB",
            width: 100,
            height: 30,
            font_size: "medium"
        }
    }
};
video.addToSchedule(item, 1);

Properties

config

Item Value
Scope public
Returns Object

This is the config that was used for this player instance see config object


schedule

Item Value
Scope public
Returns Array

objects to play (videos|posterframes|adverts) see config object

[
    {
        object_id: '12345',
        type: 'video',
        title: 'my Video',
        description: 'my video description',
        duration: 20,
        poster_frame: 'https://myserver.com/video.png',
        uri: 'https://myserver.com/video.mp4',
        captions: {
            cn9Cwym: {
                label: 'English captions',
                language: 'en'
            },
            cnBsjmq: {
                label: 'French captions',
                language: 'fr'
            }
        },
        overlays: null
    },
    {
        object_id: '53456',
        type: 'video 2',
        title: 'my 2nd Video',
        description: 'my video description',
        duration: 20,
        poster_frame: 'https://myserver.com/video2.png',
        uri: 'https://myserver.com/video2.mp4',
        captions: {
            cn9Cwym: {
                label: 'English captions',
                language: 'en'
            },
            cnBsjmq: {
                label: 'French captions',
                language: 'fr'
            }
        },
        overlays: null
    }
]

currentScheduleItem

Item Value
Scope public
Returns Object

returns the currently loaded schedule item


bitrate

Item Value
Scope public
Returns Int

bitrate (kbps) selected by us dependant on their bandwidth


availableBitrates

Item Value
Scope public
Returns Array

allowed bitrates as selected in the control panel

[1200,800,500,360]

isFullscreen

Item Value
Scope public
Returns Boolean

Is the video fullscreen


ready

Item Value
Scope public
Returns Boolean

Is the player ready. This is when all plugins have been initialised and the bandwidth check completed


controlsDisabled

Item Value
Scope public
Returns Boolean

Is the player controls disabled


initialisedPlugins

Item Value
Scope public
Returns Array

List of plugins that have been initialised


readyPlugins

Item Value
Scope public
Returns Array

List of plugins that are ready


Events

playerInitialised

Fired on plugin being initialised


playerReady

Fired on plugin being ready to interact with


controlsDisabled

Fired on controls being disabled


controlsEnabled

Fired on controls being enabled


Listeners

disableControls

Disables the controls so you cannot seek or skip the video. You can however toggle play/pause, modify volume or toggle fullscreen


enableControls

Enables the controls