added support for scrcpy to linux and mac builds

This commit is contained in:
Shane Harris
2020-08-17 13:31:48 +01:00
committed by Your Name
parent 86b6e627d2
commit eb9b88123a
4 changed files with 22 additions and 7 deletions
Binary file not shown.
+21 -1
View File
@@ -300,7 +300,7 @@ export class AppService {
return `${packageString} ${nodeString} ${computerString}`;
}
runScrCpy(options: any) {
startScrCpy(options: any) {
return new Promise((resolve, reject) => {
let command =
'"' +
@@ -329,6 +329,24 @@ export class AppService {
});
}
runScrCpy(options: any) {
let platform = this.os.platform();
if (platform === 'linux' || platform === 'darwin') {
return new Promise((resolve, reject) => {
this.exec('scrcpy -v', (err, stdout, stderr) => {
if (err) {
return reject(err);
}
this.startScrCpy(options)
.then(resolve)
.catch(reject);
});
});
} else {
return this.startScrCpy(options);
}
}
downloadScrCpyBinary() {
if (this.os.platform() === 'win32') {
this.spinnerService.showLoader();
@@ -364,6 +382,8 @@ export class AppService {
this.scrcpyBinaryPath = downloadPath;
});
});
} else {
this.scrcpyBinaryPath = 'scrcpy';
}
}
deleteFolderRecursive(path) {
@@ -154,7 +154,7 @@
class="material-icons white-text no-outline" position="bottom" tooltip="Forward">
arrow_forward
</i>
<i mz-tooltip *ngIf="isConnected()&&osPlatform === 'win32'" (click)="scrcpyModal.openModal();"
<i mz-tooltip *ngIf="isConnected()" (click)="scrcpyModal.openModal();"
class="material-icons white-text no-outline top-menu-bar-icon" position="bottom"
tooltip="Stream from your headset to your PC with ScrCpy.">
live_tv
@@ -42,14 +42,9 @@ export class HeaderComponent implements OnInit {
safeResolve: any = val => val;
folder = FolderType;
addrepoUrl: string = '';
colorA: string;
colorB: string;
beatOnLoading: boolean;
isAlive: boolean = true;
isAliveChecking: boolean = false;
replaceText: ReplaceText[] = [];
addkey: string;
addvalue: string;
adbCommandToRun: string;
osPlatform: string;
favourites: {