this - Merging javascript callbacks, soundmanager2 and waveform.js -


i'm attempting build audio player using soundmanager2, soundcloud stream, , waveform.js (http://waveformjs.org/). player working, trying callback waveform.js run along side own callbacks (to update time etc) proving more difficult.

waveform.js provides method returns object containing callbacks soundmanager2's whileplaying , whileloading objects. can merge in, removes own callbacks.

i have tried call waveform.js callback functions directly,

whileplaying: function(){     waveformobj.optionsforsyncedstream().whileplaying;     updatetime(); } 

but gives errors along lines of

canvas: attempt set strokestyle or fillstyle value neither string, canvasgradient, or canvaspattern ignored. this.context.fillstyle = this.innercolor;

generated within method of waveform.js.

i'm guessing resolution of this have tried using .apply no avail.

any advice on getting going appreciated.

update

when soundmanager object created, takes number of options, of callbacks options this.

var opts = {             id: _this.o.latesttrackid,             url: _this.o.lateststream,             autoload: true,             autoplay: autoplay,             multishot: false,             onplay: function(){                 _this.playing = true;                 _this.o.playbutton.addclass('playing');                 _this.o.playbutton.removeclass('paused');                 },             onpause: function(){                 _this.playing = false;                 _this.o.playbutton.removeclass('playing');                 _this.o.playbutton.addclass('paused');                 },             onresume: function(){                 _this.playing = true;                 _this.o.playbutton.addclass('playing');                 _this.o.playbutton.removeclass('paused');                 },             onfinish: function(){                 },             onstop: function(){                 },             onload: function(){                 },             whileloading: function(){                 _this.updateloading();                 },             whileplaying: function(){                 _this.setelapsed();                 _this.updateplayhead();                 },             stream: true,             volume: 90         }; 

i want include functions waveform.js update waveform, method provided returns

whileplaying: function(), whileloading: function() 

i include these second whileplaying / whileloading in addition own setelapsed(), etc calling them directly results in warning above.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

c++ - Clear the memory after returning a vector in a function -

erlang - Saving a digraph to mnesia is hindered because of its side-effects -