forked from varia/web-narrowcast
added new js code for audio
This commit is contained in:
parent
95358b3eee
commit
625da09184
44
index.html
44
index.html
@ -89,6 +89,18 @@
|
|||||||
</div>
|
</div>
|
||||||
-->
|
-->
|
||||||
|
|
||||||
|
<!-- AUDIO NEW CODE -->
|
||||||
|
<span class="stream">
|
||||||
|
<audio id="player" preload="none" src="https://r.0x56.net/live"> </audio><br>
|
||||||
|
Press play (best listened in FireFox). It might take a minute to load.
|
||||||
|
<div>
|
||||||
|
<button class="stream-button" onclick="document.getElementById('player').play()">Play</button>
|
||||||
|
<button class="stream-button" onclick="document.getElementById('player').pause();document.getElementById('player').src=document.getElementById('player').src;">Stop</button>
|
||||||
|
<button class="stream-button" onclick="document.getElementById('player').volume += 0.1">Vol +</button>
|
||||||
|
<button class="stream-button" onclick="document.getElementById('player').volume -= 0.1">Vol -</button>
|
||||||
|
</div>
|
||||||
|
</span>
|
||||||
|
|
||||||
<!-- lil face
|
<!-- lil face
|
||||||
<div class="lil-face loading">
|
<div class="lil-face loading">
|
||||||
<a href="https://silviolorusso.com" target="_blank">
|
<a href="https://silviolorusso.com" target="_blank">
|
||||||
@ -156,6 +168,38 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- SCRIPTS FOR THE NEW AUDIO PLAYER -->
|
||||||
|
<script>
|
||||||
|
(function(){
|
||||||
|
|
||||||
|
function waitForIt(selector, time) {
|
||||||
|
if(document.querySelector(selector)!=null) {
|
||||||
|
|
||||||
|
var chat_title = document.getElementsByClassName("chatbox-title__text")[0];
|
||||||
|
var element = document.createElement("span");
|
||||||
|
|
||||||
|
element.innerHTML = '<audio id="player" preload="none" src="http://w-i-t-m.net:8001/radiodrama"></audio><div><button onclick="document.getElementById(\'player\').play()">Play</button><button onclick="document.getElementById(\'player\').pause();document.getElementById(\'player\').src=document.getElementById(\'player\').src;">Stop</button><button onclick="document.getElementById(\'player\').volume += 0.1">Vol +</button><button onclick="document.getElementById(\'player\').volume -= 0.1">Vol -</button></div>';
|
||||||
|
|
||||||
|
chat_title.insertAdjacentElement('afterend', element);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setTimeout(function() {
|
||||||
|
|
||||||
|
waitForIt(selector, time);
|
||||||
|
|
||||||
|
}, time);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
waitForIt(".toggle-smiley", 1000);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||||||
|
|
||||||
|
|
||||||
<!-- button to hide side pannel -->
|
<!-- button to hide side pannel -->
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
Loading…
Reference in New Issue
Block a user