import { noop } from '../../../utils/unit' ; import { FullscreenController } from '../../core/player/fullscreen/FullscreenController' ; import { VideoPresentationController } from './VideoPresentationController' ; /**
 * Extends the base `FullscreenController` with additional logic for handling fullscreen
 * on iOS Safari where the native Fullscreen API is not available (in this case it fallsback to
 * using the `VideoPresentationController`).
 */ export class VideoFullscreenController extends FullscreenController { constructor ( protected host , protected presentationController ) { super ( host ) ; } get isFullscreen ( ) : boolean { return this . presentationController . isFullscreenMode ; } link get isSupported ( ) : boolean { return this . presentationController . isSupported ; } protected async makeEnterFullscreenRequest ( ) { return this . presentationController . setPresentationMode ( 'fullscreen' ) ; } protected async makeExitFullscreenRequest ( ) { return this . presentationController . setPresentationMode ( 'inline' ) ; } protected addFullscreenChangeEventListener ( ) { if ( ! this . isSupported ) return noop ; this . presentationController . on ( 'change' , this . handlePresentationModeChange . bind ( this ) ) ; return ( ) => { this . presentationController . off ( 'change' , this . handlePresentationModeChange . bind ( this ) ) ; } ; } protected handlePresentationModeChange ( ) { this . handleFullscreenChange ( ) ; } protected addFullscreenErrorEventListener ( ) { return noop ; } }