This is repo hosts experiments for the broadcast (aka narrowcast) webpage at Varia.zone
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

169 lines
4.4 KiB

// SCRIPTS FOR THE NEW AUDIO PLAYER
(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);
})();
$(function() {
console.log("PARENT READY");
$("iframe").on("load", function(){
console.log("LOADED");
$(this).contents().find('.kiwi-startup-common').hide();
});
});
// SCRIPT for button to hide side pannel -->
function fside() {
var element = document.getElementById("side");
element.classList.toggle("sideminclicked");
}
function fsidemobile(x) {
if (x.matches) { // If media query matches
var element = document.getElementById("side");
element.classList.toggle("sideminclicked");
} else {
element.classList.toggle("");
}
}
var x = window.matchMedia("(max-width: 768px)")
fsidemobile(x)
x.addListener(fsidemobile)
function hideshowWelcome() {
var elwel = document.getElementById("showWel");
elwel.classList.toggle("hide");
var bwel = document.getElementById("bhide_wel");
bwel.classList.toggle("bhide_chat_off")
}
function hideshowChat() {
var elchat = document.getElementById("showChat");
elchat.classList.toggle("hide");
var bchat = document.getElementById("bhide_chat");
bchat.classList.toggle("bhide_chat_off")
}
function hideshowPad() {
var elether = document.getElementById("showEther");
elether.classList.toggle("hide");
var bether = document.getElementById("bhide_ether");
bether.classList.toggle("bhide_chat_off")
}
function hideshowAudio() {
var elau = document.getElementById("showAudio");
elau.classList.toggle("hide");
var bau = document.getElementById("bhide_au");
bau.classList.toggle("bhide_chat_off")
}
function hideshowJitsi() {
var eljit = document.getElementById("showJit");
eljit.classList.toggle("hide");
var bjit = document.getElementById("bhide_jit");
bjit.classList.toggle("bhide_chat_off")
}
function hideshowEssay() {
var eless = document.getElementById("showEssay");
eless.classList.toggle("hide");
var bess = document.getElementById("bhide_ess");
bess.classList.toggle("bhide_chat_off")
}
function hideshowVideo() {
var elvid = document.getElementById("showVideo");
elvid.classList.toggle("hide");
var bvid = document.getElementById("bhide_vid");
bvid.classList.toggle("bhide_chat_off")
}
function hideshowIMG() {
var elimg = document.getElementById("showImg");
elimg.classList.toggle("hide");
var bimg = document.getElementById("bhide_img");
bimg.classList.toggle("bhide_chat_off")
}
function hideshowGal() {
var elgal = document.getElementById("showGal");
elgal.classList.toggle("hide");
var bgal = document.getElementById("bhide_gal");
bgal.classList.toggle("bhide_chat_off")
}
// src="https://vjs.zencdn.net/7.10.2/video.min.js"
// var player = videojs("#player");
// var aud1= document.getElementById('audioBG');
// var dur1= document.getElementById('dur1');
// function mDur(dur,aud){dur.max= aud.duration};
// function mPlay(dur,aud){dur.value=aud.currentTime};
// function mSet(dur,aud){aud.currentTime=dur.value};
// function playpause(podcast){
// var myAudio = document.getElementById(podcast);
// var myIcon = document.querySelector("."+podcast);
// if (myAudio.paused) {
// myIcon.className = podcast+" fa b-pause";
// myAudio.play();
// } else {
// myIcon.className = podcast+" fa b-play";
// myAudio.pause();
// }
// }