Created
March 1, 2018 09:35
-
-
Save marker1k/63cd743785f557d327c2e1661db14e39 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div style="font-family:Arial;font-size:calc(0.2rem + 2.5vmin);top:75%; | |
transform:translateY(-50%);left:1em;display:block;position:absolute;background:rgba(%user6%); | |
padding:.5em;color:#%user5% !important;text-decoration: none !important"> | |
<script type="text/javascript"> | |
function _dispatch(event) { | |
var player = document.getElementById('mini-player'); | |
if (event.source == player.contentWindow) { | |
try { | |
var message = JSON.parse(event.data); | |
console.log(message.type); | |
if (message && message.type == "player:ready") { | |
player.contentWindow.postMessage(JSON.stringify({ | |
type: 'player:mute' | |
}), '*'); | |
if (window.removeEventListener) { | |
window.removeEventListener("message", _dispatch, false); | |
} else if (window.detachEvent) { | |
window.detachEvent("onmessage", _dispatch); | |
} | |
} | |
} catch (e) {} | |
} | |
} | |
if (window.addEventListener) { | |
window.addEventListener("message", _dispatch, false); | |
} else if (window.attachEvent) { | |
window.attachEvent("onmessage", _dispatch); | |
} | |
</script> | |
<div style="display:inline-block"> | |
<iframe id="mini-player" style="width:10em;height:6em" src="//rutube.ru/play/embed/%user2%?quality=-1&autostartmute=true&platform=minivideo&autoStart=1" frameborder="0"></iframe> | |
<p style="display:block;margin-top:0;margin-bottom:0.5em;margin-left:0;margin-right:0"><a href="https://rutube.ru/video/%user2%/" target="_blank">%user4%</a></p> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment