react-player
Advanced tools
Comparing version 2.0.0-alpha.0 to 2.0.0-alpha.1
@@ -49,2 +49,6 @@ import * as React from 'react'; | ||
export interface VidyardConfig { | ||
options?: Object; | ||
} | ||
export interface FileConfig { | ||
@@ -71,2 +75,3 @@ attributes?: Object; | ||
mixcloud?: MixcloudConfig; | ||
vidyard?: VidyardConfig; | ||
} | ||
@@ -73,0 +78,0 @@ |
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.DASH_EXTENSIONS = exports.HLS_EXTENSIONS = exports.VIDEO_EXTENSIONS = exports.AUDIO_EXTENSIONS = exports.MATCH_URL_MIXCLOUD = exports.MATCH_URL_DAILYMOTION = exports.MATCH_URL_TWITCH_CHANNEL = exports.MATCH_URL_TWITCH_VIDEO = exports.MATCH_URL_WISTIA = exports.MATCH_URL_STREAMABLE = exports.MATCH_URL_FACEBOOK = exports.MATCH_URL_VIMEO_FILE = exports.MATCH_URL_VIMEO = exports.MATCH_URL_SOUNDCLOUD = exports.MATCH_URL_YOUTUBE = void 0; | ||
exports.DASH_EXTENSIONS = exports.HLS_EXTENSIONS = exports.VIDEO_EXTENSIONS = exports.AUDIO_EXTENSIONS = exports.MATCH_URL_VIDYARD = exports.MATCH_URL_MIXCLOUD = exports.MATCH_URL_DAILYMOTION = exports.MATCH_URL_TWITCH_CHANNEL = exports.MATCH_URL_TWITCH_VIDEO = exports.MATCH_URL_WISTIA = exports.MATCH_URL_STREAMABLE = exports.MATCH_URL_FACEBOOK = exports.MATCH_URL_VIMEO_FILE = exports.MATCH_URL_VIMEO = exports.MATCH_URL_SOUNDCLOUD = exports.MATCH_URL_YOUTUBE = void 0; | ||
var MATCH_URL_YOUTUBE = /(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})|youtube\.com\/playlist\?list=/; | ||
@@ -30,2 +30,4 @@ exports.MATCH_URL_YOUTUBE = MATCH_URL_YOUTUBE; | ||
exports.MATCH_URL_MIXCLOUD = MATCH_URL_MIXCLOUD; | ||
var MATCH_URL_VIDYARD = /vidyard.com\/(?:watch\/)?([a-zA-Z0-9-]+)/; | ||
exports.MATCH_URL_VIDYARD = MATCH_URL_VIDYARD; | ||
var AUDIO_EXTENSIONS = /\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i; | ||
@@ -32,0 +34,0 @@ exports.AUDIO_EXTENSIONS = AUDIO_EXTENSIONS; |
@@ -76,3 +76,3 @@ "use strict"; | ||
_defineProperty(_assertThisInitialized(_this), "playerDidMount", function (player) { | ||
_defineProperty(_assertThisInitialized(_this), "handlePlayerMount", function (player) { | ||
_this.player = player; | ||
@@ -385,3 +385,3 @@ | ||
return _react["default"].createElement(Player, _extends({}, this.props, { | ||
didMount: this.playerDidMount, | ||
onMount: this.handlePlayerMount, | ||
onReady: this.handleReady, | ||
@@ -388,0 +388,0 @@ onPlay: this.handlePlay, |
@@ -97,3 +97,3 @@ "use strict"; | ||
value: function componentDidMount() { | ||
this.props.didMount && this.props.didMount(this); | ||
this.props.onMount && this.props.onMount(this); | ||
} | ||
@@ -100,0 +100,0 @@ }, { |
@@ -78,3 +78,3 @@ "use strict"; | ||
value: function componentDidMount() { | ||
this.props.didMount && this.props.didMount(this); | ||
this.props.onMount && this.props.onMount(this); | ||
} | ||
@@ -81,0 +81,0 @@ }, { |
@@ -238,3 +238,3 @@ "use strict"; | ||
value: function componentDidMount() { | ||
this.props.didMount && this.props.didMount(this); | ||
this.props.onMount && this.props.onMount(this); | ||
this.addListeners(this.player); | ||
@@ -241,0 +241,0 @@ |
@@ -155,2 +155,11 @@ "use strict"; | ||
}, { | ||
canPlay: function canPlay(url) { | ||
return _patterns.MATCH_URL_VIDYARD.test(url); | ||
}, | ||
Player: (0, _react.lazy)(function () { | ||
return Promise.resolve().then(function () { | ||
return _interopRequireWildcard(require('./Vidyard')); | ||
}); | ||
}) | ||
}, { | ||
canPlay: canPlayFile, | ||
@@ -157,0 +166,0 @@ Player: (0, _react.lazy)(function () { |
@@ -86,3 +86,3 @@ "use strict"; | ||
value: function componentDidMount() { | ||
this.props.didMount && this.props.didMount(this); | ||
this.props.onMount && this.props.onMount(this); | ||
} | ||
@@ -89,0 +89,0 @@ }, { |
@@ -90,3 +90,3 @@ "use strict"; | ||
value: function componentDidMount() { | ||
this.props.didMount && this.props.didMount(this); | ||
this.props.onMount && this.props.onMount(this); | ||
} | ||
@@ -93,0 +93,0 @@ }, { |
@@ -84,3 +84,3 @@ "use strict"; | ||
value: function componentDidMount() { | ||
this.props.didMount && this.props.didMount(this); | ||
this.props.onMount && this.props.onMount(this); | ||
} | ||
@@ -87,0 +87,0 @@ }, { |
@@ -82,3 +82,3 @@ "use strict"; | ||
value: function componentDidMount() { | ||
this.props.didMount && this.props.didMount(this); | ||
this.props.onMount && this.props.onMount(this); | ||
} | ||
@@ -85,0 +85,0 @@ }, { |
@@ -91,3 +91,3 @@ "use strict"; | ||
value: function componentDidMount() { | ||
this.props.didMount && this.props.didMount(this); | ||
this.props.onMount && this.props.onMount(this); | ||
} | ||
@@ -94,0 +94,0 @@ }, { |
@@ -78,3 +78,3 @@ "use strict"; | ||
value: function componentDidMount() { | ||
this.props.didMount && this.props.didMount(this); | ||
this.props.onMount && this.props.onMount(this); | ||
} | ||
@@ -81,0 +81,0 @@ }, { |
@@ -146,3 +146,3 @@ "use strict"; | ||
value: function componentDidMount() { | ||
this.props.didMount && this.props.didMount(this); | ||
this.props.onMount && this.props.onMount(this); | ||
} | ||
@@ -149,0 +149,0 @@ }, { |
@@ -80,2 +80,5 @@ "use strict"; | ||
options: object | ||
}), | ||
vidyard: shape({ | ||
options: object | ||
}) | ||
@@ -177,2 +180,5 @@ }), | ||
options: {} | ||
}, | ||
vidyard: { | ||
options: {} | ||
} | ||
@@ -179,0 +185,0 @@ }, |
@@ -16,3 +16,3 @@ "use strict"; | ||
var _Player4 = _interopRequireDefault(require("./Player")); | ||
var _Player3 = _interopRequireDefault(require("./Player")); | ||
@@ -187,6 +187,6 @@ var _preload = _interopRequireDefault(require("./preload")); | ||
for (var _i = 0, _arr = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players["default"])); _i < _arr.length; _i++) { | ||
var _Player = _arr[_i]; | ||
var player = _arr[_i]; | ||
if (_Player.canPlay(url)) { | ||
return _Player.Player || _Player; | ||
if (player.canPlay(url)) { | ||
return player.Player || player; | ||
} | ||
@@ -202,3 +202,3 @@ } // Fall back to FilePlayer if nothing else can play the URL | ||
if (!url) return null; | ||
return _react["default"].createElement(_Player4["default"], _extends({}, this.props, { | ||
return _react["default"].createElement(_Player3["default"], _extends({}, this.props, { | ||
key: url, | ||
@@ -280,5 +280,5 @@ ref: this.activePlayerRef, | ||
for (var _i2 = 0, _arr2 = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players["default"])); _i2 < _arr2.length; _i2++) { | ||
var _Player2 = _arr2[_i2]; | ||
var _Player = _arr2[_i2]; | ||
if (_Player2.canPlay(url)) { | ||
if (_Player.canPlay(url)) { | ||
return true; | ||
@@ -293,5 +293,5 @@ } | ||
for (var _i3 = 0, _arr3 = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players["default"])); _i3 < _arr3.length; _i3++) { | ||
var _Player3 = _arr3[_i3]; | ||
var _Player2 = _arr3[_i3]; | ||
if (_Player3.canEnablePIP && _Player3.canEnablePIP(url)) { | ||
if (_Player2.canEnablePIP && _Player2.canEnablePIP(url)) { | ||
return true; | ||
@@ -298,0 +298,0 @@ } |
{ | ||
"name": "react-player", | ||
"version": "2.0.0-alpha.0", | ||
"version": "2.0.0-alpha.1", | ||
"description": "A React component for playing a variety of URLs, including file paths, YouTube, Facebook, Twitch, SoundCloud, Streamable, Vimeo, Wistia and DailyMotion", | ||
@@ -5,0 +5,0 @@ "main": "lib/ReactPlayer.js", |
@@ -348,2 +348,3 @@ <h1 align='center'> | ||
* DailyMotion videos use the [DailyMotion Player API](https://developer.dailymotion.com/player) | ||
* Vidyard videos use the [Vidyard Player API](https://knowledge.vidyard.com/hc/en-us/articles/360019034753-Using-the-Vidyard-Player-API) | ||
* [Supported file types](https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats) are playing using [`<video>`](https://developer.mozilla.org/en/docs/Web/HTML/Element/video) or [`<audio>`](https://developer.mozilla.org/en/docs/Web/HTML/Element/audio) elements | ||
@@ -350,0 +351,0 @@ * HLS streams are played using [`hls.js`](https://github.com/video-dev/hls.js) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
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
4812
361
1124407
33
1