Merge pull request #205 from SideQuestVR/bugfix/things

Bugfix/things
This commit is contained in:
SideQuest
2023-05-31 14:58:22 +02:00
committed by GitHub
7 changed files with 49 additions and 13 deletions
+3 -2
View File
@@ -5,7 +5,7 @@ jobs:
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, windows-latest, macOS-latest] os: [ubuntu-latest, windows-latest, macOS-11]
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with: with:
@@ -15,6 +15,7 @@ jobs:
node-version: '16.14.2' node-version: '16.14.2'
- name: "Install build deps on linux" - name: "Install build deps on linux"
run: | run: |
echo $RUNNER_OS;
if [ "$RUNNER_OS" == "Linux" ]; then if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install libusb-1.0-0-dev sudo apt-get install libusb-1.0-0-dev
sudo apt-get install libudev-dev sudo apt-get install libudev-dev
@@ -32,4 +33,4 @@ jobs:
GH_TOKEN: ${{ secrets.GH_TOKEN }} GH_TOKEN: ${{ secrets.GH_TOKEN }}
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }} WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
WIN_CSC_LINK: ${{ secrets.WIN_CSC_LINK }} WIN_CSC_LINK: ${{ secrets.WIN_CSC_LINK }}
run: yarn dist run: yarn dist
+4 -3
View File
@@ -454,8 +454,9 @@ export class AppService {
this.spinnerService.showLoader(); this.spinnerService.showLoader();
let task = { status: 'Downloading/Extracting ScrCpy...' }; let task = { status: 'Downloading/Extracting ScrCpy...' };
this.spinnerService.setMessage('', task); this.spinnerService.setMessage('', task);
let url = 'https://github.com/Genymobile/scrcpy/releases/download/v1.11/scrcpy-win64-v1.11.zip'; let url = 'https://github.com/Genymobile/scrcpy/releases/download/v2.0/scrcpy-win64-v2.0.zip';
let downloadPath = this.path.join(this.appData, 'scrcpy', 'scrcpy.exe'); let folderName = 'scrcpy-win64-v2.0';
let downloadPath = this.path.join(this.appData, folderName, 'scrcpy.exe');
if (this.doesFileExist(downloadPath)) { if (this.doesFileExist(downloadPath)) {
this.scrcpyBinaryPath = downloadPath; this.scrcpyBinaryPath = downloadPath;
this.spinnerService.hideLoader(); this.spinnerService.hideLoader();
@@ -480,7 +481,7 @@ export class AppService {
}); });
}; };
this.extract(path, { dir: this.path.join(this.appData, 'scrcpy') }, callback); this.extract(path, { dir: this.path.join(this.appData) }, callback);
this.scrcpyBinaryPath = downloadPath; this.scrcpyBinaryPath = downloadPath;
}); });
}); });
+4 -1
View File
@@ -126,7 +126,10 @@ export class ElectronService {
switch (url[0]) { switch (url[0]) {
case 'sidequest://w/': case 'sidequest://w/':
this.adbService this.adbService
.runAdbCommand('adb shell am start -a android.intent.action.VIEW -d ' + url[1], true) .runAdbCommand(
'adb shell am start -a android.intent.action.VIEW -d \'"' + new URL(url[1]).toString() + '"\'',
true
)
.then(() => { .then(() => {
this.statusService.showStatus('Launching WebXR in browser...', false, true); this.statusService.showStatus('Launching WebXR in browser...', false, true);
}); });
@@ -3,6 +3,7 @@
<div class="pure-material-button-contained spaced" (click)="runscrcpy()">Start Stream</div> <div class="pure-material-button-contained spaced" (click)="runscrcpy()">Start Stream</div>
<div class="pure-material-button-contained spaced" (click)="appService.opn('https://www.oculus.com/casting')">Oculus Casting</div> <div class="pure-material-button-contained spaced" (click)="appService.opn('https://www.oculus.com/casting')">Oculus Casting</div>
<div class="pure-material-button-contained spaced flat active" (click)="disableProximity(false)">Disable Proximity Sensor</div>
<div class="divider divider-margin-top margin-bottom"></div> <div class="divider divider-margin-top margin-bottom"></div>
<div class="row"> <div class="row">
@@ -37,14 +38,17 @@
Crop Crop
<div class="grey-text small"> <div class="grey-text small">
Crop the device screen on the server. The values are expressed in the device natural orientation (typically, Crop the device screen on the server. The values are expressed in the device natural orientation (typically,
portrait for a phone, landscape for a tablet). Any MaxSize value is computed on the cropped size. portrait for a phone, landscape for a tablet). Any MaxSize value is computed on the cropped size. The format is width:height:left:top.
</div> </div>
</div> </div>
<div class="col s12 input-field fixed-height"> <div class="col s12 input-field fixed-height">
<input id="crop_" [(ngModel)]="scrcpy_options.crop" type="text" /> <input id="crop_" [(ngModel)]="scrcpy_options.crop" type="text" />
<label for="crop_" class="active">Crop</label> <label for="crop_" class="active">Crop</label>
<div class="pure-material-button-contained spaced flat active" (click)="scrcpy_options.crop = '1280:720:1500:350'">Quest 1 Crop</div>
<div class="pure-material-button-contained spaced flat active" (click)="scrcpy_options.crop = '1600:900:2017:510'">Quest 2 Crop</div> <div class="pure-material-button-contained spaced flat active" (click)="scrcpy_options.crop = '1600:900:2017:510'">Quest 2 Crop</div>
<div class="pure-material-button-contained spaced flat active" (click)="scrcpy_options.crop = '1280:720:1500:350'">Quest 1 Crop</div>
<div class="grey-text small">
Please note the Quest Pro uses two slightly angled screens and therefore there isn't a crop setting that works out of the box, since the video would need to be corrected after the fact.
</div>
</div> </div>
<div class="col s12 fixed-height"> <div class="col s12 fixed-height">
Fullscreen Fullscreen
@@ -12,7 +12,7 @@ export class StreamOptionsComponent implements OnInit {
scrcpy_options: any = { scrcpy_options: any = {
always_on_top: false, always_on_top: false,
bit_rate: '8000000', bit_rate: '8000000',
crop: '1280:720:1500:350', crop: '1600:900:2017:510',
no_control: true, no_control: true,
fullscreen: false, fullscreen: false,
max_size: '0', max_size: '0',
@@ -35,4 +35,15 @@ export class StreamOptionsComponent implements OnInit {
.then(() => this.statusService.showStatus('Stream closed.')) .then(() => this.statusService.showStatus('Stream closed.'))
.catch(e => this.statusService.showStatus('ScrCpy Error: ' + JSON.stringify(e), true)); .catch(e => this.statusService.showStatus('ScrCpy Error: ' + JSON.stringify(e), true));
} }
disableProximity(shouldEnable) {
this.runAdbCommand('am broadcast -a com.oculus.vrpowermanager.' + (shouldEnable ? 'automation_disable' : 'prox_close'))
.then(() => {
this.statusService.showStatus((shouldEnable ? 'Enable' : 'Disable') + ' proximity message sent OK!!');
})
.catch(e => this.statusService.showStatus(e, true));
}
runAdbCommand(command: string) {
return this.adbService.adbCommand('shell', { command, serial: this.adbService.deviceSerial });
}
} }
+19 -3
View File
@@ -419,8 +419,12 @@ if (app.requestSingleInstanceLock()) {
function parseOpenUrl(argv: string[]) { function parseOpenUrl(argv: string[]) {
//fs.writeFileSync(path.join(app.getPath('appData'), 'SideQuest', 'test_output_loaded.txt'), JSON.stringify(argv)); //fs.writeFileSync(path.join(app.getPath('appData'), 'SideQuest', 'test_output_loaded.txt'), JSON.stringify(argv));
if (argv[1] && argv[1].length && argv[1].substr(0, 12) === 'sidequest://') { for (let arg of argv) {
setTimeout(() => mainWindow.webContents.send('open-url', argv[1].toString()), 5000); if (arg && arg.length && arg.substr(0, 12) === 'sidequest://') {
console.log('opening url ' + arg.toString());
setTimeout(() => mainWindow.webContents.send('open-url', arg.toString()), 5000);
break;
}
} }
} }
function addWindowDownloadHandler(window) { function addWindowDownloadHandler(window) {
@@ -621,7 +625,19 @@ function setupApp() {
app.on('activate', function() { app.on('activate', function() {
if (mainWindow === null) createWindow(); if (mainWindow === null) createWindow();
}); });
app.setAsDefaultProtocolClient('sidequest'); // remove so we can register each time as we run the app.
app.removeAsDefaultProtocolClient('sidequest');
// If we are running a non-packaged version of the app && on windows
if (process.env.NODE_ENV === 'dev' && process.platform === 'win32') {
console.log('Running in dev mode');
// Set the path of electron.exe and your app.
// These two additional parameters are only available on windows.
app.setAsDefaultProtocolClient('sidequest', process.execPath, [path.resolve(process.argv[1])]);
} else {
console.log('Running in production');
app.setAsDefaultProtocolClient('sidequest');
}
app.on('open-url', function(event, url) { app.on('open-url', function(event, url) {
event.preventDefault(); event.preventDefault();
}); });
+1 -1
View File
@@ -1,7 +1,7 @@
{ {
"name": "SideQuest", "name": "SideQuest",
"productName": "SideQuest", "productName": "SideQuest",
"version": "0.10.34", "version": "0.10.35",
"description": "A open app store for mobile android based VR devices such as the Levovo Mirage, Oculus Go, Oculus Quest, Vive Focus.", "description": "A open app store for mobile android based VR devices such as the Levovo Mirage, Oculus Go, Oculus Quest, Vive Focus.",
"repository": "https://github.com/SideQuestVR/SideQuest.git", "repository": "https://github.com/SideQuestVR/SideQuest.git",
"license": "UNLICENCED", "license": "UNLICENCED",