So I want a way to control the volume of the actual tablet from Sharptools. I usually see topics to adjust external speakers, but I want the actual tablet or bluetooth speakers to adjust.
I’m completely unfamiliar with web development, but I know other people have been searching for this and I’m hoping someone can help me or build further on what I’m trying to do.
At the moment I have a few buttons with different volume levels in a custom tile. It’s simple Javascript and it’s just a set of buttons, which open the remote admin link to set a certain volume leven. This opens a tab, which closes by itself within a second, which usually is enough to load up the change in volume.
Now I’m stuck at my next “want”. I want it to be a slider, which would update after release (so it doesn’t start spamming updates to remote admin). I would want it to be in 20% increments, to not have overly many volume options.
But since I’m just learning this as of this week, it’s too complicated just yet. My other idea besides the slider, would be to have some kind of bars graphic, where every bar triggers the link and changes colour.
PS: Maybe this could be a vanilla tile, to work with Fully Kiosk? As a configuration you could select which audio stream needs to be affected. In my case this is Stream=3 for audio stream, I believe bluetooth is 9.
Here’s my code at the moment:
<!DOCTYPE html>
<html>
<head>
<title>Close popup window</title>
</head>
<body>
<Button type="button" onclick="volume0()">Mute</button><br>
<Button type="button" onclick="volume15()">Volume 15</button><br>
<Button type="button" onclick="volume30()">Volume 30</button><br>
<Button type="button" onclick="volume45()">Volume 45</button><br>
<Button type="button" onclick="volume60()">Volume 60</button><br>
<Button type="button" onclick="volume75()">Volume 75</button><br>
<Button type="button" onclick="volume90()">Volume 90</button>
<script type="text/javascript">
function volume0(){
var popupwin = window.open('IP ADDRESS/?cmd=setAudioVolume&level=0&stream=3&password=XXX','Volume 0','width=50,height=50,left=5,top=3');
setTimeout(function() { popupwin.close();}, 1000);
}
function volume15(){
var popupwin = window.open('IP ADDRESS/?cmd=setAudioVolume&level=15&stream=3&password=XXX','Volume 15','width=50,height=50,left=5,top=3');
setTimeout(function() { popupwin.close();}, 1000);
}
function volume30(){
var popupwin = window.open('IP ADDRESS/?cmd=setAudioVolume&level=30&stream=3&password=XXX','Volume 30','width=50,height=50,left=5,top=3');
setTimeout(function() { popupwin.close();}, 1000);
}
function volume45(){
var popupwin = window.open('IP ADDRESS/?cmd=setAudioVolume&level=45&stream=3&password=XXX','Volume 45','width=50,height=50,left=5,top=3');
setTimeout(function() { popupwin.close();}, 1000);
}
function volume60(){
var popupwin = window.open('IP ADDRESS/?cmd=setAudioVolume&level=60&stream=3&password=XXX','Volume 60','width=50,height=50,left=5,top=3');
setTimeout(function() { popupwin.close();}, 1000);
}
function volume75(){
var popupwin = window.open('IP ADDRESS/?cmd=setAudioVolume&level=75&stream=3&password=XXX','Volume 75','width=50,height=50,left=5,top=3');
setTimeout(function() { popupwin.close();}, 1000);
}
function volume90(){
var popupwin = window.open('IP ADDRESS/?cmd=setAudioVolume&level=90&stream=3&password=XXX','Volume 90','width=50,height=50,left=5,top=3');
setTimeout(function() { popupwin.close();}, 1000);
}
</script>
</body>
</html>