mirror of
https://github.com/videojs/video.js.git
synced 2026-11-21 08:24:15 +01:00
13 lines
456 B
TypeScript
13 lines
456 B
TypeScript
import type { TextDirection } from '@app/constants';
|
|
import { getDirection, onDirectionChange } from '@app/shared/sandbox-listener';
|
|
import { useEffect, useState } from 'react';
|
|
|
|
/** The shell's pinned text direction, or `auto` to let the player follow its locale. */
|
|
export function useDirection(): TextDirection {
|
|
const [direction, setDirection] = useState(getDirection);
|
|
|
|
useEffect(() => onDirectionChange(setDirection), []);
|
|
|
|
return direction;
|
|
}
|