upd
This commit is contained in:
+1
-1
@@ -1 +1 @@
|
||||
VITE_API_URL=http://localhost:3000
|
||||
VITE_API_URL=http://192.168.1.23:3000
|
||||
@@ -150,21 +150,24 @@ function SessionPage() {
|
||||
</div>
|
||||
|
||||
{/* Pixel Streaming Player - показывается когда сессия запущена */}
|
||||
{session.status === "started" && session.playerPort && (
|
||||
<div className="mb-6 aspect-video">
|
||||
<PixelStreamingWrapper
|
||||
initialSettings={{
|
||||
ss: `ws://127.0.0.1:${session.playerPort}`,
|
||||
AutoPlayVideo: true,
|
||||
AutoConnect: true,
|
||||
StartVideoMuted: true,
|
||||
HoveringMouse: true,
|
||||
WaitForStreamer: true,
|
||||
}}
|
||||
// onVideoInitialized={() => setIsVideoInitialized(true)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{session.status === "started" &&
|
||||
session.mode === "stream" &&
|
||||
session.server?.localIp &&
|
||||
session.playerPort && (
|
||||
<div className="mb-6 aspect-video">
|
||||
<PixelStreamingWrapper
|
||||
initialSettings={{
|
||||
ss: `ws://${session.server.localIp}:${session.playerPort}`,
|
||||
AutoPlayVideo: true,
|
||||
AutoConnect: true,
|
||||
StartVideoMuted: true,
|
||||
HoveringMouse: true,
|
||||
WaitForStreamer: true,
|
||||
}}
|
||||
// onVideoInitialized={() => setIsVideoInitialized(true)}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Основная карточка с информацией */}
|
||||
<div className="grid gap-6 mb-6 md:grid-cols-2">
|
||||
|
||||
@@ -32,7 +32,7 @@ function TestPage() {
|
||||
const response = await api
|
||||
.post("sessions", {
|
||||
json: {
|
||||
appId: "c1a06420-ca72-4a89-893e-3fe669bbbb99",
|
||||
appId: "2914d736-b928-461c-b58f-e5d35d8b605d",
|
||||
mode: "stream",
|
||||
tier: "demo",
|
||||
},
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"keep": {
|
||||
"days": true,
|
||||
"amount": 14
|
||||
},
|
||||
"auditLog": "logs\\.6c25b665cc60dab90c3b387b2a7b4da90595b19b-audit.json",
|
||||
"files": [
|
||||
{
|
||||
"date": 1760357222809,
|
||||
"name": "logs\\server-2025-10-13.log",
|
||||
"hash": "d8c9aa8fe14287c28a5e6d97abfc99880c7be890d8f58eb2229e747850d1ac12"
|
||||
}
|
||||
],
|
||||
"hashType": "sha256"
|
||||
}
|
||||
+21
-22
@@ -481,7 +481,7 @@ async function startApplication(session: SessionData): Promise<void> {
|
||||
streamerPort = await findFreePort(8080, 9000);
|
||||
playerPort = await findFreePort(Math.min(streamerPort + 1, 9000), 9000);
|
||||
sfuPort = await findFreePort(Math.min(playerPort + 1, 9000), 9000);
|
||||
|
||||
|
||||
console.log(
|
||||
`[${new Date().toISOString()}] 🔌 Найдены свободные порты - Streamer: ${streamerPort}, Player: ${playerPort}, SFU: ${sfuPort}`
|
||||
);
|
||||
@@ -514,8 +514,6 @@ async function startApplication(session: SessionData): Promise<void> {
|
||||
playerPort.toString(),
|
||||
"--sfu_port",
|
||||
sfuPort.toString(),
|
||||
"--max_players",
|
||||
"0",
|
||||
],
|
||||
{
|
||||
detached: false,
|
||||
@@ -554,7 +552,6 @@ async function startApplication(session: SessionData): Promise<void> {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Обработка завершения Cirrus процесса
|
||||
cirrusProcess.on("exit", async (code, signal) => {
|
||||
console.log(
|
||||
@@ -585,12 +582,18 @@ async function startApplication(session: SessionData): Promise<void> {
|
||||
appProcess = spawn(
|
||||
appPath,
|
||||
[
|
||||
`-PixelStreamingURL=ws://127.0.0.1:${streamerPort}`,
|
||||
"-PixelStreamingIP=127.0.0.1",
|
||||
`-PixelStreamingPort=${streamerPort}`,
|
||||
"-ForceRes",
|
||||
"-ResX=1920",
|
||||
"-ResY=1080",
|
||||
"-Unattended",
|
||||
"-RenderOffScreen",
|
||||
"-PixelStreamingWebRTCMinBitrate=5000000",
|
||||
"-PixelStreamingWebRTCMaxBitrate=20000000",
|
||||
"-PixelStreamingH264Profile=HIGH",
|
||||
"-PixelStreamingWebRTCDisableReceiveAudio=true",
|
||||
"-PixelStreamingEncoderRateControl=VBR",
|
||||
],
|
||||
{
|
||||
detached: false,
|
||||
@@ -604,22 +607,12 @@ async function startApplication(session: SessionData): Promise<void> {
|
||||
);
|
||||
} else {
|
||||
// Local-режим: запускаем без Pixel Streaming
|
||||
appProcess = spawn(
|
||||
appPath,
|
||||
[
|
||||
"-ForceRes",
|
||||
"-ResX=1920",
|
||||
"-ResY=1080",
|
||||
"-Unattended",
|
||||
"-RenderOffScreen",
|
||||
],
|
||||
{
|
||||
detached: false,
|
||||
stdio: ["ignore", "ignore", "pipe"],
|
||||
windowsHide: true,
|
||||
cwd: `C:\\apps\\${app.name}`,
|
||||
}
|
||||
);
|
||||
appProcess = spawn(appPath, [], {
|
||||
detached: false,
|
||||
stdio: ["ignore", "ignore", "pipe"],
|
||||
windowsHide: true,
|
||||
cwd: `C:\\apps\\${app.name}`,
|
||||
});
|
||||
console.log(
|
||||
`[${new Date().toISOString()}] 💻 Local-режим: приложение запускается без Pixel Streaming`
|
||||
);
|
||||
@@ -699,7 +692,13 @@ async function startApplication(session: SessionData): Promise<void> {
|
||||
|
||||
// Обновить статус на "started" с PID приложения
|
||||
// Для stream-режима также сохраняем Cirrus PID и порты
|
||||
if (mode === "stream" && cirrusPid && streamerPort && playerPort && sfuPort) {
|
||||
if (
|
||||
mode === "stream" &&
|
||||
cirrusPid &&
|
||||
streamerPort &&
|
||||
playerPort &&
|
||||
sfuPort
|
||||
) {
|
||||
await updateSessionStatus(
|
||||
sessionId,
|
||||
"started",
|
||||
|
||||
Reference in New Issue
Block a user