1
0
mirror of https://github.com/KubaPro010/fm-dx-webserver.git synced 2026-02-27 06:23:53 +01:00

bugfixes / more code cleanup

This commit is contained in:
NoobishSVK
2024-03-21 22:30:18 +01:00
parent 0f10e04bcd
commit 8f4c96ce12
12 changed files with 166 additions and 81 deletions

View File

@@ -1,16 +1,7 @@
"use strict";
var fs = require('fs');
let serverConfig = {
audio: {
audioBitrate: "128k"
},
};
if(fs.existsSync('./config.json')) {
const configFileContents = fs.readFileSync('./config.json', 'utf8');
serverConfig = JSON.parse(configFileContents);
}
const ffmpegStaticPath = require('ffmpeg-static');
const {serverConfig} = require('../server_config')
/*
Stdin streamer is part of 3LAS (Low Latency Live Audio Streaming)
@@ -50,12 +41,7 @@ const child_process_1 = require("child_process");
const ws = __importStar(require("ws"));
const wrtc = require('wrtc');
const Settings = JSON.parse((0, fs_1.readFileSync)('server/stream/settings.json', 'utf-8'));
const FFmpeg_command = (() => {
if (process.platform === 'win32')
return Settings.FallbackFFmpegPath;
else if (process.platform === 'linux')
return "ffmpeg";
})();
const FFmpeg_command = ffmpegStaticPath;
class RtcProvider {
constructor() {
this.RtcDistributePeer = new wrtc.RTCPeerConnection(Settings.RtcConfig);