diff --git a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/DefaultPlayer.html b/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/DefaultPlayer.html deleted file mode 100755 index 0a5b5befaf..0000000000 --- a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/DefaultPlayer.html +++ /dev/null @@ -1,42 +0,0 @@ - - -
- - - - - - - diff --git a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/DefaultPlayerInject.js b/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/DefaultPlayerInject.js deleted file mode 100644 index 4e3bbaa0b0..0000000000 --- a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/DefaultPlayerInject.js +++ /dev/null @@ -1,18 +0,0 @@ -function fixInline() { - var video = document.getElementsByTagName('video')[0]; - video.setAttribute('webkit-playsinline', ''); - video.setAttribute('playsinline', ''); - video.webkitExitFullscreen = undefined; - - video.play(); -} - -function receiveMessage(evt) { - try { - var obj = JSON.parse(evt.data); - if (obj.cmd == 'fixInline') - fixInline(); - } catch (ex) { } -} - -window.addEventListener('message', receiveMessage, false); diff --git a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/InstagramPlayer.html b/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/InstagramPlayer.html deleted file mode 100755 index b21889acac..0000000000 --- a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/InstagramPlayer.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - - - diff --git a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/TwitchPlayer.html b/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/TwitchPlayer.html deleted file mode 100755 index 3522534816..0000000000 --- a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/TwitchPlayer.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - diff --git a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/TwitchPlayerInject.js b/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/TwitchPlayerInject.js deleted file mode 100644 index 1325020db9..0000000000 --- a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/TwitchPlayerInject.js +++ /dev/null @@ -1,129 +0,0 @@ -var video; - -function hidePlayButton() { - var css = 'video::-webkit-media-controls { display: none !important } video::--webkit-media-controls-play-button { display: none !important; -webkit-appearance: none; } video::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }', - head = document.head || document.getElementsByTagName('head')[0], - style = document.createElement('style'); - - style.type = 'text/css'; - if (style.styleSheet){ - style.styleSheet.cssText = css; - } else { - style.appendChild(document.createTextNode(css)); - } - - head.appendChild(style); -} - -function fixPlayer() { - var controls = document.getElementsByClassName('player-controls-bottom')[0]; - if (controls == null) { - controls = document.getElementsByClassName('player-overlay-container')[0]; - } - if (controls != null) { - controls.style.display = 'none'; - } - - var topBar = document.getElementById('top-bar'); - if (topBar == null) { - topBar = document.getElementsByClassName('player-controls-top')[0]; - } - if (topBar != null) { - topBar.style.display = 'none'; - } - - var pauseOverlay = document.getElementsByClassName('player-play-overlay')[0]; - if (pauseOverlay == null) { - pauseOverlay = document.getElementsByClassName('player-controls-bottom')[0]; - } - if (pauseOverlay != null) { - pauseOverlay.style.display = 'none'; - } - - var statusOverlay = document.getElementsByClassName('player-streamstatus')[0]; - if (statusOverlay != null) { - statusOverlay.style.right = undefined; - statusOverlay.style.left = '0px'; - statusOverlay.style.padding = '1.5em 1.5em 5.5em 2.5em'; - } - - var recommendationOverlay = document.getElementById('js-player-recommendations-overlay'); - if (recommendationOverlay != null) { - recommendationOverlay.style.display = 'none'; - } - - var adOverlay = document.getElementsByClassName('player-ad-overlay')[0]; - if (adOverlay != null) { - adOverlay.style.display = 'none'; - } - - var alertOverlay = document.getElementById('js-player-alert-container'); - if (alertOverlay != null) { - alertOverlay.style.display = 'none'; - } - - var video = document.getElementsByTagName('video')[0]; - video.setAttribute('webkit-playsinline', ''); - video.setAttribute('playsinline', ''); - video.webkitEnterFullscreen = undefined; - - video.addEventListener("playing", onPlaybackStart, false); - - video.play(); - - hidePlayButton(); - - var ageButton = document.getElementById('mature-link'); - if (ageButton != null) { - eventFire(ageButton, 'click'); - } -} - -function onPlaybackStart() { - window.parent.postMessage('playbackStarted', '*'); -} - -function switchToPIP() { - var video = document.getElementsByTagName('video')[0]; - video.webkitSetPresentationMode('picture-in-picture'); -} - -function eventFire(el, etype){ - if (el.fireEvent) { - el.fireEvent('on' + etype); - } else { - var evObj = document.createEvent('Events'); - evObj.initEvent(etype, true, false); - el.dispatchEvent(evObj); - } -} - -function play() { - var playButton = document.getElementsByClassName('js-control-playpause-button')[0]; - if (playButton == null) { - playButton = document.getElementsByClassName('player-button--playpause')[0]; - } - - eventFire(playButton, 'click'); -} - -function receiveMessage(evt) { - if ((typeof evt.data) != 'string') - return; - - try { - var obj = JSON.parse(evt.data); - if (!obj.event || obj.event != 'inject') - return; - - if (obj.cmd == 'fixPlayer') - fixPlayer(); - else if (obj.cmd == 'play') - play(); - else if (obj.cmd == 'switchToPIP') - switchToPIP(); - } catch (ex) { } -} - -window.addEventListener('message', receiveMessage, false); - diff --git a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/VimeoPlayer.html b/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/VimeoPlayer.html deleted file mode 100755 index 5175d13427..0000000000 --- a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/VimeoPlayer.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - diff --git a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/VimeoPlayerInject.js b/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/VimeoPlayerInject.js deleted file mode 100644 index 8b1cd8bc28..0000000000 --- a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/VimeoPlayerInject.js +++ /dev/null @@ -1,52 +0,0 @@ -function fixPlayer() { - var controls = document.getElementsByClassName('controls')[0]; - controls.style.display = 'none'; - - var sidedock = document.getElementsByClassName('sidedock')[0]; - sidedock.style.display = 'none'; - - var video = document.getElementsByTagName('video')[0]; - video.setAttribute('webkit-playsinline', ''); - video.setAttribute('playsinline', ''); - video.webkitEnterFullscreen = undefined; -} - -function switchToPIP() { - var video = document.getElementsByTagName('video')[0]; - video.webkitSetPresentationMode('picture-in-picture'); -} - -function eventFire(el, etype){ - if (el.fireEvent) { - el.fireEvent('on' + etype); - } else { - var evObj = document.createEvent('Events'); - evObj.initEvent(etype, true, false); - el.dispatchEvent(evObj); - } -} - -function initialPlay() { - var playButton = document.getElementsByClassName('play')[0]; - eventFire(playButton, 'click'); -} - -function receiveMessage(evt) { - if ((typeof evt.data) != 'string') - return; - - try { - var obj = JSON.parse(evt.data); - if (!obj.event || obj.event != 'inject') - return; - - if (obj.cmd == 'fixPlayer') - fixPlayer(); - else if (obj.cmd == 'initialPlay') - initialPlay(); - else if (obj.cmd == 'switchToPIP') - switchToPIP(); - } catch (ex) { } -} - -window.addEventListener('message', receiveMessage, false); diff --git a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/VinePlayer.html b/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/VinePlayer.html deleted file mode 100755 index 2fba84115c..0000000000 --- a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/VinePlayer.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - diff --git a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/VinePlayerInject.js b/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/VinePlayerInject.js deleted file mode 100644 index cc57644e2a..0000000000 --- a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/VinePlayerInject.js +++ /dev/null @@ -1,80 +0,0 @@ -function hidePlayButton() { - var css = 'video::-webkit-media-controls { display: none !important }', - head = document.head || document.getElementsByTagName('head')[0], - style = document.createElement('style'); - - style.type = 'text/css'; - if (style.styleSheet){ - style.styleSheet.cssText = css; - } else { - style.appendChild(document.createTextNode(css)); - } - - head.appendChild(style); -} - -var video; - -function fixPlayer() { - var controls = document.getElementsByClassName('VolumeControl')[0]; - controls.style.display = 'none'; - - video.setAttribute('webkit-playsinline', ''); - video.setAttribute('playsinline', ''); - video.webkitEnterFullscreen = undefined; - - hidePlayButton(); -} - -function play() { - video.play(); -} - -function pause() { - video.pause(); -} - -function showWatermark() { - var logo = document.getElementsByClassName('vine-logo')[0]; - logo.style.display = 'block'; -} - -function hideWatermark() { - var logo = document.getElementsByClassName('vine-logo')[0]; - logo.style.display = 'none'; -} - -function receiveMessage(evt) { - if ((typeof evt.data) != 'string') - return; - - try { - var obj = JSON.parse(evt.data); - if (!obj.event || obj.event != 'inject') - return; - - if (obj.cmd == 'play') - play(); - else if (obj.cmd == 'pause') - pause(); - else if (obj.cmd == 'showWatermark') - showWatermark(); - else if (obj.cmd == 'hideWatermark') - hideWatermark(); - } catch (ex) { } -} - -window.addEventListener('message', receiveMessage, false); - -var video = document.getElementsByTagName('video')[0]; - -fixPlayer(); -hidePlayButton(); - -video.addEventListener("playing", onPlaybackStart, false); - -window.parent.postMessage(JSON.stringify({ "event": "src", "data": video.src }), '*'); - -function onPlaybackStart() { - window.parent.postMessage('playbackStarted', '*'); -} diff --git a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/YoutubePlayer.html b/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/YoutubePlayer.html deleted file mode 100755 index 8beffcad61..0000000000 --- a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/YoutubePlayer.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - diff --git a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/YoutubePlayerInject.js b/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/YoutubePlayerInject.js deleted file mode 100644 index 5783654581..0000000000 --- a/submodules/LegacyComponents/LegacyComponents/Resources/LegacyComponentsResources.bundle/YoutubePlayerInject.js +++ /dev/null @@ -1,51 +0,0 @@ -function fixChrome() { - var watermark = document.getElementsByClassName('ytp-watermark')[0]; - watermark.style.display = 'none'; - - var button = document.getElementsByClassName('ytp-large-play-button')[0]; - button.style.display = 'none'; - button.style.opacity = '0'; - - var progress = document.getElementsByClassName('ytp-spinner-container')[0]; - progress.style.display = 'none'; - progress.style.opacity = '0'; - - var video = document.getElementsByTagName('video')[0]; - video.setAttribute('webkit-playsinline', ''); - video.setAttribute('playsinline', ''); - video.webkitEnterFullscreen = undefined; -} - -function initial() { - var css = 'video::-webkit-media-controls { display: none !important } video::--webkit-media-controls-play-button { display: none !important; -webkit-appearance: none; } video::-webkit-media-controls-start-playback-button { display: none !important; -webkit-appearance: none; }', - head = document.head || document.getElementsByTagName('head')[0], - style = document.createElement('style'); - - style.type = 'text/css'; - if (style.styleSheet){ - style.styleSheet.cssText = css; - } else { - style.appendChild(document.createTextNode(css)); - } - - head.appendChild(style); -} - -function switchToPIP() { - var video = document.getElementsByTagName('video')[0]; - video.webkitSetPresentationMode('picture-in-picture'); -} - -function receiveMessage(evt) { - try { - var obj = JSON.parse(evt.data); - if (obj.cmd == 'fixChrome') - fixChrome(); - else if (obj.cmd == 'initial') - initial(); - else if (obj.cmd == 'switchToPIP') - switchToPIP(); - } catch (ex) { } -} - -window.addEventListener('message', receiveMessage, false);