You've already forked fm-dx-webserver
mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-02-26 22:13:53 +01:00
lotta bugfixes
This commit is contained in:
@@ -34,14 +34,20 @@ function OnConnectivityCallback(isConnected) {
|
||||
}
|
||||
}
|
||||
|
||||
function isIOS() {
|
||||
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
||||
}
|
||||
|
||||
function OnPlayButtonClick(_ev) {
|
||||
const $playbutton = $('.playbutton');
|
||||
const isiOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
||||
|
||||
if (Stream) {
|
||||
console.log("Stopping stream...");
|
||||
shouldReconnect = false;
|
||||
destroyStream();
|
||||
$playbutton.find('.fa-solid').toggleClass('fa-stop fa-play');
|
||||
if ('audioSession' in navigator) {
|
||||
if (isiOS && 'audioSession' in navigator) {
|
||||
navigator.audioSession.type = "none";
|
||||
}
|
||||
} else {
|
||||
@@ -50,10 +56,11 @@ function OnPlayButtonClick(_ev) {
|
||||
createStream();
|
||||
Stream.Start();
|
||||
$playbutton.find('.fa-solid').toggleClass('fa-play fa-stop');
|
||||
if ('audioSession' in navigator) {
|
||||
navigator.audioSession.type = "playback"; // Android background play fix
|
||||
if (isiOS && 'audioSession' in navigator) {
|
||||
navigator.audioSession.type = "playback";
|
||||
}
|
||||
}
|
||||
|
||||
$playbutton.addClass('bg-gray').prop('disabled', true);
|
||||
setTimeout(() => {
|
||||
$playbutton.removeClass('bg-gray').prop('disabled', false);
|
||||
|
||||
Reference in New Issue
Block a user