Home Reference Source Repository
import Player from 'blitzr-js-sdk/src/player.js'
public class | source

Player

Player provides methods to control playlist

Constructor Summary

Public Constructor
public

constructor(-: string, options: object)

Create an instance Player

Member Summary

Public Members
public get

currentTime: float: *

get volume

public get

duration: float: *

get duration

public set

volume(volume: number): *

set volume

public get

get volume

Method Summary

Public Methods
public

load(track: string)

Load a track by uuid and play the track

public

pause()

pause the current track

public

play()

play the current track

public

seekTo(time: number)

play the current track at the given time

public

stop()

stop the current track

Public Constructors

public constructor(-: string, options: object) source

Create an instance Player

Params:

NameTypeAttributeDescription
- string

id of DOM element

options object
  • optional
  • default: defaultOptions

options

See:

Public Members

public get currentTime: float: * source

get volume

Return:

float

in seconds

public get duration: float: * source

get duration

Return:

float

in seconds

public set volume(volume: number): * source

set volume

public get volume: number: * source

get volume

Return:

number

in percentage

Public Methods

public load(track: string) source

Load a track by uuid and play the track

Params:

NameTypeAttributeDescription
track string

uuid of the track

public pause() source

pause the current track

public play() source

play the current track

public seekTo(time: number) source

play the current track at the given time

Params:

NameTypeAttributeDescription
time number

in second

public stop() source

stop the current track