You've already forked fm-dx-webserver
mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-02-27 06:23:53 +01:00
bugfixes, accessibility settings
This commit is contained in:
@@ -72,7 +72,7 @@ var Fallback = /** @class */ (function () {
|
||||
Fallback.prototype.Init = function (webSocket) {
|
||||
this.MobileUnmute();
|
||||
this.WebSocket = webSocket;
|
||||
this.WebSocket.Send(JSON.stringify({
|
||||
this.WebSocket?.Send(JSON.stringify({
|
||||
"type": "fallback",
|
||||
"data": this.SelectedFormatName
|
||||
}));
|
||||
|
||||
@@ -4,15 +4,17 @@ let Stream;
|
||||
function Init(_ev) {
|
||||
try {
|
||||
const settings = new _3LAS_Settings();
|
||||
Stream = new _3LAS(null, settings);
|
||||
if (!Stream) { // Ensure Stream is not re-initialized
|
||||
Stream = new _3LAS(null, settings);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return;
|
||||
}
|
||||
|
||||
Stream.ConnectivityCallback = OnConnectivityCallback;
|
||||
$(".playbutton").on('click', OnPlayButtonClick);
|
||||
$("#volumeSlider").on("input", updateVolume);
|
||||
$(".playbutton").off('click').on('click', OnPlayButtonClick); // Ensure only one event handler is attached
|
||||
$("#volumeSlider").off("input").on("input", updateVolume); // Ensure only one event handler is attached
|
||||
}
|
||||
|
||||
function OnConnectivityCallback(isConnected) {
|
||||
@@ -22,21 +24,20 @@ function OnConnectivityCallback(isConnected) {
|
||||
function OnPlayButtonClick(_ev) {
|
||||
const $playbutton = $('.playbutton');
|
||||
$playbutton.find('.fa-solid').toggleClass('fa-play fa-stop');
|
||||
try {
|
||||
if (Stream.ConnectivityFlag) {
|
||||
Stream.Stop();
|
||||
} else {
|
||||
Stream.Start();
|
||||
$playbutton.addClass('bg-gray').prop('disabled', true);
|
||||
setTimeout(() => {
|
||||
$playbutton.removeClass('bg-gray').prop('disabled', false);
|
||||
}, 3000);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
if (Stream.ConnectivityFlag) {
|
||||
Stream.Stop();
|
||||
} else {
|
||||
Stream.Start();
|
||||
$playbutton.addClass('bg-gray').prop('disabled', true);
|
||||
setTimeout(() => {
|
||||
$playbutton.removeClass('bg-gray').prop('disabled', false);
|
||||
}, 3000);
|
||||
}
|
||||
}
|
||||
|
||||
function updateVolume() {
|
||||
Stream.Volume = $(this).val();
|
||||
}
|
||||
|
||||
$(document).ready(Init);
|
||||
Reference in New Issue
Block a user