Skip to content
FrameworkStyle

Orientation lock

Screen orientation locking while fullscreen is active

Locks screen orientation while fullscreen is active. Add it explicitly to a feature list; it is not included in the default video presets.

API Reference

Usage

By default, the feature locks to landscape. Pass a Screen Orientation API type to customize it.

import { createPlayer, features } from '@videojs/react';
import { videoFeatures } from '@videojs/react/video';

export const Player = createPlayer({
  features: [...videoFeatures, features.orientationLock],
});
import { createPlayer, features } from '@videojs/react';
import { videoFeatures } from '@videojs/react/video';

export const Player = createPlayer({
  features: [...videoFeatures, features.orientationLock({ type: 'portrait' })],
});

Unsupported browsers and rejected lock requests are ignored.