Validate package lifecycle in CI
All checks were successful
Check JS / Check TS (tsc) (pull_request) Successful in 30s
Check JS / Lint JS (eslint, prettier) (pull_request) Successful in 33s

This commit is contained in:
2026-08-12 15:18:49 -07:00
parent 452a9748d5
commit 7c0669190f
2 changed files with 17 additions and 11 deletions

View File

@@ -15,8 +15,8 @@ jobs:
shell: nix shell nixpkgs#nodejs_22 nixpkgs#yarn -c bash -e {0} shell: nix shell nixpkgs#nodejs_22 nixpkgs#yarn -c bash -e {0}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install node_modules - name: Install node_modules and build package
run: yarn install --immutable --ignore-scripts run: yarn install --immutable
- name: Check TypeScript - name: Check TypeScript
run: yarn tsc run: yarn tsc
- name: Test web HLS - name: Test web HLS
@@ -30,8 +30,8 @@ jobs:
shell: nix shell nixpkgs#nodejs_22 nixpkgs#yarn -c bash -e {0} shell: nix shell nixpkgs#nodejs_22 nixpkgs#yarn -c bash -e {0}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install node_modules - name: Install node_modules and build package
run: yarn install --immutable --ignore-scripts run: yarn install --immutable
- name: Run ESLint - name: Run ESLint
run: yarn lint run: yarn lint
- name: Verify auto-fix produces no changes - name: Verify auto-fix produces no changes

View File

@@ -133,24 +133,30 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
autorotate ??= fsPrefs.current.fullscreenAutorotate; autorotate ??= fsPrefs.current.fullscreenAutorotate;
const run = async () => { const run = async () => {
const browserOrientation = screen.orientation as
| {
lock?: (orientation: 'landscape' | 'portrait') => Promise<void>;
unlock?: () => void;
}
| undefined;
try { try {
if (newVal) { if (newVal) {
await nativeRef.current?.requestFullscreen({ await nativeRef.current?.requestFullscreen({
navigationUI: 'hide', navigationUI: 'hide',
}); });
if (orientation === 'all' || !orientation || autorotate) { if (orientation === 'all' || !orientation || autorotate) {
if (typeof screen.orientation?.unlock === 'function') { if (typeof browserOrientation?.unlock === 'function') {
screen.orientation.unlock(); browserOrientation.unlock();
} }
} else if (typeof screen.orientation?.lock === 'function') { } else if (typeof browserOrientation?.lock === 'function') {
await screen.orientation.lock(orientation); await browserOrientation.lock(orientation);
} }
} else { } else {
if (document.fullscreenElement) { if (document.fullscreenElement) {
await document.exitFullscreen(); await document.exitFullscreen();
} }
if (typeof screen.orientation?.unlock === 'function') { if (typeof browserOrientation?.unlock === 'function') {
screen.orientation.unlock(); browserOrientation.unlock();
} }
} }
} catch (e) { } catch (e) {
@@ -452,7 +458,7 @@ const useMediaSession = (
nativeRef: RefObject<HTMLVideoElement>, nativeRef: RefObject<HTMLVideoElement>,
showNotification: boolean, showNotification: boolean,
) => { ) => {
const isPlaying = !nativeRef.current?.paused ?? false; const isPlaying = nativeRef.current ? !nativeRef.current.paused : false;
const progress = nativeRef.current?.currentTime ?? 0; const progress = nativeRef.current?.currentTime ?? 0;
const duration = Number.isFinite(nativeRef.current?.duration) const duration = Number.isFinite(nativeRef.current?.duration)
? nativeRef.current?.duration ? nativeRef.current?.duration