feat(core): lock fullscreen orientation (#1656)

This commit is contained in:
Sam Potts
2026-06-10 10:32:43 +10:00
committed by GitHub
parent 3d2225e77e
commit 62d0524b83
20 changed files with 770 additions and 13 deletions
@@ -1,5 +1,5 @@
import type { AudioPlayerStore, PlayerStore, PlayerTarget, VideoPlayerStore } from '@videojs/core/dom';
import { audioFeatures, backgroundFeatures, definePlayerFeature, videoFeatures } from '@videojs/core/dom';
import { audioFeatures, backgroundFeatures, definePlayerFeature, features, videoFeatures } from '@videojs/core/dom';
import type { Slice } from '@videojs/store';
import { assertType, describe, it } from 'vitest';
@@ -44,6 +44,16 @@ describe('createPlayer', () => {
assertType<CreatePlayerResult<PlayerStore<[Slice<PlayerTarget, CustomState>]>>>(result);
});
it('accepts the orientation lock feature alias with and without config', () => {
const configuredOrientationLock = features.orientationLock({ type: 'portrait' });
const defaultResult = createPlayer({ features: [features.orientationLock] });
const configuredResult = createPlayer({ features: [configuredOrientationLock] });
assertType<CreatePlayerResult<PlayerStore<[typeof features.orientationLock]>>>(defaultResult);
assertType<CreatePlayerResult<PlayerStore<[typeof configuredOrientationLock]>>>(configuredResult);
});
it('resolves extended video features to generic PlayerStore', () => {
interface AnalyticsState {
events: string[];