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

@mycujoo/player-mls

Package Overview
Dependencies
Maintainers
15
Versions
211
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mycujoo/player-mls

Based on video.js project

  • 1.4.20-rc.0
  • npm
  • Socket score

Version published
Maintainers
15
Created
Source

MyCujoo MLS player

Based on video.js project

Dependencies

This project's advanced features and some of the core features will require this packages to be used in your project:

react
react-dom
immer
@emotion/react
lodash
@silvermine/videojs-chromecast

Usage

To use MyCujoo MLS Player in a React project all you need is to install this package:

yarn add @mycujoo/player-mls

And then use it in your code:

If you want to use advanced features of the player you will have to use the contexts provided by this project. In which case the minimal setup will look like this:

import Player, { PlayerStateContextProvider, AnnotationsContextProvider } from '@mycujoo/player-mls'

....
// render method of your component
  <PlayerStateContextProvider>
    <AnnotationsContextProvider>
      <Player source="path-to-m3u8-file" />
    </AnnotationsContextProvider>
  </PlayerStateContextProvider>

API

PropTypeDescription
sourcestringPath to m3u8 or mp4 video source, required
autoplayboolhtml5 video tag autoplay attribute
qualitySelectorboolDetermines if quality selector should be used or not
scoreboardboolDetermines if scoreboard should be used or not, reuires scoreboardConfig prop to work
debugboolToggles debug mode, if it is on video.js and youbora debug levels will be set to maximum output
youboraOptionsobjectIf you want to send stats to youbora, see youboraOptions interface for more info
googimaTagstringIf specified enables Google IMA integration
scoreboardConfigobjectRequired to show scoreboard component, see scoreboardConfig interface for more info
midrollsobjectIf specified enables midroll ads, see Midroll type for more info
onErrorfunctionIs triggered when video.js throws an error, see vjs errors documentation for more info
onPlayerActivefunctionIs triggered when video is playing every 5 seconds to report healthy playback
onVideoPlayfunctionIs triggered on html5 video tag play event
onVideoPausefunctionIs triggered on html5 video tag pause event
onSeekStartfunctionIs triggered on html5 video tag seeking event
onSeekEndfunctionIs triggered on html5 video tag seeked event
onBufferStartfunctionIs triggered on html5 video tag waiting event
onBufferEndfunctionIs triggered on html5 video tag playing event
onAdsManagerfunctionIs triggered on when the ad manager is initialized; google ima AdManager is the only parameter
onAdsBreakStartfunctionIs triggered on AdsManager loaded event
onAdSkipfunctionIs triggered on AdsManager skip event
onAdStartfunctionIs triggered on AdsManager start event; AdEvent is the only parameter
onAdCompletefunctionIs triggered on AdsManager complete event
onAdsBreakCompletefunctionIs triggered on AdsManager skip or complete events
onVideoStartfunctionIs triggered on first occurence of html5 video tag play event
onVideoEndfunctionIs triggered on html5 video tag end event
onFullscreenChangefunctionIs triggered when fullscreen status changes; should have a boolean parameter for the status

Development

To set up development environment for this project you will need to link player package inside you project, but also link all peer dependencies from you project inside player.

So the steps are following:

  1. Run yarn link inside @mycujoo/player-mls repository
  2. Go to the project root and run yarn link @mycujoo/player-mls
  3. Go to each of the following dependency packages inside the project using the MLS player node_modules and run yarn link
  4. Go to @mycujoo/player-mls repository again and run yarn link immer react react-dom @emotion/react

To speed up the build, make sure that terser and visualizer are disabled in rollupConfig, development config would be created in the future.

To deploy new version to npm: Make sure you updated version in package.json, then create new tag with version format and push it to the repo:

git tag v1.0.50 -am 'version 50 message'
git push origin v1.0.50

This will trigger a build and automatically publish the updated version from package.json. Alternatively the package can be published by running npm publish.

Tests

Run yarn test to run tests. Right now tests are WIP.

FAQs

Package last updated on 20 Mar 2023

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