Skip to content

Commit e0cef76

Browse files
committed
Merge master to pick up the prettier formatting fix (#88)
2 parents 483255d + 030aa3d commit e0cef76

3 files changed

Lines changed: 45 additions & 14 deletions

File tree

‎apps/web/src/components/video/RecordingPlayer.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ export function RecordingPlayer({
6868
: null,
6969
});
7070

71-
return () => { handle.destroy(); };
71+
return () => {
72+
handle.destroy();
73+
};
7274
// `chapters` is intentionally not a dependency: rebuilding the whole player
7375
// on a new array identity would lose the reader's position. Chapters that
7476
// arrive later go through the handle's setChapters instead.

‎apps/web/src/lib/player/player.css‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@
1919
picture. Its focus ring would otherwise sit around the whole video. */
2020
outline: none;
2121
font-family:
22-
ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
22+
ui-sans-serif,
23+
system-ui,
24+
-apple-system,
25+
'Segoe UI',
26+
Roboto,
27+
Helvetica,
28+
Arial,
29+
sans-serif;
2330
-webkit-user-select: none;
2431
user-select: none;
2532
}

‎apps/web/src/lib/player/player.ts‎

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ const SKIP_SECONDS = 10;
6767

6868
const 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

Comments
 (0)