Skip to main content

JavaScript API

JavaScript API

A reference of the API for creating and controlling Songle Widgets from JavaScript.

window​

onSongleWidgetCreate​

Executed when a DOM element of a Songle Widget is instantiated. (The method needs to be defined prior to loading Songle Widget library.)

Status code (Type:Number)Explanation
-This status code is reserved for future usage.
window.onSongleWidgetCreate =
function(apiKey, songleWidget)
{
console.log("status: " + songleWidget.status);
}

onSongleWidgetError​

Executed when a Songle Widget fails to initialize. (The method needs to be defined prior to loading Songle Widget library.)

Status code (Type:Number)Explanation
100Original song is deleted and could not be embedded.
101Original song is not allowed to be embedded in an external website.
200Music structure loading has been suspended.
201Music structure could not be loaded.
window.onSongleWidgetError =
function(apiKey, songleWidget)
{
console.log("status: " + songleWidget.status);
}

onSongleWidgetReady​

Executed when a Songle Widget has been successfully initialized. (The method needs to be defined prior to loading Songle Widget library.)

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
console.log("Hello,Songle Widget!!");
}

onSongleWidgetReload​

TBD

window.onSongleWidgetReload =
function(apiKey, songleWidget)
{
console.log("Songle Widget was reloaded!!");
}

onSongleWidgetRemove​

TBD

window.onSongleWidgetRemove =
function(apiKey, songleWidget)
{
console.log("Songle Widget was removed!!");
}

SongleWidget​

dataset.api​

Returns the value of data-api provided to embed code.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
console.log(songleWidget.dataset.api);
}

dataset.url​

Returns the value of data-url provided to embed code.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
console.log(songleWidget.dataset.url);
}

mode​

Returns the execution mode.

Execution mode (Type:String)Explanation
mp3Music player mode
nn-videoVideo player mode (Niconico video)
yt-videoVideo player mode (YouTube)
window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
switch(songleWidget.mode)
{
case SongleWidgetAPI.MP3_MODE: // "mp3"
console.log("Songle Widget is mp3 mode.");
break;

case SongleWidgetAPI.NN_VIDEO_MODE: // "nn-video"
console.log("Songle Widget is nn-video mode.");
break;

case SongleWidgetAPI.YT_VIDEO_MODE: // "yt-video"
console.log("Songle Widget is yt-video mode.");
break;
}
}

uuid​

Returns the UUID of the Songle Widget.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
console.log(songleWidget.uuid);
}

videoID​

Returns the video ID. (only available when hosting Niconico and YouTube videos)

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
console.log(songleWidget.videoID);
}

rootElement​

TBD

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
console.log(songleWidget.rootElement);
}

isPlaying​

Returns true when the status is playing.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
setInterval(
function()
{
if(songleWidget.isPlaying)
console.log("Songle Widget is playing now.");
}
, 1000 / 30); // 30 [FPS]
}

isPaused​

Returns true when the status is paused.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
setInterval(
function()
{
if(songleWidget.isPaused)
console.log("Songle Widget is paused now.");
}
, 1000 / 30); // 30 [FPS]
}

isStopped​

Returns true when the status is stopped.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
setInterval(
function()
{
if(songleWidget.isStopped)
console.log("Songle Widget is stopped now.");
}
, 1000 / 30); // 30 [FPS]
}

isSeeking​

Returns true when the status is seeking.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
setInterval(
function()
{
if(songleWidget.isSeeking)
console.log("Songle Widget is seeking now.");
}
, 1000 / 30); // 30 [FPS]
}

bpm​

Returns the current tempo.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
setInterval(
function()
{
console.log(songleWidget.bpm + " [bpm]");
}
, 1000 / 30); // 30 [FPS]
}

currentBeat​

Returns the current pulse.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
setInterval(
function()
{
console.log(songleWidget.currentBeat);
}
, 1000 / 30); // 30 [FPS]
}

currentChord​

Returns the current chord.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
setInterval(
function()
{
console.log(songleWidget.currentChord);
}
, 1000 / 30); // 30 [FPS]
}

currentNote​

Returns the current note.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
setInterval(
function()
{
console.log(songleWidget.currentNote);
}
, 1000 / 30); // 30 [FPS]
}

currentChorusSegment​

