Plugins
By including the following script files with default embed code, you can easily test the feature of the Songle Widget API. For instance, the following scripts enable showing photos and shapes synchronously with playing songs as well as visualizing music structures.
Visualize music structures
<script src="https://ongacrest.github.io/songle-widget-api-examples/extras/sw-extra-stats.js"></script>
Show shapes
<script src="https://ongacrest.github.io/songle-widget-api-examples/extras/sw-extra-visualizer.js"></script>
Embedded options
| Option name | Explanation | Default value | Required? |
|---|---|---|---|
data-api | Specifies unique string when using the API. | "" | No |
data-url | Specifies the URL of the original song or video. (e.g. www.youtube.com/watch?v=PqJNc9KVIZE) | "" | Yes |
data-api-create-callback-name | Specifies the name of the callback method, called when the Songle Widget DOM element is created. | "onSongleWidgetCreate" | No |
data-api-error-callback-name | Specifies the name of the callback method, called when the initialization of the API fails. | "onSongleWidgetError" | No |
data-api-ready-callback-name | Specifies the name of the callback method, called when the initialization of the API succeeds. | "onSongleWidgetReady" | No |
data-api-beat-auto-reload | Enables auto-update of the beat (pulse) information when 1 is specified. | "0" | No |
data-api-chord-auto-reload | Enables auto-update of the chord information when 1 is specified. | "0" | No |
data-api-melody-auto-reload | Enables auto-update of the melody information when 1 is specified. | "0" | No |
data-api-chorus-auto-reload | Enables auto-update of the chorus part information when 1 is specified. | "0" | No |
data-api-beat-disabled | Skips loading the beat (pulse) information when 1 is specified. | "0" | No |
data-api-chord-disabled | Skips loading the chord information when 1 is specified. | "0" | No |
data-api-melody-disabled | Skips loading the melody information when 1 is specified. | "0" | No |
data-api-chorus-disabled | Skips loading the chorus part information when 1 is specified. | "0" | No |
data-api-beat-revision | Forces the widget to load the specified revision of the beat (pulse) information. If 0 is specified, load the newest revision. | "0" | No |
data-api-chord-revision | Forces the widget to load the specified revision of the chord information. If 0 is specified, load the newest revision. | "0" | No |
data-api-melody-revision | Forces the widget to load the specified revision of the melody information. If 0 is specified, load the newest revision. | "0" | No |
data-api-chorus-revision | Forces the widget to load the specified revision of the chorus part information. If 0 is specified, load the newest revision. | "0" | No |
data-song-auto-play | Enables auto-play (automatically starts playing the music or video) if 1 is specified. This option is only available for a YouTube video and MP3 file. | "0" | No |
data-song-auto-loop | Enables auto-loop (automatically restarts playing the music or video when reaching its end) if 1 is specified. This option is only available for a YouTube video and MP3 file. | "0" | No |
data-song-start-at | Specifies the starting position of playing the music or video. [seconds] If chorus is specified, playing starts at the first chorus part highlighted in orange.If repeat is specified, playing starts at the first repeat segment highlighted in blue. | "0" | No |
data-song-volume | Specifies the initial volume. [0 - 100] | "auto" | No |
data-songle-widget-ctrl | Shows the playback control if 1 is specified. | "1" | No |
data-songle-widget-ctrl-enter-color | Specifies the color of the playback control when the mouse is hoverred. | "#e17" | No |
data-songle-widget-ctrl-leave-color | Specifies the color of the playback control when the mouse is left. | "#000" | No |
data-songle-widget-ctrl-link-color | Specifies the color of the information text. | "#e17" | No |
data-songle-widget-size-w | Specifies the width of the Songle Widget. [px] If auto is specified, the widget automatically fits to the parent element. | "275" | No |
data-songle-widget-size-h | Specifies the height of the Songle Widget. [px] If auto is specified, the widget automatically fits to the parent element. | "100" | No |
data-video-player-size-w | Specifies the width of the video player. [px] If auto is specified, the player automatically fits to the parent element. | "275" | No |
data-video-player-size-h | Specifies the height of the video player. [px] If auto is specified, the player automatically fits to the parent element. | "155" | No |
data-nn-transparent | If 1 is specified, enables wmode. This option is only available for Niconico videos. | "0" | No |
data-yt-ctrl | If 1 is specified, shows playback controls of the video player. This option is only available for YouTube videos. | "0" | No |
data-yt-info | If 1 is specified, shows detailed information of the video player. This option is only available for YouTube videos. | "0" | No |
data-yt-quality | Specifies the quality of the video. This option is only available for YouTube videos. | "small" | No |