From e7c7bf5fabccf2ad103d67d0a6ff50c13a9d946e Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 4 Aug 2017 01:54:42 +0530 Subject: Remove video menu from panel. * viewtube.js (createMyPlayer): Remove function. (playMyVideo): Do not delete previously existing video elements, because there are none. * viewtube.css (video): Remove video menu styles. Fit video in player window. --- viewtube.css | 4 +--- viewtube.js | 35 +++-------------------------------- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/viewtube.css b/viewtube.css index 53e22f7..230d399 100644 --- a/viewtube.css +++ b/viewtube.css @@ -1,4 +1,2 @@ .hide { display: none; } -.audio-video-only { color: #8f6b32; } -.dash { color: #cf4913; } -.direct-video-link { color: #00c0c0; } +video { width: 100%; height: 100%; } 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) { -- cgit v1.2.3