import { Component, Input, ContentChildren, QueryList, ElementRef, Renderer2, Output, EventEmitter, AfterContentInit, AfterViewInit, OnDestroy, inject, } from "@angular/core"; import * as InitPxVideo from "accessible-html5-video-player/js/px-video.js"; declare let InitPxVideo: new (config: InitPxVideoConfig) => unknown; // NOTE: Add px-video.js and strings.js files to your application .angular-cli.json script tag interface InitPxVideoConfig { videoId: string; captionsOnDefault: boolean; seekInterval: number; videoTitle: string; debug: boolean; } @Component({ selector: "sam-video-player", templateUrl: "./video-player.template.html", host: { "(document:fullscreenchange)": "onToggleFullScreen($event)", }, standalone: false, }) export class SamVideoPlayerComponent implements AfterContentInit, AfterViewInit, OnDestroy { private render = inject(Renderer2); private template = inject(ElementRef); @ContentChildren("videoPly", { descendants: true }) public videos: QueryList; @ContentChildren("videoTrack", { descendants: true }) public tracks: QueryList; @ContentChildren("videoSrc", { descendants: true }) public sources: QueryList; @Input() public videoId: string; @Input() public title: string; @Input() public captionOption: boolean; @Input() public seekInterval: number; @Output() public onFullScreenChange: EventEmitter = new EventEmitter(); private config: InitPxVideoConfig; ngAfterContentInit() { this.validateElement( this.videos, "SamVideoComponent must be provide a