mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-13 04:26:16 -08:00
feat: global subtitle display setting
You can now activate/deactivate the visiblity of subtitles on a global application level.
This commit is contained in:
15 files changed
+209
-144
No files matched your search
@@ -5,7 +5,7 @@ import { StorageMap } from '@ngx-pwa/local-storage';
|
||||
import { Router } from '@angular/router';
|
||||
import { MatSnackBar } from '@angular/material/snack-bar';
|
||||
import { Observable, Subscription } from 'rxjs';
|
||||
import { Settings } from './settings.interface';
|
||||
import { Settings, VideoPlayer } from './settings.interface';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import * as semver from 'semver';
|
||||
import { ElectronService } from '../services/electron.service';
|
||||
@@ -34,11 +34,11 @@ export class SettingsComponent implements OnInit, OnDestroy {
|
||||
/** Player options */
|
||||
players = [
|
||||
{
|
||||
id: 'html5',
|
||||
id: VideoPlayer.Html5Player,
|
||||
label: 'HTML5 Video Player',
|
||||
},
|
||||
{
|
||||
id: 'videojs',
|
||||
id: VideoPlayer.VideoJs,
|
||||
label: 'VideoJs Player',
|
||||
},
|
||||
];
|
||||
@@ -84,9 +84,10 @@ export class SettingsComponent implements OnInit, OnDestroy {
|
||||
private translate: TranslateService
|
||||
) {
|
||||
this.settingsForm = this.formBuilder.group({
|
||||
player: ['videojs'],
|
||||
player: [VideoPlayer.VideoJs],
|
||||
epgUrl: '',
|
||||
language: Language.ENGLISH,
|
||||
showCaptions: false,
|
||||
theme: Theme.LightTheme,
|
||||
});
|
||||
|
||||
@@ -123,11 +124,16 @@ export class SettingsComponent implements OnInit, OnDestroy {
|
||||
this.storage.get('settings').subscribe((settings: Settings) => {
|
||||
if (settings) {
|
||||
this.settingsForm.setValue({
|
||||
player: settings.player ? settings.player : 'videojs',
|
||||
player: settings.player
|
||||
? settings.player
|
||||
: VideoPlayer.VideoJs,
|
||||
epgUrl: settings.epgUrl ? settings.epgUrl : '',
|
||||
language: settings.language
|
||||
? settings.language
|
||||
: Language.ENGLISH,
|
||||
showCaptions: settings.showCaptions
|
||||
? settings.showCaptions
|
||||
: false,
|
||||
theme: settings.theme
|
||||
? settings.theme
|
||||
: Theme.LightTheme,
|
||||
|
||||
Reference in new issue
Block a user