Validate package lifecycle in CI
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user