I would like to have more control over the waveform styling so I added the Waveform library: http://waveformjs.org/#options
From the examples it seems this only works if you call an SC track with the SoundCloud JS SDK library:
SC.get("/tracks/293", function(track){
var waveform = new Waveform({
container: document.getElementById("example2"),
innerColor: "#333"
});
waveform.dataFromSoundCloudTrack(track);
var streamOptions = waveform.optionsForSyncedStream();
SC.stream(track.uri, streamOptions, function(stream){
window.exampleStream = stream;
});
});
But I was wundering what I should pass as track variable in the waveform.dataFromSoundCloudTrack(track) function so I can use onPlayerInit.scPlayer instead to create the waveform? Something like this:
$('.sc-player').bind('onPlayerInit.scPlayer', function(track){
$(this).find('.sc-scrubber .sc-time-span .sc-waveform-container').attr('id','sc-waveform');
var waveform = new Waveform({
container: document.getElementById('sc-waveform'),
innerColor: "#333"
});
waveform.dataFromSoundCloudTrack(track);
});
Hi there,
I would like to have more control over the waveform styling so I added the Waveform library: http://waveformjs.org/#options
From the examples it seems this only works if you call an SC track with the SoundCloud JS SDK library:
But I was wundering what I should pass as track variable in the
waveform.dataFromSoundCloudTrack(track)
function so I can useonPlayerInit.scPlayer
instead to create the waveform? Something like this:Thanks!