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

View File

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