mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-12 20:16:15 -08:00
refactor: tauri support for mpv/vlc
This commit is contained in:
1 parent
4d8bac9645
commit
9f1b123078
17 files changed
+389
-42
No files matched your search
@@ -12,6 +12,7 @@ import { MatTooltipModule } from '@angular/material/tooltip';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Store } from '@ngrx/store';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { open } from '@tauri-apps/plugin-shell';
|
||||
import { NgxWhatsNewModule } from 'ngx-whats-new';
|
||||
import { HomeComponent } from '../../../home/home.component';
|
||||
import { DataService } from '../../../services/data.service';
|
||||
@@ -56,6 +57,9 @@ export class HeaderComponent implements OnInit {
|
||||
/** Environment flag */
|
||||
isElectron = this.dataService.isElectron;
|
||||
|
||||
/** Environment flag for Tauri */
|
||||
isTauri = this.dataService.getAppEnvironment() === 'tauri';
|
||||
|
||||
/** Visibility flag of the "what is new" modal dialog */
|
||||
isDialogVisible$ = this.whatsNewService.dialogState$;
|
||||
|
||||
@@ -121,8 +125,12 @@ export class HeaderComponent implements OnInit {
|
||||
* Opens the provided URL string in new browser window
|
||||
* @param url url to open
|
||||
*/
|
||||
openUrl(url: string): void {
|
||||
window.open(url, '_blank');
|
||||
async openUrl(url: string): Promise<void> {
|
||||
if (this.isTauri) {
|
||||
await open(url);
|
||||
} else {
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user