Skip to content

Commit

Permalink
Merge pull request #82 from giongto35/virtualization-switch
Browse files Browse the repository at this point in the history
Fix when Virtualization switch to false
  • Loading branch information
giongto35 committed Oct 18, 2021
2 parents cbe4e6c + 7cb95d6 commit 0eef603
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion config.yaml
Expand Up @@ -6,7 +6,7 @@ pageTitle: "Spider" # Page Title: To display on webpage
appName: Spider # App name: to show in discovery
appMode: collaborative # app mode: collaborative/single (ex. collaborative: multiple user using same game session)
hasChat: true # Turn on chat
virtualize: true # For Windows, Run in VM (Sandbox) if true. Linux is already fully virtualized with Docker+Wine.
virtualize: false # For Windows, Run in VM (Sandbox) if true. Linux is already fully virtualized with Docker+Wine.

#Need to specify path
# path: /apps/nfhdemo/bin # Directory to the app. NOTE: It's the path in winvm
Expand Down
19 changes: 10 additions & 9 deletions run-app.ps1
Expand Up @@ -19,16 +19,17 @@ sleep 2
# x86_64-w64-mingw32-g++ $PSScriptRoot\winvm\syncinput.cpp -o $PSScriptRoot\winvm\syncinput.exe -lws2_32 -lpthread -static
if ($isSandbox -eq "sandbox") {
Start-Process $PSScriptRoot/winvm/pkg/ffmpeg/ffmpeg.exe -PassThru -NoNewWindow -ArgumentList "-f gdigrab -framerate 30 -i title=`"$title`" -pix_fmt yuv420p -vf scale=1280:-2 -tune zerolatency -c:v libx264 -f rtp rtp://$hostIP`:5004"
sleep 2
while ($true) {
Start-Process -Wait $PSScriptRoot/winvm/syncinput.exe -PassThru -NoNewWindow -ArgumentList "$title", ".", "windows", $hostIP
}
# Restart on failure. Using service to restart on failure, not working now
# $syncinput = New-Service -Name "Syncinput" -BinaryPathName "$PSScriptRoot\winvm\syncinput.exe $title . windows $hostIP"
# sc failure Syncinput reset= 30 actions= restart/5000
# $syncinput.Start()
}
else {
Start-Process ffmpeg -PassThru -ArgumentList "-f gdigrab -framerate 30 -i title=`"$title`" -vf scale=1280:-2 -tune zerolatency -c:v libx264 -f rtp rtp://127.0.0.1:5004"
}
sleep 2
# Restart on failure. Using service to restart on failure, not working now
# $syncinput = New-Service -Name "Syncinput" -BinaryPathName "$PSScriptRoot\winvm\syncinput.exe $title . windows $hostIP"
# sc failure Syncinput reset= 30 actions= restart/5000
# $syncinput.Start()

while ($true) {
Start-Process -Wait $PSScriptRoot/winvm/syncinput.exe -PassThru -NoNewWindow -ArgumentList "$title", ".", "windows", $hostIP
sleep 2
Start-Process -PassThru $PSScriptRoot/winvm/syncinput.exe -ArgumentList "$title", ".", "windows"
}

0 comments on commit 0eef603

Please sign in to comment.