mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
feat(core): lock fullscreen orientation (#1656)
This commit is contained in:
@@ -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[];
|
||||
|
||||
Reference in New Issue
Block a user