mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-14 05:06:16 -08:00
feat: add settings for custom mpv player path
This commit is contained in:
1 parent
702a82b50d
commit
3a7c1d8ad6
3 files changed
+39
-7
No files matched your search
@@ -90,6 +90,26 @@
|
||||
</div>
|
||||
</div>
|
||||
<mat-divider></mat-divider>
|
||||
<div class="row" *ngIf="settingsForm.value.player === 'mpv'">
|
||||
<div class="column">
|
||||
{{ 'SETTINGS.MPV_PLAYER_PATH_LABEL' | translate }}
|
||||
<p>{{ 'SETTINGS.MPV_PLAYER_PATH_DESCRIPTION' | translate }}</p>
|
||||
</div>
|
||||
<div class="column">
|
||||
<mat-form-field appearance="outline">
|
||||
<mat-label for="mpvPlayerPath">{{
|
||||
'SETTINGS.MPV_PLAYER_PATH' | translate
|
||||
}}</mat-label>
|
||||
<input
|
||||
matInput
|
||||
type="text"
|
||||
id="mpvPlayerPath"
|
||||
formControlName="mpvPlayerPath"
|
||||
/>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
</div>
|
||||
<mat-divider></mat-divider>
|
||||
<div class="row">
|
||||
<div class="column">
|
||||
{{ 'SETTINGS.LANGUAGE' | translate }}
|
||||
|
||||
@@ -12,7 +12,10 @@ import { Store } from '@ngrx/store';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { take } from 'rxjs';
|
||||
import * as semver from 'semver';
|
||||
import { EPG_FORCE_FETCH } from '../../../shared/ipc-commands';
|
||||
import {
|
||||
EPG_FORCE_FETCH,
|
||||
SET_MPV_PLAYER_PATH,
|
||||
} from '../../../shared/ipc-commands';
|
||||
import { Playlist } from '../../../shared/playlist.interface';
|
||||
import { DataService } from '../services/data.service';
|
||||
import { DialogService } from '../services/dialog.service';
|
||||
@@ -51,12 +54,13 @@ export class SettingsComponent implements OnInit {
|
||||
label: 'VideoJs Player',
|
||||
},
|
||||
...(this.isElectron
|
||||
? [
|
||||
{
|
||||
id: VideoPlayer.MPV,
|
||||
label: 'MPV Player',
|
||||
},
|
||||
]
|
||||
?
|
||||
[
|
||||
{
|
||||
id: VideoPlayer.MPV,
|
||||
label: 'MPV Player',
|
||||
},
|
||||
]
|
||||
: []),
|
||||
];
|
||||
|
||||
@@ -79,6 +83,7 @@ export class SettingsComponent implements OnInit {
|
||||
language: Language.ENGLISH,
|
||||
showCaptions: false,
|
||||
theme: Theme.LightTheme,
|
||||
mpvPlayerPath: '',
|
||||
});
|
||||
|
||||
/** Form array with epg sources */
|
||||
@@ -132,6 +137,7 @@ export class SettingsComponent implements OnInit {
|
||||
theme: settings.theme
|
||||
? settings.theme
|
||||
: Theme.LightTheme,
|
||||
mpvPlayerPath: settings.mpvPlayerPath,
|
||||
});
|
||||
|
||||
if (this.isElectron) {
|
||||
@@ -219,6 +225,11 @@ export class SettingsComponent implements OnInit {
|
||||
.subscribe(() => {
|
||||
this.applyChangedSettings();
|
||||
});
|
||||
|
||||
this.electronService.sendIpcEvent(
|
||||
SET_MPV_PLAYER_PATH,
|
||||
this.settingsForm.value.mpvPlayerPath
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,4 +20,5 @@ export interface Settings {
|
||||
language: Language;
|
||||
showCaptions: boolean;
|
||||
theme: Theme;
|
||||
mpvPlayerPath: string;
|
||||
}
|
||||
Reference in new issue
Block a user