Package Exports
- @mux/mux-player-react
- @mux/mux-player-react/-P675XEWU
- @mux/mux-player-react/ConditionalSuspense
- @mux/mux-player-react/ads
- @mux/mux-player-react/common/utils
- @mux/mux-player-react/env
- @mux/mux-player-react/index
- @mux/mux-player-react/lazy
- @mux/mux-player-react/news
- @mux/mux-player-react/news/index
- @mux/mux-player-react/news/playlist-end-screen
- @mux/mux-player-react/themes/classic
- @mux/mux-player-react/themes/gerwig
- @mux/mux-player-react/themes/microvideo
- @mux/mux-player-react/themes/minimal
- @mux/mux-player-react/themes/news
- @mux/mux-player-react/types
- @mux/mux-player-react/useComposedRefs
- @mux/mux-player-react/useEventCallbackEffect
- @mux/mux-player-react/useIsBrowser
- @mux/mux-player-react/useIsIntersecting
- @mux/mux-player-react/useObjectPropEffect
Readme
<MuxPlayer/>
New release: 3.0
Mux Player recently released 3.0. The most visible change in this is new tooltips that are enabled by default, as well as other fixes and changes.
Previous version: 2.0
For changes relating to the previous major release, 2.0, see the V1 to V2 upgrade guide and the blog post announcement.
Introduction
<MuxPlayer />
is a Mux-flavored React video player component, built on top of our mux-player web component and Media Chrome.
Installation
npm install @mux/mux-player-react
or
yarn add @mux/mux-player-react
Usage
import MuxPlayer from '@mux/mux-player-react';
<MuxPlayer
playbackId="DS00Spx1CV902MCtPj5WknGlR102V5HFkDe"
metadata={{
video_id: 'video-id-123456',
video_title: 'Bick Buck Bunny',
viewer_user_id: 'user-id-bc-789',
}}
/>;
Lazy-loading
Defer loading of Mux Player by importing from @mux/mux-player-react/lazy
.
import MuxPlayer from '@mux/mux-player-react/lazy';
<MuxPlayer
loading="viewport"
playbackId="DS00Spx1CV902MCtPj5WknGlR102V5HFkDe"
metadata={{
video_id: 'video-id-123456',
video_title: 'Bick Buck Bunny',
viewer_user_id: 'user-id-bc-789',
}}
/>;
If you are generating your pages with a Node.js server (for example, Next.js), consider using @mux/mux-player-react/lazy
with @mux/blurhash
to generate a placeholder to display during loading.
Docs
Docs and guides live on docs.mux.com.
API reference lives on Github.