Added possibility of lowering volume from shottimer

This commit is contained in:
Kasper Rynning-Tønnesen
2016-03-07 16:17:35 +01:00
parent 25f9d9ee00
commit 81fab211dd
3 changed files with 31 additions and 1 deletions

View File

@@ -5,6 +5,29 @@
<meta charset="UTF-8"/>
</head>
<body>
<script>
function receiveMessage(event)
{
// Do we trust the sender of this message?
if (event.origin !== "http://etys.no")
return;
// event.source is window.opener
// event.data is "hello there!"
// Assuming you've verified the origin of the received message (which
// you must do in any case), a convenient idiom for replying to a
// message is to call postMessage on event.source and provide
// event.origin as the targetOrigin.
if(event.data == "lower") {
window.setVolume(10);
}else if(event.data == "reset") {
window.setVolume(100);
}
}
window.addEventListener("message", receiveMessage, false);
</script>
<div id="song-title"></div><div id="container" style="display:inline-flex;"><div id="player-container"><div id="player"></div><div id="controls" class="noselect"><div id="zoffbutton" title="Visit the channel!"></div><div id="playpause"><i id="play" class="mdi-av-play-arrow hide"></i><i id="pause" class="mdi-av-pause"></i></div><div id="duration">00:00 / 00:00</div><div id="volume-button"><i id="v-mute" class="mdi-av-volume-off"></i><i id="v-low" class="mdi-av-volume-mute"></i><i id="v-medium" class="mdi-av-volume-down"></i><i id="v-full" class="mdi-av-volume-up"></i></div><div id="volume"></div><div id="viewers"></div><div id="bar"></div></div></div><div id="playlist"><div id="wrapper"><div id="preloader" class="progress channel_preloader"><div class="indeterminate"></div></div><div id="list-song-html"><div id="list-song" class="card left-align list-song"><span class="clickable vote-container" title="Vote!"><a class="clickable center-align votebg"><div class="lazy card-image cardbg list-image" style=""></div></a><span class="card-content"><span class="flow-text truncate list-title"></span><span class="vote-span"><span class="list-votes"></span><span class="highlighted vote-text">&nbsp;votes</span></span></span></span></div></div></div></div></div><script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script><script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script><script type="text/javascript" src="//cdn.socket.io/socket.io-1.3.5.js"></script><script src="static/dist/embed.min.js"></script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@@ -60,8 +60,15 @@ $(document).ready(function(){
Player.loadPlayer();
Playercontrols.initSlider();
window.setVolume = setVolume;
});
function setVolume(val) {
$("#volume").slider('value', val);
Playercontrols.setVolume(val);
}
$(document).on( "click", "#zoffbutton", function(e){
window.open("https://zoff.no/" + chan.toLowerCase() + "/", '_blank');
});