Returns the current chorus (highlighted in orange). This property is also available via the currentChorus alias.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
setInterval(
function()
{
console.log(songleWidget.currentChorusSegment);
}
, 1000 / 30); // 30 [FPS]
}

currentRepeatSegment​

Returns the current repeating segment (highlighted in orange or blue). This property is also available via the currentRepeat alias.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
setInterval(
function()
{
console.log(songleWidget.currentRepeatSegment);
}
, 1000 / 30); // 30 [FPS]
}

isPlayingChorusSegment​

Returns true if the chorus part is being played. This property is also available via the isPlayingChorus alias.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
setInterval(
function()
{
console.log(songleWidget.isPlayingChorusSegment);
}
, 1000 / 30); // 30 [FPS]
}

isPlayingRepeatSegment​

Returns true if the repeating segment is being played. This property is also available via the isPlayingRepeat alias.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
setInterval(
function()
{
console.log(songleWidget.isPlayingRepeatSegment);
}
, 1000 / 30); // 30 [FPS]
}

duration​

Returns the duration of the music.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
setInterval(
function()
{
console.log(songleWidget.duration.milliseconds + " [ms]");
console.log(songleWidget.duration.seconds + " [sec]");
console.log(songleWidget.duration.minutes + " [min]");
}
, 1000 / 30); // 30 [FPS]
}

position​

Returns the current playback position of the music.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
setInterval(
function()
{
console.log(songleWidget.position.milliseconds + " [ms]");
console.log(songleWidget.position.seconds + " [sec]");
console.log(songleWidget.position.minutes + " [min]");
}
, 1000 / 30); // 30 [FPS]
}

loadedRatio​

Returns the proportion of music being loaded. [0 to 1]

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
setInterval(
function()
{
console.log(songleWidget.loadedRatio * 100 + " [%]");
}
, 1000 / 30); // 30 [FPS]
}

playedRatio​

Returns the proportion of music being played.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
setInterval(
function()
{
console.log(songleWidget.playedRatio * 100 + " [%]");
}
, 1000 / 30); // 30 [FPS]
}

volume​

Returns the current volume; set the volume.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.volume = SongleWidgetAPI.MIN_VOLUME; // Min volume.

songleWidget.volume = SongleWidgetAPI.MAX_VOLUME; // Max volume.

songleWidget.volume *= 0.9; // - 10 [%]

songleWidget.volume *= 1.1; // + 10 [%]
}

song​

Returns the music structure.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
/*
[...].song.url

[...].song.id
[...].song.title
[...].song.permalink
[...].song.duration
[...].song.position
[...].song.rmsAmplitude

[...].song.artist.id
[...].song.artist.name

[...].song.scene.beats
[...].song.scene.beats[ beatIndex ].index
[...].song.scene.beats[ beatIndex ].start
[...].song.scene.beats[ beatIndex ].position

[...].song.scene.chords
[...].song.scene.chords[ chordIndex ].index
[...].song.scene.chords[ chordIndex ].start
[...].song.scene.chords[ chordIndex ].duration
[...].song.scene.chords[ chordIndex ].name

[...].song.scene.notes
[...].song.scene.notes[ noteIndex ].index
[...].song.scene.notes[ noteIndex ].start
[...].song.scene.notes[ noteIndex ].duration
[...].song.scene.notes[ noteIndex ].pitch
[...].song.scene.notes[ noteIndex ].number

[...].song.scene.chorusSegments
[...].song.scene.chorusSegments[ chorusSegmentIndex ].index
[...].song.scene.chorusSegments[ chorusSegmentIndex ].duration
[...].song.scene.chorusSegments[ chorusSegmentIndex ].repeats
[...].song.scene.chorusSegments[ chorusSegmentIndex ].repeats[ repeatIndex ].index
[...].song.scene.chorusSegments[ chorusSegmentIndex ].repeats[ repeatIndex ].start
[...].song.scene.chorusSegments[ chorusSegmentIndex ].repeats[ repeatIndex ].duration

[...].song.scene.repeatSegments
[...].song.scene.repeatSegments[ repeatSegmentIndex ].index
[...].song.scene.repeatSegments[ repeatSegmentIndex ].duration
[...].song.scene.repeatSegments[ repeatSegmentIndex ].repeats
[...].song.scene.repeatSegments[ repeatSegmentIndex ].repeats[ repeatIndex ].index
[...].song.scene.repeatSegments[ repeatSegmentIndex ].repeats[ repeatIndex ].start
[...].song.scene.repeatSegments[ repeatSegmentIndex ].repeats[ repeatIndex ].duration
*/
console.log(songleWidget.song);
}

eventPollingInterval​

Callback functions sometimes fail to be called in a timely manner. This typically happens when there are too many beats (pulses) in a short amount of time. Shortening the polling interval (default 200 milliseconds) could potentially solve the issue.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.eventPollingInterval = 1; // 1 [ms]
}

beatEventPriority​

Specifies the priority of event detection for beats (pulses). The default value is 3. Setting a larger value results in the higher priority.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.beatEventPriority = 3;
}

beatEventTimingOffset​

Specifies the timing offset for calling beat (pulse) event callbacks. The default value is -175 milliseconds.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.beatEventTimingOffset = -175; // -175 [ms]
}

chordEventPriority​

Specifies the priority of event detection for chords. The default value is 2. Setting a larger value results in the higher priority.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.chordEventPriority = 2;
}

chordEventTimingOffset​

Specifies the timing offset for calling chord event callbacks. The default value is -175 milliseconds.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.chordEventTimingOffset = -175; // -175 [ms]
}

noteEventPriority​

Specifies the priority of event detection for melodies. The default value is 1. Setting a larger value results in the higher priority.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.noteEventPriority = 1;
}

noteEventTimingOffset​

Specifies the timing offset for calling melody event callbacks. The default value is -175 milliseconds.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.noteEventTimingOffset = -175; // -175 [ms]
}

chorusSegmentEventPriority​

Specifies the priority of event detection for chorus parts (highlighted in orange). The default value is 5. Setting a larger value results in the higher priority.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.chorusSegmentEventPriority = 5;
}

chorusSegmentEventTimingOffset​

Specifies the timing offset for calling chorus part (highlighted in orange) event callbacks. The default value is -175 milliseconds.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.chorusSegmentEventTimingOffset = -175; // -175 [ms]
}

repeatSegmentEventPriority​

Specifies the priority of event detection for repeating segments. The default value is 4. Setting a larger value results in the higher priority.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.repeatSegmentEventPriority = 4;
}

repeatSegmentEventTimingOffset​

Specifies the timing offset for calling repeating segment event callbacks. The default value is -175 milliseconds.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.repeatSegmentEventTimingOffset = -175; // -175 [ms]
}

on(trapName, trapFunction, options)​

Bind an event listener to the specified event type.

Event (Type:String)Synonym (Type:String)Explanation
beatEnterbeatPlayCalled at the beginning of a beat (pulse).
beatLeave-Called at the end of a beat (pulse).
chordEnterchordPlayCalled at the beginning of a chord event.
chordLeave-Called at the end of a chord event.
noteEnternotePlayCalled at the beginning of a melody event.
noteLeave-Called at the end of a melody event.
chorusSegmentEnterchorusEnterCalled at the beginning of a chorus part highlighted in orange.
chorusSegmentLeavechorusLeaveCalled at the end of a chorus part highlighted in orange.
repeatSegmentEnterrepeatEnterCalled at the beginning of a repeat segment highlighted in orange or blue.
repeatSegmentLeaverepeatLeaveCalled at the end of a repeat segment highlighted in orange or blue.
reload-Called when the music structure information is updated.
remove-Called when the music structure information is deleted.
play-Called when the playback begins.
pause-Called when the playback is paused.
stop-Called when the playback is stopped.
seek-Called when the playback position is changed.
loadingProgress-Called when there is a progress in loading the music or video.
playingProgress-Called when there is a progress in playing the music or video.
finish-Called when the playback reaches the end.
window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.on("beatPlay",
function(e)
{
/*
[...].beat.prev.index
[...].beat.prev.start
[...].beat.prev.position

[...].beat.index
[...].beat.start
[...].beat.position

[...].beat.next.index
[...].beat.next.start
[...].beat.next.position
*/
console.log(e);
});

songleWidget.on("chordPlay",
function(e)
{
/*
[...].chord.prev.index
[...].chord.prev.start
[...].chord.prev.duration
[...].chord.prev.name

[...].chord.index
[...].chord.start
[...].chord.duration
[...].chord.name

[...].chord.next.index
[...].chord.next.start
[...].chord.next.duration
[...].chord.next.name
*/
console.log(e);
});

