fix(react, html): rename MediaProvider (and related) to VideoProvider (#159)

This commit is contained in:
Christian Pillsbury
2025-11-04 07:34:10 -08:00
committed by GitHub
parent 16cfde138d
commit f28557359c
38 changed files with 140 additions and 140 deletions
@@ -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<
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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}
*/
+2 -2
View File
@@ -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;
@@ -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(() => {