For more information, see detailed documentation available at player.js website.
Quickstart
After loading the library and embedding the Player iframe, you can create a player object and interact with it using various events and methods. The following example illustrates the basic usage:Methods
The Bunny Stream Player provides the following methods for controlling playback:play: void - Play the media. Example:
pause: void - Pause the media. Example:
getPaused: boolean - Determine if the media is paused. Example:
mute: void - Mute the media. Example:
unmute: void - Unmute the media. Example:
getMuted: boolean - Determine if the media is muted. Example:
setVolume: void - Set the volume. Value needs to be between 0-100. Example:
getVolume: number - Get the volume. Value will be between 0-100. Example:
getDuration: number - Get the duration of the media is seconds. Example:
setCurrentTime: number - Perform a seek to a particular time in seconds. Example:
getCurrentTime: number - Get the current time in seconds of the video. Example:
on: void - Add an event listener. Example:
supports: [‘method’, ‘event’], methodOrEventName - Determines if the player supports a given event or method. Example:
timeupdate - Fires during playback. Example:
play- Fires when the video starts to play.
pause- Fires when the video is paused.
ended- Fires when the video is finished.
seeked - Fires when the video has been seeked by the user.
error - Fires when an error occurs.