mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-21 13:04:42 +00:00
54 lines
1.3 KiB
HTML
Executable File
54 lines
1.3 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<style>
|
|
body { margin: 0; width:100%%; height:100%%; background-color:transparent; }
|
|
html { width:100%%; height:100%%; background-color:transparent; }
|
|
|
|
.embed-container iframe,
|
|
.embed-container object,
|
|
.embed-container embed {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%% !important;
|
|
height: 100%% !important;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="embed-container">
|
|
<iframe id="player" src="%@" width="100%" height="100%" frameborder="0"></iframe>
|
|
</div>
|
|
<script>
|
|
|
|
var iframe;
|
|
var player;
|
|
|
|
function injectCmd(cmd) {
|
|
var cmdStr = JSON.stringify({ "event": "inject", "cmd": cmd, "id": 1 });
|
|
iframe.contentWindow.postMessage(cmdStr, "*");
|
|
}
|
|
|
|
(function(){
|
|
iframe = document.querySelectorAll('iframe')[0];
|
|
|
|
iframe.onload = function() {
|
|
injectCmd('fixPlayer');
|
|
};
|
|
})();
|
|
|
|
function receiveMessage(evt) {
|
|
if ((typeof evt.data) != 'string')
|
|
return;
|
|
|
|
if (evt.data == 'playbackStarted')
|
|
window.location.href = 'twitchplayer://onPlayback?data=';
|
|
}
|
|
|
|
window.addEventListener('message', receiveMessage, false);
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|