Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@mux/mux-player-react

Package Overview
Dependencies
Maintainers
1
Versions
562
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mux/mux-player-react

An open source Mux player for React that Just Works™

  • 2.7.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
75K
decreased by-22.53%
Maintainers
1
Weekly downloads
 
Created
Source

<MuxPlayer/>

Downloads Version License

New release: 2.0

Mux Player has recently released 2.0. See the [https://github.com/muxinc/elements/blob/packages/mux-player/UPGRADING_V1_to_V2.md 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',
  }}
  streamType="on-demand"
/>;

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',
  }}
  streamType="on-demand"
/>;

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.

Keywords

FAQs

Package last updated on 28 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc