@Stubbsy1994 The link you provided describes how to embed youtube API into HTML sites using iframe-Tags in two ways. It seems, the module shown in the thread above uses the first method (iframe with source http:// www.youtube. com/embed/VIDEO_ID?parameters). I guess, the pure JS method ultimatively also uses an iframe since its called IFrame Player API.
As far as I can see, both have equal functionality. It’s not really documented, but it seems like you can call all the functions for the player-object listed here in the direct iframe approach (first method), too. See parameter enablejsapi=1
. For example pause or seek-to (not verified for all functions!):
$('#video1')[0].contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
$('#video1')[0].contentWindow.postMessage('{"event":"command","func":"seekTo","args":[20, true]}', '*');
Compare sendCommand
function in youtube.js of the module described in the thread above.
So even though the module may not satisfy all your needs by now, maybe you can take it as a starting point to develop your own solution?!