npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

brightcove-react-player

v0.1.8

Published

React component for Brightcove Player

Downloads

45

Readme

A React component to load a Brightcove Player in the browser written in ES5 for compatibility

Installation

No matter how you use this component, the only place it is available is npm.

npm install --save brightcove-react-player

or

yarn add brightcove-react-player

Standard Usage with JSX

Most React applications are using JSX and the toolchain provided by create-react-app.

After installing, import the module and use the ReactPlayerLoader component like any other component in your React application:

NOTE: React/ReactDOM are NOT required, they are only used here to show a complete working example!

import React from "react";
import ReactDOM from "react-dom";
import ReactPlayerLoader from "brightcove-react-player";

let reactPlayerLoader;
const onSuccess = function (success) {
  // The player object or iframe element (depending on embed type) can be
  // accessed in two ways.
  //
  // From the success object passed to the `onSuccess` callback:
  console.log(success.ref, success.type);
  // Supported actions
  // As a property of the component instance:
  console.log(reactPlayerLoader.player);
};

reactPlayerLoader = ReactDOM.render(
  <ReactPlayerLoader accountId="1234678" onSuccess={onSuccess} />,
  document.getElementById("fixture")
);

All Available Option in the player by which you can play around.

  1. Callbacks:
  1. All parems supported by player

  2. events in the player which you can get from ref of the player(on success callback ref):

"loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","volumechange"
  1. controls with ref(Like: ref.play())
  play()
  pause()
  controls()
  focus()
  currentSrc()
  autoplay()
  getChild("controlBar" or "textTrackDisplay" or "errorDisplay" or "closeButton" or "bigPlayButton" or "playToggle" or "textTrackSettings") // you can write any name of the child it should work
  language()
  languages()
  audioTracks()
  requestFullscreen()
  exitFullscreen()
  isFullscreen()
  muted(ref.muted()?false:true)
  volume(ref.volume()-.1)
  buffered()
  duration()
  bufferedEnd()
  currentTime(ref.currentTime()+5) // You can find % by currentTime / duration
  remainingTime()
  getCache()
  scrubbing()
  remoteTextTrackEls()
  textTracks()
  addRemoteTextTrack()
  tech_.featuresNativeTextTracks()
  textTrackSettings.getValues()
  errors.getAll()
  clearTimeout(fn) // used to clear the to interval of player

Note: these methods depends upon perameters passed on initialization. So these may or may not be available.

onSuccess (success , playerWrapperRef ) : takes in 2 parameters, success being the callback function and playerWrapperRef the ref value

onFailure (failure , playerWrapperRef ) : takes in 2 parameters, failure being the callback function and playerWrapperRef the ref value

Props

attrs

Type: Object

Provides attributes (props) to the component element.

For example, you may want to customize the className of the component (by default, "brightcove-react-player") by setting props on the component like so:

<ReactPlayerLoader wrapperClassName="my-custom-class" />

Rest all props can be passed as per brightcove-player

Other Props

All props not specified above are passed with a few differences:

  1. We cannot expose the Player Loader promise easily, so you must use the onSuccess and onFailure callbacks.
  2. If you don't provide an onFailure callback, the failure will be handled by throwing an error.
  3. We need to use refNode and refNodeInsert internally, so those props will be ignored.

All other prop changes, excluding props that are function's, will cause a complete dispose/reload.

ES Module (without JSX)

After installation, import the module in your JavaScript and use the ReactPlayerLoader component like any other component in your React application:

NOTE: React/ReactDOM are NOT required, they are only used here to show a complete working example!

import React from "react";
import ReactDOM from "react-dom";
import ReactPlayerLoader from "brightcove-react-player";

const reactPlayerLoader = ReactDOM.render(
  React.createElement(ReactPlayerLoader, {
    accountId: "any mumber",
    onSuccess(success, wrapperRef) {
      // two ways to get the underlying player/iframe at this point.
      const { ref } = success;
      console.log(ref, success, wrapperRef);
    },
  }),
  document.getElementById("fixture")
);

Again, onSuccess (success , playerWrapperRef ) : takes in 2 parameters, success being the callback function and playerWrapperRef the ref value

onFailure (failure , playerWrapperRef ) : takes in 2 parameters, failure being the callback function and playerWrapperRef the ref value

A React component to load a Brightcove Player in the browser.

Brightcove Player Support

This library supports all features of @brightcove/player-loader npm link.

You can use this wrapper however you want.