@vplayer/react 0.1.7 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/player/defaults.d.ts +4 -4
- package/dist/components/player/icon.d.ts +33 -0
- package/dist/components/player/index.d.ts +4 -3
- package/dist/components/player/layout/{player-chrome.d.ts → player-controls.d.ts} +2 -2
- package/dist/components/player/player-provider.d.ts +3 -2
- package/dist/components/player/types.d.ts +4 -2
- package/dist/components/player/utils/merge.d.ts +3 -2
- package/dist/index.js +2482 -2295
- package/dist/player.css +1 -1
- package/package.json +6 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* React-specific defaults.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* Re-export them here so consumers can import from @vplayer/react.
|
|
4
|
+
* Labels remain framework-agnostic; icons are React components generated at
|
|
5
|
+
* build time by unplugin-icons.
|
|
7
6
|
*/
|
|
8
|
-
export { defaultPlayerLabels
|
|
7
|
+
export { defaultPlayerLabels } from '@vplayer/core';
|
|
8
|
+
export { defaultPlayerIcons } from './icon';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ComponentProps, FC } from 'react';
|
|
2
|
+
import PlayIcon from '~icons/lucide/play';
|
|
3
|
+
export type IconComponent = typeof PlayIcon;
|
|
4
|
+
export interface PlayerIcons {
|
|
5
|
+
play: IconComponent;
|
|
6
|
+
pause: IconComponent;
|
|
7
|
+
replay: IconComponent;
|
|
8
|
+
skipBack: IconComponent;
|
|
9
|
+
skipForward: IconComponent;
|
|
10
|
+
volumeHigh: IconComponent;
|
|
11
|
+
volumeLow: IconComponent;
|
|
12
|
+
volumeOff: IconComponent;
|
|
13
|
+
settings: IconComponent;
|
|
14
|
+
pip: IconComponent;
|
|
15
|
+
miniPlayer: IconComponent;
|
|
16
|
+
close: IconComponent;
|
|
17
|
+
fullscreen: IconComponent;
|
|
18
|
+
fullscreenExit: IconComponent;
|
|
19
|
+
chevronLeft: IconComponent;
|
|
20
|
+
check: IconComponent;
|
|
21
|
+
spinner: IconComponent;
|
|
22
|
+
screenshot: IconComponent;
|
|
23
|
+
flip: IconComponent;
|
|
24
|
+
aspectRatio: IconComponent;
|
|
25
|
+
info: IconComponent;
|
|
26
|
+
loop: IconComponent;
|
|
27
|
+
}
|
|
28
|
+
export declare const defaultPlayerIcons: PlayerIcons;
|
|
29
|
+
interface IconProps extends ComponentProps<typeof PlayIcon> {
|
|
30
|
+
icon: IconComponent;
|
|
31
|
+
}
|
|
32
|
+
export declare const Icon: FC<IconProps>;
|
|
33
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { VideoPlayer } from './player';
|
|
2
|
-
export { ControlsBar,
|
|
2
|
+
export { ControlsBar, PlayerControls } from './layout/player-controls';
|
|
3
3
|
export { DefaultVideoLayout } from './layout/default-video-layout';
|
|
4
4
|
export { CompactVideoLayout } from './layout/compact-video-layout';
|
|
5
5
|
export { LargeVideoLayout } from './layout/large-video-layout';
|
|
@@ -14,9 +14,10 @@ export type { PlayerProps, PlayerSlots, PlayerLabels, PlayerIcons, MediaState, M
|
|
|
14
14
|
export type { UsePlayerResult, PluginAPIBuilder, PluginAPIContext } from './adapter-types';
|
|
15
15
|
export { createPluginAPIBuilder } from './plugin-api';
|
|
16
16
|
export { createPluginAPI } from './plugin-api';
|
|
17
|
-
export { createPlayer, createGestureEngine, EventBus, Storage, STORAGE_KEYS, I18n, HotkeyRegistry, defaultPlayerLabels,
|
|
17
|
+
export { createPlayer, createGestureEngine, EventBus, Storage, LocalPlaybackProgressStore, STORAGE_KEYS, I18n, HotkeyRegistry, defaultPlayerLabels, formatTime, } from '@vplayer/core';
|
|
18
|
+
export { defaultPlayerIcons } from './icon';
|
|
18
19
|
export { parseSRT, parseVTT, fetchSubtitles, getActiveCue, fetchThumbnails, parseThumbnailVTT, getThumbnailAtTime, } from '@vplayer/core';
|
|
19
|
-
export type { PlayerOptions, TransformThumbnailVTT, PlayerInstance, PlayerSystems, PlayerError, PlayerEventName, PlayerEventHandler, SubtitleCue, SubtitleTrack, ThumbnailCue, LanguageDict, HotkeyBinding, ControlRegistration, SettingRegistration, LayerRegistration, SettingItem, ContextMenuItem, ContextMenuRegistration, PlayerPlugin, PluginAPI, RemoteRef, PlayerContextRef, FlipState, AspectRatioState, } from '@vplayer/core';
|
|
20
|
+
export type { PlaybackProgress, PlaybackProgressStore, PlaybackProgressOptions, PlayerOptions, TransformThumbnailVTT, PlayerInstance, PlayerSystems, PlayerError, PlayerEventName, PlayerEventHandler, SubtitleCue, SubtitleTrack, ThumbnailCue, LanguageDict, HotkeyBinding, ControlRegistration, SettingRegistration, LayerRegistration, SettingItem, ContextMenuItem, ContextMenuRegistration, PlayerPlugin, PluginAPI, RemoteRef, PlayerContextRef, FlipState, AspectRatioState, } from '@vplayer/core';
|
|
20
21
|
export { PluginControlsLeft, PluginControlsRight, PluginControlsTop, PluginControlsCenter, PluginLayers, PluginSettings, NotificationOverlay, } from './plugin-renderer';
|
|
21
22
|
export { MiniProgressBar } from './components/mini-progress-bar';
|
|
22
23
|
export { ScreenshotButton } from './components/screenshot-button';
|
|
@@ -3,5 +3,5 @@ export declare const ControlsBar: FC<{
|
|
|
3
3
|
children?: ReactNode;
|
|
4
4
|
}>;
|
|
5
5
|
export declare const Spacer: FC;
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
6
|
+
export declare const MiniPlayerControls: FC;
|
|
7
|
+
export declare const PlayerControls: FC;
|
|
@@ -18,15 +18,16 @@
|
|
|
18
18
|
* </PlayerProvider>
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
import type {
|
|
21
|
+
import type { PlayerLabels } from '@vplayer/core';
|
|
22
22
|
import { type FC, type ReactNode } from 'react';
|
|
23
23
|
import { usePlayer } from './hooks/use-player';
|
|
24
|
+
import { type PlayerIcons } from './icon';
|
|
24
25
|
import type { PlayerSlots } from './types';
|
|
25
26
|
import type { DeepPartial } from './utils/merge';
|
|
26
27
|
export interface PlayerProviderProps {
|
|
27
28
|
options: Parameters<typeof usePlayer>[0];
|
|
28
29
|
labels?: DeepPartial<PlayerLabels>;
|
|
29
|
-
icons?:
|
|
30
|
+
icons?: Partial<PlayerIcons>;
|
|
30
31
|
slots?: PlayerSlots;
|
|
31
32
|
children?: ReactNode;
|
|
32
33
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { Store } from '@tanstack/store';
|
|
2
|
-
import type { EventBus, HotkeyRegistry, I18n, MediaEngine, MediaRemote, MediaState,
|
|
2
|
+
import type { EventBus, HotkeyRegistry, I18n, MediaEngine, MediaRemote, MediaState, PlayerLabels, PlayerInstance, PlayerOptions, Storage, SubtitleTrack, ThumbnailCue } from '@vplayer/core';
|
|
3
3
|
import type { AspectRatioState, ControlRegistration, ContextMenuItem, FlipState, LayerRegistration, PlayerPlugin, PluginAPI, SettingRegistration } from '@vplayer/core';
|
|
4
4
|
import type { ReactNode, RefObject } from 'react';
|
|
5
5
|
import type { PluginAPIBuilder } from './adapter-types';
|
|
6
|
-
|
|
6
|
+
import type { PlayerIcons } from './icon';
|
|
7
|
+
export type { MediaState, MediaRemote, PlayerLabels, PlayerOptions };
|
|
8
|
+
export type { IconComponent, PlayerIcons } from './icon';
|
|
7
9
|
export type { AspectRatioState, ControlRegistration, ContextMenuItem, FlipState, LayerRegistration, PlayerPlugin, PluginAPI, SettingRegistration, };
|
|
8
10
|
export type { EventBus, HotkeyRegistry, I18n, Storage, SubtitleTrack, ThumbnailCue };
|
|
9
11
|
export interface PlayerSlots {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { PlayerLabels } from '@vplayer/core';
|
|
2
|
+
import type { PlayerIcons } from '../icon';
|
|
2
3
|
export type DeepPartial<T> = {
|
|
3
4
|
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
4
5
|
};
|
|
5
6
|
export declare function mergeLabels(defaults: PlayerLabels, overrides?: DeepPartial<PlayerLabels>): PlayerLabels;
|
|
6
|
-
export declare function mergeIcons(defaults: PlayerIcons, overrides?:
|
|
7
|
+
export declare function mergeIcons(defaults: PlayerIcons, overrides?: Partial<PlayerIcons>): PlayerIcons;
|