diff options
Diffstat (limited to 'viewtube.js')
-rw-r--r-- | viewtube.js | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/viewtube.js b/viewtube.js index e41b167..0233b52 100644 --- a/viewtube.js +++ b/viewtube.js @@ -61,33 +61,6 @@ return createElement.apply(null, ["video", Object.assign({controls: "controls", autoplay: "autoplay", volume: 0.8}, attributes), parent].concat(children)); } - function createMyPlayer() { - /* The Panel */ - player["playerPanel"] = createElement("div", {}, player["playerWindow"]); - - /* Panel Video Menu */ - player["videoMenu"] = createElement("select", {title: "Select the video format for playback"}, player["playerPanel"]); - player["videoMenu"].addEventListener('change', function() { - player['videoPlay'] = this.value; - playMyVideo(); - }, false); - for (var videoCode in player['videoList']) { - player["videoItem"] = createElement("option", {value: videoCode, innerHTML: videoCode}, player["videoMenu"]); - if (videoCode.indexOf('Video') != -1 || videoCode.indexOf('Audio') != -1) - player["videoItem"].classList.add("audio-video-only"); - if (player['videoList'][videoCode] == 'DASH') - player["videoItem"].classList.add("dash"); - if (videoCode == 'Direct Video Link') - player["videoItem"].classList.add("direct-video-link"); - } - - /* The Content */ - player["playerContent"] = createElement("div", {}, player["playerWindow"]); - - /* Play My Video */ - playMyVideo(); - } - function playDASHwithHTML5() { function playAudio (play) { if (play) player["contentAudio"].play(); @@ -128,13 +101,11 @@ } function playMyVideo() { - while (player['playerContent'].hasChildNodes()) - player['playerContent'].removeChild(player['playerContent'].firstChild); if (player['videoList'][player['videoPlay']] == 'DASH') playDASHwithHTML5(); - else - player["contentVideo"] = createVideoElement({src: player["videoList"][player["videoPlay"]], poster: player["videoThumb"]}); - player['playerContent'].appendChild(player['contentVideo']); + else player["contentVideo"] = createVideoElement({src: player["videoList"][player["videoPlay"]], + poster: player["videoThumb"]}); + player['playerWindow'].appendChild(player['contentVideo']); } function cleanMyContent(content, unesc) { |