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 }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
os: [ubuntu-latest, windows-latest, macOS-11]
steps:
- uses: actions/checkout@v2
with:
@@ -15,6 +15,7 @@ jobs:
node-version: '16.14.2'
- name: "Install build deps on linux"
run: |
echo $RUNNER_OS;
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install libusb-1.0-0-dev
sudo apt-get install libudev-dev
@@ -32,4 +33,4 @@ jobs:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
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();
let task = { status: 'Downloading/Extracting ScrCpy...' };
this.spinnerService.setMessage('', task);
let url = 'https://github.com/Genymobile/scrcpy/releases/download/v1.11/scrcpy-win64-v1.11.zip';
let downloadPath = this.path.join(this.appData, 'scrcpy', 'scrcpy.exe');
let url = 'https://github.com/Genymobile/scrcpy/releases/download/v2.0/scrcpy-win64-v2.0.zip';
let folderName = 'scrcpy-win64-v2.0';
let downloadPath = this.path.join(this.appData, folderName, 'scrcpy.exe');
if (this.doesFileExist(downloadPath)) {
this.scrcpyBinaryPath = downloadPath;
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;
});
});
+4 -1
View File
@@ -126,7 +126,10 @@ export class ElectronService {
switch (url[0]) {
case 'sidequest://w/':
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(() => {
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)="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="row">
@@ -37,14 +38,17 @@
Crop
<div class="grey-text small">
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 class="col s12 input-field fixed-height">
<input id="crop_" [(ngModel)]="scrcpy_options.crop" type="text" />
<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 = '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 class="col s12 fixed-height">
Fullscreen
@@ -12,7 +12,7 @@ export class StreamOptionsComponent implements OnInit {
scrcpy_options: any = {
always_on_top: false,
bit_rate: '8000000',
crop: '1280:720:1500:350',
crop: '1600:900:2017:510',
no_control: true,
fullscreen: false,
max_size: '0',
@@ -35,4 +35,15 @@ export class StreamOptionsComponent implements OnInit {
.then(() => this.statusService.showStatus('Stream closed.'))
.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[]) {
//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://') {
setTimeout(() => mainWindow.webContents.send('open-url', argv[1].toString()), 5000);
for (let arg of argv) {
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) {
@@ -621,7 +625,19 @@ function setupApp() {
app.on('activate', function() {
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) {
event.preventDefault();
});
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "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.",
"repository": "https://github.com/SideQuestVR/SideQuest.git",
"license": "UNLICENCED",