JSFiddle - React, Tailwind, and code Playground

by thomas_david88

HTML

<p><INPUT TYPE="BUTTON" VALUE="Get Current Time" onClick="document.getElementById('bugbox').value = document.getElementById('MyVideoPlayer').getElementsByTagName('embed')[0].getCurrentTime()"></p>
        <p>The video is currently playing at this instant of time: <input id="bugbox" type="text" size="10"></p>

JavaScript

var YouTubeURL;
            var tmp;

            YouTubeURL = 'https://www.youtube.com/v/0Bmhjf0rKe8?version=3&autoplay=1&rel=0&fs=0&theme=light&showinfo=0&modestbranding=1&hd=1&autohide=1&color=white&controls=1&vq=hd720&enablejsapi=1';

            tmp = '';
            tmp = tmp + '<object id="MyVideoPlayer" width="640" height="360">';
            tmp = tmp + '<param name="movie" value="' + YouTubeURL + '"></param>';                                                                  
            tmp = tmp + '<param name="allowFullScreen" value="true"></param>';
            tmp = tmp + '<param name="allowScriptAccess" value="always"></param>';
            tmp = tmp + '<embed src="'+ YouTubeURL +'" type="application/x-shockwave-flash" allowfullscreen="false" width="640" height="360" allowscriptaccess="always"></embed></object>';
            tmp = tmp + '</object>';

            document.write(tmp);