Migration
Migration from v2.0 to v3.0
Load the new SDK
Please follow the installation page to load the new SDK
.init()
is removed
The new SDK has an improved handshake mechanism and the .init()
function is not necessary anymore.
Changes to .bind()
and .unbind()
In order to offer an API closer to the JavaScript standards, we rename the following methods:
.bind()
is now.addEventListener()
.unbind()
is now.removeEventListener()
Changes to .command()
In order to offer a better API, we replaced the .command()
function with the following:
.command('play')
is now.play()
.command('pause')
is now.pause()
.command('destroy')
is now.destroy()
Changes to .get()
In order to offer a better API, we replaced the .get()
function with the following:
.get('currentTime')
is now.getCurrentTime()
.get('volume')
is now.getVolume()
.get('paused')
is now.isPaused()
.get('duration')
is now.getDuration()
.get('liveState')
is now.getLiveState()
.get('liveEndTime')
is now.getLiveEndTime()
.get('liveStartTime')
is now.getLiveStartTime()
Those new methods return a promise instead of requiring a callback.
Changes to .set()
In order to offer a better API, we replaced the .get()
function with the following:
.set('currentTime', value)
is now.setCurrentTime(value)
.set('volume', value)
is now.setVolume(value)