songleWidget.on("notePlay",
function(e)
{
/*
[...].note.prev.index
[...].note.prev.start
[...].note.prev.duration
[...].note.prev.pitch
[...].note.prev.number

[...].note.index
[...].note.start
[...].note.duration
[...].note.pitch
[...].note.number

[...].note.next.index
[...].note.next.start
[...].note.next.duration
[...].note.next.pitch
[...].note.next.number
*/
console.log(e);
});

songleWidget.on("chorusEnter",
function(e)
{
/*
[...].repeat.index
[...].repeat.start
[...].repeat.duration

[...].segment.index
[...].segment.duration
*/
console.log(e);
});

songleWidget.on("repeatEnter",
function(e)
{
/*
[...].repeat.index
[...].repeat.start
[...].repeat.duration

[...].segment.index
[...].segment.duration
*/
console.log(e);
});
}

off(trapName)​

Removes an event listener for the specified event type.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.off("beatPlay");

songleWidget.off("chordPlay");

songleWidget.off("notePlay");

songleWidget.off("chorusEnter");

songleWidget.off("repeatEnter");
}

play()​

Start playing the music or video.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.play();
}

pause()​

Pause playing the music or video.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.pause();
}

stop()​

Stop playing the music or video.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.stop();
}

seekTo(milliseconds)​

Moves the current playback position to the specified time.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.seekTo(SongleWidgetAPI.secondsToMilliseconds(30)); // Seek to 30 seconds.
}

seekToPrevChorus()​

Moves the current playback position to the beginning of the previous closest chorus part.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.seekToPrevChorus();
}

seekToNextChorus()​

Moves the current playback position to the beginning of the next closest chorus part.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.seekToNextChorus();
}

seekToPrevRepeat()​

Moves the current playback position to the beginning of the previous closest repeat segment.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.seekToPrevRepeat();
}

seekToNextRepeat()​

Moves the current playback position to the beginning of the next closest repeat segment.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.seekToNextRepeat();
}

setAllEventTimingOffset(milliseconds)​

Specifies the timing offset for calling all event callbacks. The default value is -175 milliseconds.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.setAllEventTimingOffset(-175); // -175 [ms]
}

serialize​

Serializes the music structure.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.serialize();
}

remove()​

Removes the Songle Widget and releases all resources allocated for the widget.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.remove();
}

SongleWidgetAPI​

DEFAULT_SONGLE_WIDGET_SIZE_W​

TBD

DEFAULT_SONGLE_WIDGET_SIZE_H​

TBD

DEFAULT_VIDEO_PLAYER_SIZE_W​

TBD

DEFAULT_VIDEO_PLAYER_SIZE_H​

TBD

MIN_SONGLE_WIDGET_SIZE_W​

TBD

MIN_SONGLE_WIDGET_SIZE_H​

TBD

MIN_VIDEO_PLAYER_SIZE_W​

TBD

MIN_VIDEO_PLAYER_SIZE_H​

TBD

MIN_VOLUME​

TBD

MAX_VOLUME​

TBD

MP3_MODE​

TBD

NN_VIDEO_MODE​

TBD

YT_VIDEO_MODE​

TBD

SOURCE_SONGLE_WIDGET​

TBD

SOURCE_MP3​

TBD

SOURCE_NN_VIDEO​

TBD

SOURCE_YT_VIDEO​

TBD

computeAverageVolume(songleWidget)​

Calculate the average volume of the song.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
songleWidget.volume = SongleWidgetAPI.computeAverageVolume(songleWidget);
}

computeOffsetFromRepeatSegmentBy(songleWidget, options)​

Calculate the offset time in milliseconds before the specified repeat segment.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
var offset =
SongleWidgetAPI.computeOffsetFromRepeatSegmentBy(songleWidget, {
beatCount: 4,
repeatSegmentIndex: 0
}); // e.g. 1600 [ms]

songleWidget.on("chorusEnter",
function()
{
}, { offset: offset });
}

createSongleWidgetElement(options)​

Create a Songle Widget instance.

