Merge commit '7621e2f8dec938cf48181c8b10afc9b01f444e68' into beta

This commit is contained in:
Ilya Laktyushin
2025-12-06 02:17:48 +04:00
commit 8344b97e03
28070 changed files with 7995182 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<style>
body { margin: 0; width:100%%; height:100%%; background-color:#000; }
html { width:100%%; height:100%%; background-color:#000; }
.container iframe, .container object, .container embed { position: absolute; top: 0; left: 0; width: 100%% !important; height: 100%% !important; }
</style>
</head>
<body>
<div class="container">
<iframe id="player" src="%@" width="100%" height="100%" frameborder="0"></iframe>
</div>
<script>
var iframe;
function invoke(command) {
iframe.contentWindow.postMessage(JSON.stringify({ "event": "inject", "command": command }), "*");
}
(function(){
iframe = document.querySelectorAll('iframe')[0];
iframe.onload = function() {
invoke('initialize');
};
})();
</script>
</body>
</html>
@@ -0,0 +1,26 @@
function initialize() {
var video = document.getElementsByTagName("video")[0];
if (video != null) {
video.setAttribute("webkit-playsinline", "");
video.setAttribute("playsinline", "");
video.webkitExitFullscreen = undefined;
video.play();
}
}
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.command == "initialize")
initialize();
} catch (ex) { }
}
window.addEventListener("message", receiveMessage, false);
@@ -0,0 +1,197 @@
<!DOCTYPE html>
<html>
<head>
<style>
html, body {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
overflow: hidden;
}
#videoPlayer {
margin: 0;
padding: 0;
height: 100%;
width: 100%;
object-fit: fill;
}
</style>
<script src="hls.js"></script>
<script type="text/javascript">
function postPlayerEvent(eventName, eventData) {
window.webkit.messageHandlers.performAction.postMessage({'event': eventName, 'data': eventData});
};
var video;
var hls;
var isManifestParsed = false;
var isFirstFrameReady = false;
var isPictureInPictureActive = false;
var currentTimeUpdateTimeout = null;
function playerInitialize(params) {
video = document.getElementById('videoPlayer');
video.addEventListener('loadeddata', (event) => {
if (!isFirstFrameReady) {
isFirstFrameReady = true;
refreshPlayerStatus();
}
});
video.addEventListener("playing", function() {
refreshPlayerStatus();
});
video.addEventListener("pause", function() {
refreshPlayerStatus();
});
video.addEventListener("seeking", function() {
refreshPlayerStatus();
});
video.addEventListener("waiting", function() {
refreshPlayerStatus();
});
video.addEventListener("enterpictureinpicture", function() {
isPictureInPictureActive = true;
refreshPlayerStatus();
}, false);
video.addEventListener("leavepictureinpicture", function() {
isPictureInPictureActive = false;
refreshPlayerStatus();
}, false);
hls = new Hls({
startLevel: 0,
testBandwidth: false,
debug: params['debug'],
autoStartLoad: false,
abrEwmaDefaultEstimate: params['bandwidthEstimate']
});
hls.on(Hls.Events.MANIFEST_PARSED, function() {
isManifestParsed = true;
refreshPlayerStatus();
});
hls.on(Hls.Events.LEVEL_SWITCHED, function() {
refreshPlayerStatus();
});
hls.on(Hls.Events.LEVELS_UPDATED, function() {
refreshPlayerStatus();
});
hls.loadSource('master.m3u8');
hls.attachMedia(video);
}
function playerLoad(initialLevelIndex) {
hls.startLevel = initialLevelIndex;
hls.startLoad(startPosition=-1);
}
function playerPlay() {
video.play();
}
function playerPause() {
video.pause();
}
function playerSetBaseRate(value) {
video.playbackRate = value;
}
function playerSetLevel(level) {
if (level >= 0) {
hls.autoLevelEnabled = false;
hls.currentLevel = level;
} else {
hls.autoLevelEnabled = true;
}
}
function playerSeek(value) {
video.currentTime = value;
}
function playerSetIsMuted(value) {
video.muted = value;
}
function playerRequestPictureInPicture() {
if (video !== document.pictureInPictureElement) {
video.requestPictureInPicture().then(function() {
isPictureInPictureActive = true;
refreshPlayerStatus();
});
}
}
function playerStopPictureInPicture() {
document.exitPictureInPicture();
}
function getLevels() {
var levels = [];
for (var i = 0; i < hls.levels.length; i++) {
level = hls.levels[i];
levels.push({
'index': i,
'bitrate': level.bitrate || 0,
'width': level.width || 0,
'height': level.height || 0
});
}
return levels;
}
function refreshPlayerStatus() {
var isPlaying = false;
if (!video.paused && !video.ended && video.readyState > 2) {
isPlaying = true;
}
postPlayerEvent('playerStatus', {
'isReady': isManifestParsed,
'isFirstFrameReady': isFirstFrameReady,
'isPlaying': !video.paused,
'rate': isPlaying ? video.playbackRate : 0.0,
'defaultRate': video.playbackRate,
'levels': getLevels(),
'currentLevel': hls.currentLevel,
'isPictureInPictureActive': isPictureInPictureActive
});
refreshPlayerCurrentTime();
if (isPlaying) {
if (currentTimeUpdateTimeout == null) {
currentTimeUpdateTimeout = setTimeout(() => {
refreshPlayerCurrentTime();
}, 200);
}
} else {
if(currentTimeUpdateTimeout != null){
clearTimeout(currentTimeUpdateTimeout);
currentTimeUpdateTimeout = null;
}
}
}
function refreshPlayerCurrentTime() {
postPlayerEvent('playerCurrentTime', {
'value': video.currentTime,
'bandwidthEstimate': hls.bandwidthEstimate
});
currentTimeUpdateTimeout = setTimeout(() => {
refreshPlayerCurrentTime()
}, 200);
}
</script>
</head>
<body>
<video id="videoPlayer" playsinline></video>
</body>
</html>
+40
View File
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<style>
body { margin: 0; width:100%%; height:100%%; background-color:#000; }
html { width:100%%; height:100%%; background-color:#000; }
.container iframe, .container object, .container embed { position: absolute; top: 0; left: 0; width: 100%% !important; height: 100%% !important; }
video::-webkit-media-controls { display: none !important }
</style>
</head>
<body>
<div class="container">
<video id="video" type="video/mp4" preload="auto" src="%@" webkit-playsinline></video>
</div>
<script>
var video = document.getElementsByTagName('video')[0];
video.addEventListener("playing", onPlaybackStart, false);
video.addEventListener("ended", onPlaybackEnd, false);
function onPlaybackStart() {
window.location.href = 'embed://onPlayback?data=';
}
function onPlaybackEnd() {
video.currentTime = 0;
video.play();
}
function play() {
video.play();
}
function pause() {
video.pause();
}
video.play();
</script>
</body>
</html>
+43
View File
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html>
<head>
<style>
body { margin: 0; width:100%%; height:100%%; background-color:#000; }
html { width:100%%; height:100%%; background-color:#000; }
.container iframe, .container object, .container embed { position: absolute; top: 0; left: 0; width: 100%% !important; height: 100%% !important; }
</style>
</head>
<body>
<div class="container">
<iframe id="player" src="%@" width="100%" height="100%" frameborder="0"></iframe>
</div>
<script>
var iframe;
var player;
function invoke(command) {
iframe.contentWindow.postMessage(JSON.stringify({ "event": "inject", "command": command }), "*");
}
(function(){
iframe = document.querySelectorAll("iframe")[0];
iframe.onload = function() {
invoke("initialize");
};
})();
function playPause() {
invoke("playPause");
}
function receiveMessage(evt) {
if ((typeof evt.data) != "string")
return;
if (evt.data == "playbackStarted")
window.location.href = "embed://onPlayback?data=";
}
window.addEventListener("message", receiveMessage, false);
</script>
</body>
</html>
@@ -0,0 +1,121 @@
function initialize() {
var controls = document.getElementsByClassName("pl-controls-bottom")[0];
if (controls == null) {
controls = document.getElementsByClassName("player-overlay-container")[0];
}
if (controls != null) {
controls.style.display = "none";
}
var root = document.getElementsByClassName("player-root")[0];
if (root != null) {
root.style.display = "none";
}
var topBar = document.getElementById("top-bar");
if (topBar == null) {
topBar = document.getElementsByClassName("pl-controls-top")[0];
}
if (topBar != null) {
topBar.style.display = "none";
}
var pauseOverlay = document.getElementsByClassName("player-play-overlay")[0];
if (pauseOverlay == null) {
pauseOverlay = document.getElementsByClassName("pl-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];
if (video != null) {
video.setAttribute("webkit-playsinline", "");
video.setAttribute("playsinline", "");
video.webkitEnterFullscreen = undefined;
video.addEventListener("playing", onPlaybackStart, false);
video.play();
}
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);
var ageButton = document.getElementById("mature-link");
if (ageButton != null) {
eventFire(ageButton, "click");
}
}
function onPlaybackStart() {
window.parent.postMessage("playbackStarted", "*");
}
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 togglePlayPause() {
var playButton = document.getElementsByClassName("js-control-playpause-button")[0];
if (playButton == null) {
playButton = document.getElementsByClassName("player-button")[0];
}
if (playButton != null) {
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.command == "initialize")
initialize();
else if (obj.command == "playPause")
togglePlayPause();
} catch (ex) { }
}
window.addEventListener("message", receiveMessage, false);
@@ -0,0 +1,158 @@
var uiWebview_SearchResultCount = 0;
/*!
@method uiWebview_HighlightAllOccurencesOfStringForElement
@abstract // helper function, recursively searches in elements and their child nodes
@discussion // helper function, recursively searches in elements and their child nodes
element - HTML elements
keyword - string to search
*/
function isElementVisible(e) {
return true
}
function uiWebview_HighlightAllOccurencesOfStringForElement(element,keyword) {
if (element) {
if (element.nodeType == 3) { // Text node
var count = 0;
var elementTmp = element;
while (true) {
var value = elementTmp.nodeValue; // Search for keyword in text node
var idx = value.toLowerCase().indexOf(keyword);
if (idx < 0) break;
count++;
elementTmp = document.createTextNode(value.substr(idx+keyword.length));
}
uiWebview_SearchResultCount += count;
var index = uiWebview_SearchResultCount;
while (true) {
var value = element.nodeValue; // Search for keyword in text node
var idx = value.toLowerCase().indexOf(keyword);
if (idx < 0) break; // not found, abort
var span = document.createElement("span");
var text = document.createTextNode(value.substr(idx,keyword.length));
span.appendChild(text);
span.setAttribute("class","uiWebviewHighlight");
span.style.position = "relative";
span.style.display = "inline-block";
span.style.backgroundColor="#ffe438";
span.style.color="black";
span.style.borderRadius="3px";
span.style.scrollMargin="44px";
span.style.zIndex = "1001"; // Ensure highlights are above the overlay
index--;
span.setAttribute("id", "SEARCH WORD"+(index));
var beforeStyle = document.createElement('style');
beforeStyle.innerHTML = `
.uiWebviewHighlight::before {
content: '';
position: absolute;
top: 0px;
bottom: 0px;
left: -2px;
right: -2px;
background-color: #ffe438;
z-index: -1;
border-radius: 3px;
}
.dark-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.22);
z-index: 1000;
pointer-events: none;
}
`;
document.head.appendChild(beforeStyle);
text = document.createTextNode(value.substr(idx+keyword.length));
element.deleteData(idx, value.length - idx);
var next = element.nextSibling;
element.parentNode.insertBefore(span, next);
element.parentNode.insertBefore(text, next);
element = text;
}
} else if (element.nodeType == 1) { // Element node
if (element.nodeName.toLowerCase() != 'select' && isElementVisible(element)) {
for (var i=element.childNodes.length-1; i>=0; i--) {
uiWebview_HighlightAllOccurencesOfStringForElement(element.childNodes[i],keyword);
}
}
}
}
}
// the main entry point to start the search
function uiWebview_HighlightAllOccurencesOfString(keyword) {
uiWebview_RemoveAllHighlights();
uiWebview_AddDarkOverlay();
uiWebview_HighlightAllOccurencesOfStringForElement(document.body, keyword.toLowerCase());
}
// helper function, recursively removes the highlights in elements and their childs
function uiWebview_RemoveAllHighlightsForElement(element) {
if (element) {
if (element.nodeType == 1) {
if (element.getAttribute("class") == "uiWebviewHighlight") {
var text = element.removeChild(element.firstChild);
element.parentNode.insertBefore(text,element);
element.parentNode.removeChild(element);
return true;
} else {
var normalize = false;
for (var i=element.childNodes.length-1; i>=0; i--) {
if (uiWebview_RemoveAllHighlightsForElement(element.childNodes[i])) {
normalize = true;
}
}
if (normalize) {
element.normalize();
}
}
}
}
return false;
}
// the main entry point to remove the highlights
function uiWebview_RemoveAllHighlights() {
uiWebview_SearchResultCount = 0;
uiWebview_RemoveAllHighlightsForElement(document.body);
uiWebview_RemoveDarkOverlay();
}
function uiWebview_ScrollTo(idx) {
var scrollTo = document.getElementById("SEARCH WORD" + idx);
if (scrollTo) scrollTo.scrollIntoView();
}
function uiWebview_AddDarkOverlay() {
var overlay = document.createElement('div');
overlay.classList.add('dark-overlay');
overlay.setAttribute('id', 'dark-overlay');
document.body.appendChild(overlay);
}
function uiWebview_RemoveDarkOverlay() {
var overlay = document.getElementById('dark-overlay');
if (overlay) {
document.body.removeChild(overlay);
}
}
+109
View File
@@ -0,0 +1,109 @@
<!DOCTYPE html>
<html>
<head>
<style>
body { margin: 0; width:100%%; height:100%%; background-color:#000; }
html { width:100%%; height:100%%; background-color:#000; }
.container iframe, .container object, .container embed { position: absolute;top: 0; left: 0; width: 100%% !important; height: 100%% !important; }
</style>
</head>
<body>
<div class="container">
<iframe id="player" src="https://player.vimeo.com/video/%@?badge=0&byline=0&portrait=0&title=0" width="100%" height="100%" frameborder="0"></iframe>
</div>
<script src="https://player.vimeo.com/api/player.js"></script>
<script>
var iframe;
var player;
function invoke(command) {
iframe.contentWindow.postMessage(JSON.stringify({ "event": "inject", "command": command }), "*");
}
var played = false;
function play() {
if (played) {
player.play();
} else {
invoke("autoplay");
played = true;
}
}
function pause() {
player.pause();
}
function seek(timestamp) {
player.setCurrentTime(timestamp)
}
function setRate(rate) {
player.setPlaybackRate(rate)
}
(function() {
var playbackState = 1;
var duration = 0.0;
var position = 0.0;
var downloadProgress = 0.0;
iframe = document.querySelectorAll("iframe")[0];
player = new Vimeo.Player(iframe);
player.getCurrentTime().then(function(seconds) {
position = seconds;
});
player.getDuration().then(function(seconds) {
duration = seconds;
});
function updateState() {
player.getPaused().then(function(paused) {
playbackState = paused ? 0 : 1;
});
player.getCurrentTime().then(function(seconds) {
position = seconds;
});
player.getDuration().then(function(seconds) {
duration = seconds;
});
window.location.href = "embed://onState?playback=" + playbackState + "&position=" + position + "&duration=" + duration + "&download=" + downloadProgress;
invoke("initialize");
}
function onPlay(data) {
playbackState = 1;
updateState();
}
function onPause(data) {
playbackState = 0;
updateState();
}
function onFinish(data) {
playbackState = 2;
updateState();
}
function onPlayProgress(data) {
position = data.seconds;
duration = data.duration;
}
function onLoadProgress(data) {
downloadProgress = data.percent;
}
player.on('play', onPlay);
player.on('pause', onPause);
player.on("ended", onFinish);
window.setInterval(updateState, 500);
if (%@) {
invoke("autoplay");
}
})();
</script>
</body>
</html>
@@ -0,0 +1,53 @@
function initialize() {
var controls = document.getElementsByClassName("vp-controls-wrapper")[0];
if (controls != null) {
controls.style.display = "none";
}
var sidedock = document.getElementsByClassName("vp-sidedock")[0];
if (sidedock != null) {
sidedock.style.display = "none";
}
// var video = document.getElementsByTagName("video")[0];
// if (video != null) {
// video.setAttribute("webkit-playsinline", "");
// video.setAttribute("playsinline", "");
// video.webkitEnterFullscreen = undefined;
// }
}
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 autoplay() {
var playButton = document.getElementsByClassName("play")[0];
if (playButton != null) {
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.command == "initialize")
initialize();
else if (obj.command == "autoplay")
autoplay();
} catch (ex) { }
}
window.addEventListener("message", receiveMessage, false);
+109
View File
@@ -0,0 +1,109 @@
<!DOCTYPE html>
<html>
<head>
<style>
body { margin: 0; width:100%%; height:100%%; background-color:#000; }
html { width:100%%; height:100%%; background-color:#000; }
.container iframe, .container object, .container embed { position: absolute; top: 0; left: 0; width: 100%% !important; height: 100%% !important; }
</style>
</head>
<body>
<div class="container">
<div id="player"></div>
</div>
<script src="https://www.youtube.com/iframe_api"></script>
<script>
var player;
var iframe;
var error = false;
function invoke(command) {
iframe.contentWindow.postMessage(JSON.stringify({ "event": "inject", "command": command }), "*");
}
var playbackState = 0;
var duration = 0.0;
var position = 0.0;
var downloadProgress = 0.0;
var quality = "";
var availableQualities = "";
var failed = false;
var autostarted = false;
var storyboardSpec = ""
YT.ready(function() {
player = new YT.Player("player", %@);
player.setSize(window.innerWidth, window.innerHeight);
function getCurrentTime() {
downloadProgress = player.getVideoLoadedFraction();
position = player.getCurrentTime();
//storyboardSpec = player.getStoryboardFormat();
updateState();
invoke("tick");
}
window.setInterval(getCurrentTime, 500);
invoke("initialize");
});
function play() {
player.playVideo();
}
function pause() {
player.pauseVideo();
}
function seek(timestamp) {
player.seekTo(timestamp, true);
}
function setRate(rate) {
player.setPlaybackRate(rate);
}
function updateState() {
window.location.href = "embed://onState?failed=" + failed + "&playback=" + playbackState + "&position=" + position + "&duration=" + duration + "&download=" + downloadProgress + '&quality=' + quality + '&availableQualities=' + availableQualities + '&storyboard=' + storyboardSpec;
}
function onReady(event) {
window.location.href = "embed://onReady?data=" + event.data;
iframe = document.getElementById("player");
iframe.referrerPolicy = "origin";
duration = player.getDuration();
invoke("tick");
}
function onStateChange(event) {
if (!error) {
playbackState = event.data;
updateState();
}
else {
error = false;
}
}
function onPlaybackQualityChange(event) {
quality = event.data;
updateState();
}
function onPlayerError(event) {
if (event.data == 100) {
error = true;
}
else if (event.data == 150) {
failed = true;
}
updateState();
}
window.onresize = function() {
player.setSize(window.innerWidth, window.innerHeight);
}
</script>
</body>
</html>
@@ -0,0 +1,95 @@
function initialize() {
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 tick() {
var watermark = document.getElementsByClassName("ytp-watermark")[0];
if (watermark != null) {
// watermark.style.display = "none";
}
var button = document.getElementsByClassName("ytp-large-play-button")[0];
if (button != null) {
// button.style.display = "none";
// button.style.opacity = "0";
}
var progress = document.getElementsByClassName("ytp-spinner-container")[0];
if (progress != null) {
// progress.style.display = "none";
// progress.style.opacity = "0";
}
var pause = document.getElementsByClassName("ytp-pause-overlay")[0];
if (pause != null) {
// pause.style.display = "none";
// pause.style.opacity = "0";
}
var chrome = document.getElementsByClassName("ytp-chrome-top")[0];
if (chrome != null) {
// chrome.style.display = "none";
// chrome.style.opacity = "0";
}
var paid = document.getElementsByClassName("ytp-paid-content-overlay")[0];
if (paid != null) {
// paid.style.display = "none";
// paid.style.opacity = "0";
}
var gradient = document.getElementsByClassName("ytp-gradient-top")[0];
if (gradient != null) {
// gradient.style.display = "none";
// gradient.style.opacity = "0";
}
var end = document.getElementsByClassName("html5-endscreen")[0];
if (end != null) {
// end.style.display = "none";
// end.style.opacity = "0";
}
var elements = document.getElementsByClassName("ytp-ce-element");
for (var i = 0; i < elements.length; i++) {
var element = elements[i]
// element.style.display = "none";
// element.style.opacity = "0";
}
var video = document.getElementsByTagName("video")[0];
if (video != null) {
video.setAttribute("webkit-playsinline", "");
video.setAttribute("playsinline", "");
video.webkitEnterFullscreen = undefined;
}
}
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.command == "initialize")
initialize();
else if (obj.command == "tick")
tick();
} catch (ex) { }
}
window.addEventListener("message", receiveMessage, false);
File diff suppressed because one or more lines are too long