react-jw-player
Advanced tools
Comparing version 1.5.0 to 1.6.0
@@ -15,2 +15,3 @@ 'use strict'; | ||
isMuted = opts.isMuted, | ||
licenseKey = opts.licenseKey, | ||
playlist = opts.playlist; | ||
@@ -25,2 +26,6 @@ | ||
if (licenseKey) { | ||
playerOpts.key = licenseKey; | ||
} | ||
if (playlist) { | ||
@@ -27,0 +32,0 @@ playerOpts.playlist = playlist; |
@@ -14,31 +14,32 @@ 'use strict'; | ||
file: _react.PropTypes.string, | ||
generatePrerollUrl: _react.PropTypes.func, | ||
image: _react.PropTypes.string, | ||
isAutoPlay: _react.PropTypes.bool, | ||
isMuted: _react.PropTypes.bool, | ||
licenseKey: _react.PropTypes.string, | ||
onAdPause: _react.PropTypes.func, | ||
onAdPlay: _react.PropTypes.func, | ||
onAdResume: _react.PropTypes.func, | ||
onAutoStart: _react.PropTypes.func, | ||
onEnterFullScreen: _react.PropTypes.func, | ||
onError: _react.PropTypes.func, | ||
onExitFullScreen: _react.PropTypes.func, | ||
onFiftyPercent: _react.PropTypes.func, | ||
onMute: _react.PropTypes.func, | ||
onUnmute: _react.PropTypes.func, | ||
onAutoStart: _react.PropTypes.func, | ||
onResume: _react.PropTypes.func, | ||
onNinetyFivePercent: _react.PropTypes.func, | ||
onOneHundredPercent: _react.PropTypes.func, | ||
onPause: _react.PropTypes.func, | ||
onPlay: _react.PropTypes.func, | ||
generatePrerollUrl: _react.PropTypes.func, | ||
onError: _react.PropTypes.func, | ||
playerId: _react.PropTypes.string.isRequired, | ||
playlist: _react.PropTypes.string, | ||
onReady: _react.PropTypes.func, | ||
onAdPause: _react.PropTypes.func, | ||
onPause: _react.PropTypes.func, | ||
onResume: _react.PropTypes.func, | ||
onTenSeconds: _react.PropTypes.func, | ||
onThirtySeconds: _react.PropTypes.func, | ||
onThreeSeconds: _react.PropTypes.func, | ||
onUnmute: _react.PropTypes.func, | ||
onVideoLoad: _react.PropTypes.func, | ||
playerId: _react.PropTypes.string.isRequired, | ||
playerScript: _react.PropTypes.string.isRequired, | ||
onOneHundredPercent: _react.PropTypes.func, | ||
onThreeSeconds: _react.PropTypes.func, | ||
onTenSeconds: _react.PropTypes.func, | ||
onThirtySeconds: _react.PropTypes.func, | ||
onFiftyPercent: _react.PropTypes.func, | ||
onNinetyFivePercent: _react.PropTypes.func, | ||
isMuted: _react.PropTypes.bool, | ||
isAutoPlay: _react.PropTypes.bool | ||
playlist: _react.PropTypes.string | ||
}; | ||
exports.default = propTypes; |
{ | ||
"name": "react-jw-player", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"description": "A React component for launching JW Player instances on the client.", | ||
@@ -5,0 +5,0 @@ "main": "dist/react-jw-player.js", |
@@ -106,2 +106,5 @@ # 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) | ||
* Type: `string` | ||
* `licenseKey` | ||
* License Key as supplied in the jwplayer dashboard, under: Players > Tools > Downloads > JW Player X (Self-Hosted) | ||
* Type: `string` | ||
@@ -274,2 +277,3 @@ ## Optional Advertising Event Hook Props | ||
playlist={this.props.playlist} | ||
licenseKey='your-license-key' | ||
onAdPlay={this.onAdPlay} | ||
@@ -276,0 +280,0 @@ onVideoLoad={this.onVideoLoad} |
@@ -10,2 +10,3 @@ function getPlayerOpts(opts) { | ||
isMuted, | ||
licenseKey, | ||
playlist, | ||
@@ -20,2 +21,6 @@ } = opts; | ||
if (licenseKey) { | ||
playerOpts.key = licenseKey; | ||
} | ||
if (playlist) { | ||
@@ -22,0 +27,0 @@ playerOpts.playlist = playlist; |
@@ -8,31 +8,32 @@ import { PropTypes } from 'react'; | ||
file: PropTypes.string, | ||
generatePrerollUrl: PropTypes.func, | ||
image: PropTypes.string, | ||
isAutoPlay: PropTypes.bool, | ||
isMuted: PropTypes.bool, | ||
licenseKey: PropTypes.string, | ||
onAdPause: PropTypes.func, | ||
onAdPlay: PropTypes.func, | ||
onAdResume: PropTypes.func, | ||
onAutoStart: PropTypes.func, | ||
onEnterFullScreen: PropTypes.func, | ||
onError: PropTypes.func, | ||
onExitFullScreen: PropTypes.func, | ||
onFiftyPercent: PropTypes.func, | ||
onMute: PropTypes.func, | ||
onUnmute: PropTypes.func, | ||
onAutoStart: PropTypes.func, | ||
onResume: PropTypes.func, | ||
onNinetyFivePercent: PropTypes.func, | ||
onOneHundredPercent: PropTypes.func, | ||
onPause: PropTypes.func, | ||
onPlay: PropTypes.func, | ||
generatePrerollUrl: PropTypes.func, | ||
onError: PropTypes.func, | ||
playerId: PropTypes.string.isRequired, | ||
playlist: PropTypes.string, | ||
onReady: PropTypes.func, | ||
onAdPause: PropTypes.func, | ||
onPause: PropTypes.func, | ||
onResume: PropTypes.func, | ||
onTenSeconds: PropTypes.func, | ||
onThirtySeconds: PropTypes.func, | ||
onThreeSeconds: PropTypes.func, | ||
onUnmute: PropTypes.func, | ||
onVideoLoad: PropTypes.func, | ||
playerId: PropTypes.string.isRequired, | ||
playerScript: PropTypes.string.isRequired, | ||
onOneHundredPercent: PropTypes.func, | ||
onThreeSeconds: PropTypes.func, | ||
onTenSeconds: PropTypes.func, | ||
onThirtySeconds: PropTypes.func, | ||
onFiftyPercent: PropTypes.func, | ||
onNinetyFivePercent: PropTypes.func, | ||
isMuted: PropTypes.bool, | ||
isAutoPlay: PropTypes.bool, | ||
playlist: PropTypes.string, | ||
}; | ||
export default propTypes; |
@@ -133,2 +133,14 @@ import test from 'tape'; | ||
test('getPlayerOpts() with license key', (t) => { | ||
const mockKey = 'mock key'; | ||
const actual = getPlayerOpts({ | ||
licenseKey: mockKey, | ||
}); | ||
t.equal(actual.key, mockKey, 'it sets the key property'); | ||
t.end(); | ||
}); | ||
test('getPlayerOpts() with customProps', (t) => { | ||
@@ -135,0 +147,0 @@ const customProps = { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72994
1774
298