JavaScript API methods for controlling visualizations
Use the setViz
method to display a visualization in the player — e.g., the visual fretboard, keyboard, mixer, violin fingerboard or waveform.
The method takes an arg
, an integer that specifies which visualization you want to display:
0
— None (closes current visualization)1
— Piano keyboard2
— Fretboard3
— Violin fingerboard4
— Waveform5
— Mixer
If your requested visualization is not supported — e.g., you request the waveform but had specified the enable_waveform=0
URL parameter, or you request the fretboard but your slice has no tablature — this will simply close the current visualization.
Example:
var ssiframe = document.getElementById('ssembed').contentWindow;
// Activate the visual fretboard.
ssiframe.postMessage('{"method": "setViz", "arg": 2}', 'https://www.soundslice.com');