mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
fix(react, html): rename MediaProvider (and related) to VideoProvider (#159)
This commit is contained in:
@@ -20,16 +20,16 @@ export type SimpleVideoProps = PropsWithChildren<
|
||||
* without using a playback engine. Use this for simple MP4 files. For HLS/DASH streaming, use the
|
||||
* regular Video component instead.
|
||||
*
|
||||
* This component connects to MediaProvider for play/pause state but sets the src directly on the
|
||||
* This component connects to VideoProvider for play/pause state but sets the src directly on the
|
||||
* video element without going through HLS.js or other playback engines.
|
||||
*
|
||||
* @example
|
||||
* ```tsx
|
||||
* <MediaProvider>
|
||||
* <VideoProvider>
|
||||
* <MediaSkin>
|
||||
* <SimpleVideo src="video.mp4" />
|
||||
* </MediaSkin>
|
||||
* </MediaProvider>
|
||||
* </VideoProvider>
|
||||
* ```
|
||||
*/
|
||||
export const SimpleVideo: React.ForwardRefExoticComponent<
|
||||
|
||||
@@ -69,7 +69,7 @@ const DefaultVideoComponent: ElementType<
|
||||
|
||||
/**
|
||||
* @description This is a "thin wrapper" around the media component whose primary responsibility is to wire up the element
|
||||
* to the <MediaProvider/>'s MediaStore for the media state.
|
||||
* to the <VideoProvider/>'s MediaStore for the media state.
|
||||
* @param props - Identical to both a <video/>'s props and the <Player/> props, with one addition that may be familiar to
|
||||
* MUI users: a `component` prop that allows you to use something other than the <video/> element under the hood.
|
||||
* @returns A media react component (e.g. <video/>), wired up as the media element.
|
||||
|
||||
@@ -6,7 +6,7 @@ import { createContext } from 'react';
|
||||
* used "under the hood" for media ui state updates, state change requests, and the hooks and providers that integrate with this context.
|
||||
* It is unlikely that you will/should be using `MediaContext` directly.
|
||||
*
|
||||
* @see {@link MediaProvider}
|
||||
* @see {@link VideoProvider}
|
||||
* @see {@link useMediaDispatch}
|
||||
* @see {@link useMediaSelector}
|
||||
*/
|
||||
|
||||
@@ -8,8 +8,8 @@ export {
|
||||
useMediaStore,
|
||||
} from './hooks';
|
||||
export {
|
||||
MediaProvider,
|
||||
} from './media-provider';
|
||||
VideoProvider,
|
||||
} from './video-provider';
|
||||
|
||||
export type MediaStore = any;
|
||||
export type MediaState = any;
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ import { createMediaStore } from '@videojs/core/store';
|
||||
import { useMemo } from 'react';
|
||||
import { MediaContext } from './context';
|
||||
|
||||
export function MediaProvider({ children }: { children: ReactNode }): JSX.Element {
|
||||
export function VideoProvider({ children }: { children: ReactNode }): JSX.Element {
|
||||
const value = useMemo(() => createMediaStore(), []);
|
||||
|
||||
// useEffect(() => {
|
||||
Reference in New Issue
Block a user