mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-06-23 15:30:34 -04:00
Supporting custom fonts
This commit is contained in:
parent
a006cc3f9f
commit
0ed1b8afc0
@ -15,6 +15,7 @@ import { DomSanitizer, Title } from "@angular/platform-browser";
|
||||
import { ActivatedRoute, Event, NavigationCancel, NavigationEnd, NavigationStart, Router } from "@angular/router";
|
||||
import { OidcSecurityService } from "angular-auth-oidc-client";
|
||||
import * as Hls from "hls.js";
|
||||
import { ShowService } from "../../services/api.service";
|
||||
import {
|
||||
getWhatIsSupported,
|
||||
method,
|
||||
@ -160,7 +161,8 @@ export class PlayerComponent implements OnInit, OnDestroy, AfterViewInit
|
||||
private title: Title,
|
||||
private router: Router,
|
||||
private location: Location,
|
||||
private injector: Injector)
|
||||
private injector: Injector,
|
||||
private shows: ShowService)
|
||||
{ }
|
||||
|
||||
ngOnInit()
|
||||
@ -405,7 +407,7 @@ export class PlayerComponent implements OnInit, OnDestroy, AfterViewInit
|
||||
document.body.requestFullscreen();
|
||||
}
|
||||
|
||||
selectSubtitle(subtitle: Track | number, changeUrl: boolean = true)
|
||||
async selectSubtitle(subtitle: Track | number, changeUrl: boolean = true)
|
||||
{
|
||||
if (typeof(subtitle) === "number")
|
||||
{
|
||||
@ -460,9 +462,11 @@ export class PlayerComponent implements OnInit, OnDestroy, AfterViewInit
|
||||
{
|
||||
if (!this.subtitlesManager)
|
||||
{
|
||||
let fonts: {[key: string]: string} = await this.shows.getFonts(this.item.showSlug).toPromise();
|
||||
this.subtitlesManager = new SubtitlesOctopus({
|
||||
video: this.player,
|
||||
subUrl: `subtitle/${subtitle.slug}`
|
||||
subUrl: `subtitle/${subtitle.slug}`,
|
||||
fonts: Object.values(fonts)
|
||||
});
|
||||
}
|
||||
else
|
||||
|
@ -159,6 +159,11 @@ export class ShowService extends CrudApi<Show>
|
||||
return this.client.get<Page<Show>>(`/api/collections/${collection}/shows${this.ArgsAsQuery(args)}`)
|
||||
.pipe(map(x => Object.assign(new Page<Show>(), x)));
|
||||
}
|
||||
|
||||
getFonts(id: string | number): Observable<{[font: string]: string}>
|
||||
{
|
||||
return this.client.get<any>(`/api/shows/${id}/fonts`);
|
||||
}
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
|
Loading…
x
Reference in New Issue
Block a user