Requests and commands


To control the player and requests via Javascript, use the apioperator
var player = new Playerjs({...});
console.log(player.api("id"));
player.api("play");
For some commands you can specify a parameter
player.api("play","URL");

Command Parameter Action Return
play - starting playback* -
play URL, playlist or id: starting playback of new source* false or true for id:
pause - pause playback -
toggle - toggle playback -
stop - stop playback -
mute - mute sound -
unmute - unmute sound -
seek time in seconds seek (after starting) -
fullscreen - go to full screen mode** -
exitfullscreen - exit from full screen mode -
isfullscreen - - true or false
playing - - true or false
started - - true or false
time - - current time of playback
duration - - duration in seconds
muted - - true or false
volume nothing or volume level the command returns the volume level or sets the value (from 0 to 1)
volume level (from 0 to 1)
quality - - current quality
audiotrack - - current audiotrack
id - - id of the player container
log - - debug log
screenshot - takes a screenshot false or base64
subtitle URL launching subtitle from the source -
poster URL displays the poster if the player is paused true or false
title text or nothing displays the title if there is such element enabled player.api("title","text"), or return current value  player.api("title") true or title value
playlist object [ ] or url updates playlist  true or false
playlist_id - return id of the played track from playlist id
playlist_title - return title of the played track from playlist title
find file id open track from playlist by id and wait of the starting true or false
scale transformation step, or format changes the video scale (floating-point number) or aspect ratio for incorrectly encoded video (width:height, for example 4:3 or 16:9)
-
showplaylist - show playlist -
visibility - - precent of the player visibility
hlserror
dasherror
- - object error for HLS / DASH
hls
dash
- - object hls.js or dash.js (direct access to the plugin)
* you can add the option seek player.api("play","url[seek:10]"); to start with the desired second. First launching on mobile with sound works only after the user gestures.

** on all platforms only due to user actions

The API is in a constant development process, if you have something missing - write to us via feedback.

More: How to get the players events


2018 © Binom LLC

Login

Restore password
Sign up
Log in

Sign up free

Sign up
By signing up, you agree to Terms of Service
Login if you have an account

Restore password

Restore
Forgot email? Contact us