aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2017-08-04 01:54:42 +0530
committerArun Isaac2017-08-04 01:54:42 +0530
commite7c7bf5fabccf2ad103d67d0a6ff50c13a9d946e (patch)
treea5a1a9573df03ad086be3e6608c0fe1fd49bb908
parent75f2b23b2dbfed1f4da6a3cd8a03636f95271a0b (diff)
downloadyoutube-noscript-shim-e7c7bf5fabccf2ad103d67d0a6ff50c13a9d946e.tar.gz
youtube-noscript-shim-e7c7bf5fabccf2ad103d67d0a6ff50c13a9d946e.tar.lz
youtube-noscript-shim-e7c7bf5fabccf2ad103d67d0a6ff50c13a9d946e.zip
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.
-rw-r--r--viewtube.css4
-rw-r--r--viewtube.js35
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) {