add a youtube player to webpage, in browserifyerable module
emdedding a controllable youtube player is now mostly harmless.
to be used with browserify (or other comonjs bundler?)
var YouTubePlayer = require'youtube-player'var p = id: 'playerElementId' width: 400 height: 300pplayvideoIDpon'end'ploadanotherVideo //whatever
play(id)- play a video by id.
cue(id)- cue a video but don't start it.
start()- start a cued or paused video.
length()- get the length in seconds. (will return 0 intil metadata is loaded, apparently)
seek(seconds)- move playhead to specific point.
setVolume(volume)- (out of 100)
'error'- if the video cannot be played for some reason.
'ready'- player is ready for use.
player- reference to youtube player object. this has more methods.
ready- boolean. current state of the player (calls to play when ready=false are deffered)