New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-jw-player

Package Overview
Dependencies
Maintainers
5
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-jw-player - npm Package Compare versions

Comparing version 1.17.0 to 1.18.0

dist/helpers/get-event-name-from-prop.js

46

dist/helpers/initialize.js

@@ -6,2 +6,9 @@ 'use strict';

});
var _getEventNameFromProp = require('./get-event-name-from-prop');
var _getEventNameFromProp2 = _interopRequireDefault(_getEventNameFromProp);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function initialize(_ref) {

@@ -18,21 +25,26 @@ var component = _ref.component,

player.on('beforePlay', _onBeforePlay);
player.on('ready', component.props.onReady);
player.on('setupError', component.props.onSetupError);
player.on('error', component.props.onError);
player.on('adPlay', component.eventHandlers.onAdPlay);
player.on('adPause', component.props.onAdPause);
player.on('adSkipped', component.props.onAdSkipped);
player.on('adComplete', component.props.onAdComplete);
player.on('fullscreen', component.eventHandlers.onFullScreen);
player.on('pause', component.props.onPause);
player.on('play', component.eventHandlers.onPlay);
player.on('mute', component.eventHandlers.onMute);
player.on('playlistItem', component.eventHandlers.onVideoLoad);
player.on('time', component.eventHandlers.onTime);
player.on('beforeComplete', component.props.onOneHundredPercent);
player.on('buffer', component.props.onBuffer);
player.on('bufferChange', component.props.onBufferChange);
var eventsToInitialize = {};
Object.keys(component.props).forEach(function (prop) {
var eventName = (0, _getEventNameFromProp2.default)(prop);
if (eventName) {
eventsToInitialize[eventName] = component.props[prop];
}
});
eventsToInitialize.adPlay = component.eventHandlers.onAdPlay;
eventsToInitialize.beforeComplete = component.props.onOneHundredPercent;
eventsToInitialize.beforePlay = _onBeforePlay;
eventsToInitialize.fullscreen = component.eventHandlers.onFullScreen;
eventsToInitialize.mute = component.eventHandlers.onMute;
eventsToInitialize.play = component.eventHandlers.onPlay;
eventsToInitialize.playlistItem = component.eventHandlers.onVideoLoad;
eventsToInitialize.time = component.eventHandlers.onTime;
Object.keys(eventsToInitialize).forEach(function (event) {
player.on(event, eventsToInitialize[event]);
});
}
exports.default = initialize;
{
"name": "react-jw-player",
"version": "1.17.0",
"version": "1.18.0",
"description": "A React component for launching JW Player instances on the client.",

@@ -5,0 +5,0 @@ "main": "dist/react-jw-player.js",

@@ -13,3 +13,3 @@ # react-jw-player :movie_camera: [![Build Status](https://travis-ci.com/micnews/react-jw-player.svg?token=oCXvx519mb3xud77T3xi&branch=master)](https://travis-ci.com/micnews/react-jw-player)

* [Configuration](#optional-configuration-props)
* Event Hooks
* [Event Hooks](#event-hooks)
* [Advertising](#optional-advertising-event-hook-props)

@@ -145,2 +145,12 @@ * [Player Events](#optional-player-event-hook-props)

# Event Hooks
`react-jw-player` dynamically supports all events in JW Player. Simply preface the event name with `on` and pass it in as a prop.
Examples:
* `ready` => `onReady`
* `setupError` => `onSetupError`
`react-jw-player` has layered some different functionality on some of these events, so please check the docs below if you find any unexpected behavior!
## Optional Advertising Event Hook Props

@@ -147,0 +157,0 @@ * `onAdPause(event)`

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