window.onload =
function()
{
document.body.appendChild(
SongleWidgetAPI.createSongleWidgetElement({
api: "songle-widget-api-example",
url: "www.youtube.com/watch?v=PqJNc9KVIZE",
songAutoPlay: false,
songAutoLoop: false,
onCreate:
function(songleWidget)
{
console.log("status: " + songleWidget.status);
},
onError:
function(songleWidget)
{
console.log("status: " + songleWidget.status);
},
onReady:
function(songleWidget)
{
console.log("Hello,Songle Widget!!");
}
}));
}

findSongleWidgets()​

Look for a Songle Widget within the current web page.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
var songleWidgets = SongleWidgetAPI.findSongleWidgets();
songleWidgets[ 0 ].play(); // Start playing song.
}

findSongleWidgetsByAPI(api)​

Look for a Songle Widget within the current web page by specifying dataset.api.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
var songleWidgets = SongleWidgetAPI.findSongleWidgetsByAPI(songleWidget.dataset.api);
songleWidgets[ 0 ].play(); // Start playing song.
}

findSongleWidgetsByURL(url)​

Look for a Songle Widget within the current web page by specifying dataset.url.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
var songleWidgets = SongleWidgetAPI.findSongleWidgetsByURL(songleWidget.dataset.url);
songleWidgets[ 0 ].play(); // Start playing song.
}

findSongleWidgetsByMode(mode)​

Look for Songle Widgets within the current web page by specifying mode.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
var songleWidgets = SongleWidgetAPI.findSongleWidgetsByMode(songleWidget.mode);
songleWidgets[ 0 ].play(); // Start playing song.
}

findSongleWidgetsByUUID(uuid)​

Look for a Songle Widget within the current web page by specifying the UUID.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
var songleWidgets = SongleWidgetAPI.findSongleWidgetsByUUID(songleWidget.uuid);
songleWidgets[ 0 ].play(); // Start playing song.
}

findSongleWidgetsByVideoID(videoID)​

Look for a Songle Widget within the current web page by specifying the videoID.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
var songleWidgets = SongleWidgetAPI.findSongleWidgetsByVideoID(songleWidget.videoID);
songleWidgets[ 0 ].play(); // Start playing song.
}

findPrevRepeatSegmentRepeatBy(songleWidget, options)​

Look for the closest repeat segment before the specified position.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
var chorusSegmentRepeat
= SongleWidgetAPI.findPrevRepeatSegmentRepeatBy(songleWidget, {
position: songleWidget.position.milliseconds,
repeatSegmentIndexA: 0,
repeatSegmentIndexB: 0
});

if(chorusSegmentRepeat)
songleWidget.seekTo(chorusSegmentRepeat.start); // Seek to prev chorus segment.
}

findNextRepeatSegmentRepeatBy(songleWidget, options)​

Look for the closest repeat segment after the specified position.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
var chorusSegmentRepeat
= SongleWidgetAPI.findNextRepeatSegmentRepeatBy(songleWidget, {
position: songleWidget.position.milliseconds,
repeatSegmentIndexA: 0,
repeatSegmentIndexB: 0
});

if(chorusSegmentRepeat)
songleWidget.seekTo(chorusSegmentRepeat.start); // Seek to next chorus segment.
}

mergeRepeatSegments(songleWidget, options)​

Merge two repeat segments.

window.onSongleWidgetReady =
function(apiKey, songleWidget)
{
SongleWidgetAPI.mergeRepeatSegments(songleWidget, {
repeatSegmentIndexA: 0,
repeatSegmentIndexB: 5
}); // [ repeat, repeat, repeat, ... ]
}

millisecondsToSeconds(milliseconds)​

Convert the specified time from milliseconds to seconds.

console.log(SongleWidgetAPI.millisecondsToSeconds(60000));

millisecondsToMinutes(milliseconds)​

Convert the specified time from milliseconds to minutes.

console.log(SongleWidgetAPI.millisecondsToMinutes(60000));

secondsToMilliseconds(seconds)​

Convert the specified time from seconds to milliseconds.

console.log(SongleWidgetAPI.secondsToMilliseconds(1.0));

minutesToMilliseconds(minutes)​

Convert the specified time from minutes to milliseconds.

console.log(SongleWidgetAPI.minutesToMilliseconds(1.0));

version​

Returns the version number.

console.log(SongleWidgetAPI.version); // x.x.x