@@ -67,8 +67,7 @@ const SKIP_SECONDS = 10;
6767
6868const ICONS = {
6969 play : '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M8 5v14l11-7z"/></svg>' ,
70- pause :
71- '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 5h4v14H6zM14 5h4v14h-4z"/></svg>' ,
70+ pause : '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M6 5h4v14H6zM14 5h4v14h-4z"/></svg>' ,
7271 replay :
7372 '<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 5V1L7 6l5 5V7a6 6 0 1 1-6 6H4a8 8 0 1 0 8-8z"/></svg>' ,
7473 back10 :
@@ -248,7 +247,12 @@ export function createPlayer(
248247 } ) ;
249248 const shareButton = iconButton ( 'pux-player__btn' , 'Copy link at this time' , ICONS . link , 'share' ) ;
250249 const pipButton = iconButton ( 'pux-player__btn' , 'Picture in picture' , ICONS . pip , 'pip' ) ;
251- const fullscreenButton = iconButton ( 'pux-player__btn' , 'Fullscreen' , ICONS . enterFullscreen , 'fullscreen' ) ;
250+ const fullscreenButton = iconButton (
251+ 'pux-player__btn' ,
252+ 'Fullscreen' ,
253+ ICONS . enterFullscreen ,
254+ 'fullscreen'
255+ ) ;
252256
253257 row . append (
254258 playButton ,
@@ -293,7 +297,9 @@ export function createPlayer(
293297 opts ?: AddEventListenerOptions
294298 ) : void {
295299 target . addEventListener ( type , handler , opts ) ;
296- cleanups . push ( ( ) => { target . removeEventListener ( type , handler , opts ) ; } ) ;
300+ cleanups . push ( ( ) => {
301+ target . removeEventListener ( type , handler , opts ) ;
302+ } ) ;
297303 }
298304
299305 function showNotice ( message : string , action ?: { label : string ; run : ( ) => void } ) : void {
@@ -559,9 +565,15 @@ export function createPlayer(
559565 renderRate ( ) ;
560566 savePrefs ( { volume : video . volume , muted : video . muted , rate : video . playbackRate } , storage ) ;
561567 } ) ;
562- on ( video , 'waiting' , ( ) => { root . classList . add ( 'pux-player--buffering' ) ; } ) ;
563- on ( video , 'playing' , ( ) => { root . classList . remove ( 'pux-player--buffering' ) ; } ) ;
564- on ( video , 'canplay' , ( ) => { root . classList . remove ( 'pux-player--buffering' ) ; } ) ;
568+ on ( video , 'waiting' , ( ) => {
569+ root . classList . add ( 'pux-player--buffering' ) ;
570+ } ) ;
571+ on ( video , 'playing' , ( ) => {
572+ root . classList . remove ( 'pux-player--buffering' ) ;
573+ } ) ;
574+ on ( video , 'canplay' , ( ) => {
575+ root . classList . remove ( 'pux-player--buffering' ) ;
576+ } ) ;
565577 on ( video , 'error' , ( ) => {
566578 root . classList . remove ( 'pux-player--buffering' ) ;
567579 root . classList . add ( 'pux-player--failed' ) ;
@@ -570,16 +582,22 @@ export function createPlayer(
570582
571583 on ( overlay , 'click' , togglePlay ) ;
572584 on ( playButton , 'click' , togglePlay ) ;
573- on ( backButton , 'click' , ( ) => { seekBy ( - SKIP_SECONDS ) ; } ) ;
574- on ( forwardButton , 'click' , ( ) => { seekBy ( SKIP_SECONDS ) ; } ) ;
585+ on ( backButton , 'click' , ( ) => {
586+ seekBy ( - SKIP_SECONDS ) ;
587+ } ) ;
588+ on ( forwardButton , 'click' , ( ) => {
589+ seekBy ( SKIP_SECONDS ) ;
590+ } ) ;
575591 on ( muteButton , 'click' , ( ) => {
576592 video . muted = ! video . muted ;
577593 } ) ;
578594 on ( volumeInput , 'input' , ( ) => {
579595 video . volume = Number ( volumeInput . value ) ;
580596 video . muted = Number ( volumeInput . value ) === 0 ;
581597 } ) ;
582- on ( rateButton , 'click' , ( ) => { cycleRate ( 1 ) ; } ) ;
598+ on ( rateButton , 'click' , ( ) => {
599+ cycleRate ( 1 ) ;
600+ } ) ;
583601 on ( shareButton , 'click' , ( ) => void copyLink ( ) ) ;
584602 on ( pipButton , 'click' , ( ) => void togglePip ( ) ) ;
585603 on ( fullscreenButton , 'click' , ( ) => void toggleFullscreen ( ) ) ;
@@ -621,11 +639,15 @@ export function createPlayer(
621639 on ( scrub , 'pointerup' , endScrub ) ;
622640 on ( scrub , 'pointercancel' , endScrub ) ;
623641
624- on ( root , 'pointermove' , ( ) => { showControls ( ) ; } ) ;
642+ on ( root , 'pointermove' , ( ) => {
643+ showControls ( ) ;
644+ } ) ;
625645 on ( root , 'pointerleave' , ( ) => {
626646 if ( ! video . paused ) root . classList . remove ( 'pux-player--controls' ) ;
627647 } ) ;
628- on ( root , 'focusin' , ( ) => { showControls ( ) ; } ) ;
648+ on ( root , 'focusin' , ( ) => {
649+ showControls ( ) ;
650+ } ) ;
629651
630652 /**
631653 * Keys.
0 commit comments