added disable proximity option to the streaming screen, added more copy and set the defaults to Quest 2

This commit is contained in:
metashamone
2023-05-30 18:57:18 +02:00
parent 9b1aa2f0d5
commit 84086a115a
2 changed files with 18 additions and 3 deletions
@@ -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 });
}
}