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

react-player

Package Overview
Dependencies
Maintainers
1
Versions
162
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-player - npm Package Compare versions

Comparing version 1.14.2 to 2.0.0-alpha.0

dist/0.ReactPlayer.js

18

lib/Player.js

@@ -76,2 +76,10 @@ "use strict";

_defineProperty(_assertThisInitialized(_this), "playerDidMount", function (player) {
_this.player = player;
_this.player.load(_this.props.url);
_this.progress();
});
_defineProperty(_assertThisInitialized(_this), "getInternalPlayer", function (key) {

@@ -222,8 +230,2 @@ if (!_this.player) return null;

_defineProperty(_assertThisInitialized(_this), "ref", function (player) {
if (player) {
_this.player = player;
}
});
return _this;

@@ -236,4 +238,2 @@ }

this.mounted = true;
this.player.load(this.props.url);
this.progress();
}

@@ -387,3 +387,3 @@ }, {

return _react["default"].createElement(Player, _extends({}, this.props, {
ref: this.ref,
didMount: this.playerDidMount,
onReady: this.handleReady,

@@ -390,0 +390,0 @@ onPlay: this.handlePlay,

@@ -6,3 +6,3 @@ "use strict";

});
exports["default"] = exports.DailyMotion = void 0;
exports["default"] = void 0;

@@ -13,6 +13,2 @@ var _react = _interopRequireWildcard(require("react"));

var _singlePlayer = _interopRequireDefault(require("../singlePlayer"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

@@ -101,2 +97,7 @@

_createClass(DailyMotion, [{
key: "componentDidMount",
value: function componentDidMount() {
this.props.didMount && this.props.didMount(this);
}
}, {
key: "load",

@@ -216,3 +217,3 @@ value: function load(url) {

exports.DailyMotion = DailyMotion;
exports["default"] = DailyMotion;

@@ -225,6 +226,2 @@ _defineProperty(DailyMotion, "displayName", 'DailyMotion');

_defineProperty(DailyMotion, "loopOnEnded", true);
var _default = (0, _singlePlayer["default"])(DailyMotion);
exports["default"] = _default;
_defineProperty(DailyMotion, "loopOnEnded", true);

@@ -6,3 +6,3 @@ "use strict";

});
exports["default"] = exports.Facebook = void 0;
exports["default"] = void 0;

@@ -13,6 +13,2 @@ var _react = _interopRequireWildcard(require("react"));

var _singlePlayer = _interopRequireDefault(require("../singlePlayer"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

@@ -82,2 +78,7 @@

_createClass(Facebook, [{
key: "componentDidMount",
value: function componentDidMount() {
this.props.didMount && this.props.didMount(this);
}
}, {
key: "load",

@@ -98,3 +99,3 @@ value: function load(url, isReady) {

xfbml: true,
version: _this2.props.config.facebook.version
version: 'v2.5'
});

@@ -197,3 +198,3 @@ FB.Event.subscribe('xfbml.render', function (msg) {

exports.Facebook = Facebook;
exports["default"] = Facebook;

@@ -206,6 +207,2 @@ _defineProperty(Facebook, "displayName", 'Facebook');

_defineProperty(Facebook, "loopOnEnded", true);
var _default = (0, _singlePlayer["default"])(Facebook);
exports["default"] = _default;
_defineProperty(Facebook, "loopOnEnded", true);

@@ -6,3 +6,3 @@ "use strict";

});
exports["default"] = exports.FilePlayer = void 0;
exports["default"] = void 0;

@@ -13,6 +13,2 @@ var _react = _interopRequireWildcard(require("react"));

var _singlePlayer = _interopRequireDefault(require("../singlePlayer"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

@@ -244,2 +240,3 @@

value: function componentDidMount() {
this.props.didMount && this.props.didMount(this);
this.addListeners(this.player);

@@ -524,3 +521,3 @@

exports.FilePlayer = FilePlayer;
exports["default"] = FilePlayer;

@@ -531,6 +528,2 @@ _defineProperty(FilePlayer, "displayName", 'FilePlayer');

_defineProperty(FilePlayer, "canEnablePIP", canEnablePIP);
var _default = (0, _singlePlayer["default"])(FilePlayer);
exports["default"] = _default;
_defineProperty(FilePlayer, "canEnablePIP", canEnablePIP);

@@ -8,23 +8,156 @@ "use strict";

var _YouTube = require("./YouTube");
var _react = require("react");
var _SoundCloud = require("./SoundCloud");
var _utils = require("../utils");
var _Vimeo = require("./Vimeo");
var _patterns = require("../patterns");
var _Facebook = require("./Facebook");
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
var _Streamable = require("./Streamable");
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var _Wistia = require("./Wistia");
var canPlayFile = function canPlayFile(url) {
if (url instanceof Array) {
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
var _Twitch = require("./Twitch");
try {
for (var _iterator = url[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var item = _step.value;
var _DailyMotion = require("./DailyMotion");
if (typeof item === 'string' && canPlayFile(item)) {
return true;
}
var _Mixcloud = require("./Mixcloud");
if (canPlayFile(item.src)) {
return true;
}
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
_iterator["return"]();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
var _FilePlayer = require("./FilePlayer");
return false;
}
var _default = [_YouTube.YouTube, _SoundCloud.SoundCloud, _Vimeo.Vimeo, _Facebook.Facebook, _Streamable.Streamable, _Wistia.Wistia, _Twitch.Twitch, _DailyMotion.DailyMotion, _Mixcloud.Mixcloud, _FilePlayer.FilePlayer];
if ((0, _utils.isMediaStream)(url)) {
return true;
}
return _patterns.AUDIO_EXTENSIONS.test(url) || _patterns.VIDEO_EXTENSIONS.test(url) || _patterns.HLS_EXTENSIONS.test(url) || _patterns.DASH_EXTENSIONS.test(url);
};
var _default = [{
canPlay: function canPlay(url) {
return _patterns.MATCH_URL_YOUTUBE.test(url);
},
Player: (0, _react.lazy)(function () {
return Promise.resolve().then(function () {
return _interopRequireWildcard(require('./YouTube'));
});
}),
configKey: 'youtube',
preloadUrl: 'https://www.youtube.com/watch?v=GlCmAC4MHek'
}, {
canPlay: function canPlay(url) {
return _patterns.MATCH_URL_SOUNDCLOUD.test(url);
},
Player: (0, _react.lazy)(function () {
return Promise.resolve().then(function () {
return _interopRequireWildcard(require('./SoundCloud'));
});
}),
configKey: 'soundcloud',
preloadUrl: 'https://soundcloud.com/seucheu/john-cage-433-8-bit-version'
}, {
canPlay: function canPlay(url) {
if (_patterns.MATCH_URL_VIMEO_FILE.test(url)) {
return false;
}
return _patterns.MATCH_URL_VIMEO.test(url);
},
Player: (0, _react.lazy)(function () {
return Promise.resolve().then(function () {
return _interopRequireWildcard(require('./Vimeo'));
});
}),
configKey: 'vimeo',
preloadUrl: 'https://vimeo.com/300970506'
}, {
canPlay: function canPlay(url) {
return _patterns.MATCH_URL_FACEBOOK.test(url);
},
Player: (0, _react.lazy)(function () {
return Promise.resolve().then(function () {
return _interopRequireWildcard(require('./Facebook'));
});
})
}, {
canPlay: function canPlay(url) {
return _patterns.MATCH_URL_STREAMABLE.test(url);
},
Player: (0, _react.lazy)(function () {
return Promise.resolve().then(function () {
return _interopRequireWildcard(require('./Streamable'));
});
})
}, {
canPlay: function canPlay(url) {
return _patterns.MATCH_URL_WISTIA.test(url);
},
Player: (0, _react.lazy)(function () {
return Promise.resolve().then(function () {
return _interopRequireWildcard(require('./Wistia'));
});
})
}, {
canPlay: function canPlay(url) {
return _patterns.MATCH_URL_TWITCH_VIDEO.test(url) || _patterns.MATCH_URL_TWITCH_CHANNEL.test(url);
},
Player: (0, _react.lazy)(function () {
return Promise.resolve().then(function () {
return _interopRequireWildcard(require('./Twitch'));
});
})
}, {
canPlay: function canPlay(url) {
return _patterns.MATCH_URL_DAILYMOTION.test(url);
},
Player: (0, _react.lazy)(function () {
return Promise.resolve().then(function () {
return _interopRequireWildcard(require('./DailyMotion'));
});
}),
configKey: 'dailymotion',
preloadUrl: 'http://www.dailymotion.com/video/xqdpyk'
}, {
canPlay: function canPlay(url) {
return _patterns.MATCH_URL_MIXCLOUD.test(url);
},
Player: (0, _react.lazy)(function () {
return Promise.resolve().then(function () {
return _interopRequireWildcard(require('./Mixcloud'));
});
})
}, {
canPlay: canPlayFile,
Player: (0, _react.lazy)(function () {
return Promise.resolve().then(function () {
return _interopRequireWildcard(require('./FilePlayer'));
});
})
}];
exports["default"] = _default;

@@ -6,3 +6,3 @@ "use strict";

});
exports["default"] = exports.Mixcloud = void 0;
exports["default"] = void 0;

@@ -13,6 +13,2 @@ var _react = _interopRequireWildcard(require("react"));

var _singlePlayer = _interopRequireDefault(require("../singlePlayer"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

@@ -90,2 +86,7 @@

_createClass(Mixcloud, [{
key: "componentDidMount",
value: function componentDidMount() {
this.props.didMount && this.props.didMount(this);
}
}, {
key: "load",

@@ -183,3 +184,3 @@ value: function load(url) {

exports.Mixcloud = Mixcloud;
exports["default"] = Mixcloud;

@@ -192,6 +193,2 @@ _defineProperty(Mixcloud, "displayName", 'Mixcloud');

_defineProperty(Mixcloud, "loopOnEnded", true);
var _default = (0, _singlePlayer["default"])(Mixcloud);
exports["default"] = _default;
_defineProperty(Mixcloud, "loopOnEnded", true);

@@ -6,3 +6,3 @@ "use strict";

});
exports["default"] = exports.SoundCloud = void 0;
exports["default"] = void 0;

@@ -13,6 +13,2 @@ var _react = _interopRequireWildcard(require("react"));

var _singlePlayer = _interopRequireDefault(require("../singlePlayer"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

@@ -94,2 +90,7 @@

_createClass(SoundCloud, [{
key: "componentDidMount",
value: function componentDidMount() {
this.props.didMount && this.props.didMount(this);
}
}, {
key: "load",

@@ -201,3 +202,3 @@ value: function load(url, isReady) {

exports.SoundCloud = SoundCloud;
exports["default"] = SoundCloud;

@@ -210,6 +211,2 @@ _defineProperty(SoundCloud, "displayName", 'SoundCloud');

_defineProperty(SoundCloud, "loopOnEnded", true);
var _default = (0, _singlePlayer["default"])(SoundCloud);
exports["default"] = _default;
_defineProperty(SoundCloud, "loopOnEnded", true);

@@ -6,3 +6,3 @@ "use strict";

});
exports["default"] = exports.Streamable = void 0;
exports["default"] = void 0;

@@ -13,6 +13,2 @@ var _react = _interopRequireWildcard(require("react"));

var _singlePlayer = _interopRequireDefault(require("../singlePlayer"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

@@ -88,2 +84,7 @@

_createClass(Streamable, [{
key: "componentDidMount",
value: function componentDidMount() {
this.props.didMount && this.props.didMount(this);
}
}, {
key: "load",

@@ -197,3 +198,3 @@ value: function load(url) {

exports.Streamable = Streamable;
exports["default"] = Streamable;

@@ -204,6 +205,2 @@ _defineProperty(Streamable, "displayName", 'Streamable');

return MATCH_URL.test(url);
});
var _default = (0, _singlePlayer["default"])(Streamable);
exports["default"] = _default;
});

@@ -6,3 +6,3 @@ "use strict";

});
exports["default"] = exports.Twitch = void 0;
exports["default"] = void 0;

@@ -13,6 +13,2 @@ var _react = _interopRequireWildcard(require("react"));

var _singlePlayer = _interopRequireDefault(require("../singlePlayer"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

@@ -86,2 +82,7 @@

_createClass(Twitch, [{
key: "componentDidMount",
value: function componentDidMount() {
this.props.didMount && this.props.didMount(this);
}
}, {
key: "load",

@@ -200,3 +201,3 @@ value: function load(url, isReady) {

exports.Twitch = Twitch;
exports["default"] = Twitch;

@@ -209,6 +210,2 @@ _defineProperty(Twitch, "displayName", 'Twitch');

_defineProperty(Twitch, "loopOnEnded", true);
var _default = (0, _singlePlayer["default"])(Twitch);
exports["default"] = _default;
_defineProperty(Twitch, "loopOnEnded", true);

@@ -6,3 +6,3 @@ "use strict";

});
exports["default"] = exports.Vimeo = void 0;
exports["default"] = void 0;

@@ -13,6 +13,2 @@ var _react = _interopRequireWildcard(require("react"));

var _singlePlayer = _interopRequireDefault(require("../singlePlayer"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

@@ -95,2 +91,7 @@

_createClass(Vimeo, [{
key: "componentDidMount",
value: function componentDidMount() {
this.props.didMount && this.props.didMount(this);
}
}, {
key: "load",

@@ -236,3 +237,3 @@ value: function load(url) {

exports.Vimeo = Vimeo;
exports["default"] = Vimeo;

@@ -249,6 +250,2 @@ _defineProperty(Vimeo, "displayName", 'Vimeo');

return MATCH_URL.test(url);
});
var _default = (0, _singlePlayer["default"])(Vimeo);
exports["default"] = _default;
});

@@ -6,3 +6,3 @@ "use strict";

});
exports["default"] = exports.Wistia = void 0;
exports["default"] = void 0;

@@ -13,6 +13,2 @@ var _react = _interopRequireWildcard(require("react"));

var _singlePlayer = _interopRequireDefault(require("../singlePlayer"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

@@ -82,2 +78,7 @@

_createClass(Wistia, [{
key: "componentDidMount",
value: function componentDidMount() {
this.props.didMount && this.props.didMount(this);
}
}, {
key: "getID",

@@ -211,3 +212,3 @@ value: function getID(url) {

exports.Wistia = Wistia;
exports["default"] = Wistia;

@@ -220,6 +221,2 @@ _defineProperty(Wistia, "displayName", 'Wistia');

_defineProperty(Wistia, "loopOnEnded", true);
var _default = (0, _singlePlayer["default"])(Wistia);
exports["default"] = _default;
_defineProperty(Wistia, "loopOnEnded", true);

@@ -6,3 +6,3 @@ "use strict";

});
exports["default"] = exports.YouTube = void 0;
exports["default"] = void 0;

@@ -13,6 +13,2 @@ var _react = _interopRequireWildcard(require("react"));

var _singlePlayer = _interopRequireDefault(require("../singlePlayer"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

@@ -150,2 +146,7 @@

_createClass(YouTube, [{
key: "componentDidMount",
value: function componentDidMount() {
this.props.didMount && this.props.didMount(this);
}
}, {
key: "load",

@@ -291,3 +292,3 @@ value: function load(url, isReady) {

exports.YouTube = YouTube;
exports["default"] = YouTube;

@@ -298,6 +299,2 @@ _defineProperty(YouTube, "displayName", 'YouTube');

return MATCH_URL.test(url);
});
var _default = (0, _singlePlayer["default"])(YouTube);
exports["default"] = _default;
});

@@ -10,34 +10,10 @@ "use strict";

var _players = _interopRequireDefault(require("./players"));
var _Player = _interopRequireDefault(require("./Player"));
var _YouTube = require("./players/YouTube");
var _SoundCloud = require("./players/SoundCloud");
var _Vimeo = require("./players/Vimeo");
var _DailyMotion = require("./players/DailyMotion");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
var PRELOAD_PLAYERS = [{
Player: _YouTube.YouTube,
configKey: 'youtube',
url: 'https://www.youtube.com/watch?v=GlCmAC4MHek'
}, {
Player: _SoundCloud.SoundCloud,
configKey: 'soundcloud',
url: 'https://soundcloud.com/seucheu/john-cage-433-8-bit-version'
}, {
Player: _Vimeo.Vimeo,
configKey: 'vimeo',
url: 'https://vimeo.com/300970506'
}, {
Player: _DailyMotion.DailyMotion,
configKey: 'dailymotion',
url: 'http://www.dailymotion.com/video/xqdpyk'
}];
function renderPreloadPlayers(url, controls, config) {
var players = [];
var preloadPlayers = [];
var _iteratorNormalCompletion = true;

@@ -48,10 +24,10 @@ var _didIteratorError = false;

try {
for (var _iterator = PRELOAD_PLAYERS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
for (var _iterator = _players["default"][Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var player = _step.value;
if (!player.Player.canPlay(url) && config[player.configKey].preload) {
players.push(_react["default"].createElement(_Player["default"], {
key: player.Player.displayName,
if (player.preloadUrl && config[player.configKey].preload && !player.canPlay(url)) {
preloadPlayers.push(_react["default"].createElement(_Player["default"], {
key: player.configKey,
activePlayer: player.Player,
url: player.url,
url: player.preloadUrl,
controls: controls,

@@ -79,3 +55,3 @@ playing: true,

return players;
return preloadPlayers;
}

@@ -51,4 +51,3 @@ "use strict";

facebook: shape({
appId: string,
version: string
appId: string
}),

@@ -139,4 +138,3 @@ dailymotion: shape({

facebook: {
appId: '1309697205772819',
version: 'v3.3'
appId: '1309697205772819'
},

@@ -143,0 +141,0 @@ dailymotion: {

@@ -6,62 +6,2 @@ "use strict";

});
Object.defineProperty(exports, "FilePlayer", {
enumerable: true,
get: function get() {
return _FilePlayer["default"];
}
});
Object.defineProperty(exports, "YouTube", {
enumerable: true,
get: function get() {
return _YouTube["default"];
}
});
Object.defineProperty(exports, "SoundCloud", {
enumerable: true,
get: function get() {
return _SoundCloud["default"];
}
});
Object.defineProperty(exports, "Vimeo", {
enumerable: true,
get: function get() {
return _Vimeo["default"];
}
});
Object.defineProperty(exports, "Facebook", {
enumerable: true,
get: function get() {
return _Facebook["default"];
}
});
Object.defineProperty(exports, "Streamable", {
enumerable: true,
get: function get() {
return _Streamable["default"];
}
});
Object.defineProperty(exports, "Wistia", {
enumerable: true,
get: function get() {
return _Wistia["default"];
}
});
Object.defineProperty(exports, "Twitch", {
enumerable: true,
get: function get() {
return _Twitch["default"];
}
});
Object.defineProperty(exports, "DailyMotion", {
enumerable: true,
get: function get() {
return _DailyMotion["default"];
}
});
Object.defineProperty(exports, "Mixcloud", {
enumerable: true,
get: function get() {
return _Mixcloud["default"];
}
});
exports["default"] = void 0;

@@ -79,32 +19,6 @@

var _Preview = _interopRequireDefault(require("./Preview"));
var _FilePlayer = _interopRequireWildcard(require("./players/FilePlayer"));
var _preload = _interopRequireDefault(require("./preload"));
var _YouTube = _interopRequireDefault(require("./players/YouTube"));
var _SoundCloud = _interopRequireDefault(require("./players/SoundCloud"));
var _Vimeo = _interopRequireDefault(require("./players/Vimeo"));
var _Facebook = _interopRequireDefault(require("./players/Facebook"));
var _Streamable = _interopRequireDefault(require("./players/Streamable"));
var _Wistia = _interopRequireDefault(require("./players/Wistia"));
var _Twitch = _interopRequireDefault(require("./players/Twitch"));
var _DailyMotion = _interopRequireDefault(require("./players/DailyMotion"));
var _Mixcloud = _interopRequireDefault(require("./players/Mixcloud"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

@@ -144,2 +58,16 @@

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; if (obj != null) { var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var FilePlayer = (0, _react.lazy)(function () {
return Promise.resolve().then(function () {
return _interopRequireWildcard(require('./players/FilePlayer'));
});
});
var Preview = (0, _react.lazy)(function () {
return Promise.resolve().then(function () {
return _interopRequireWildcard(require('./Preview'));
});
});
var SUPPORTED_PROPS = Object.keys(_props.propTypes);

@@ -264,3 +192,3 @@ var customPlayers = [];

if (_Player.canPlay(url)) {
return _Player;
return _Player.Player || _Player;
}

@@ -270,3 +198,3 @@ } // Fall back to FilePlayer if nothing else can play the URL

return _FilePlayer.FilePlayer;
return FilePlayer;
}

@@ -278,3 +206,3 @@ }, {

return _react["default"].createElement(_Player4["default"], _extends({}, this.props, {
key: activePlayer.displayName,
key: url,
ref: this.activePlayerRef,

@@ -315,3 +243,3 @@ config: this.config,

var preview = _react["default"].createElement(_Preview["default"], {
var preview = _react["default"].createElement(Preview, {
url: url,

@@ -329,3 +257,5 @@ light: light,

})
}, otherProps), showPreview ? preview : players);
}, otherProps), _react["default"].createElement(_react.Suspense, {
fallback: null
}, showPreview ? preview : players));
}

@@ -339,2 +269,8 @@ }]);

_defineProperty(ReactPlayer, "displayName", 'ReactPlayer');
_defineProperty(ReactPlayer, "propTypes", _props.propTypes);
_defineProperty(ReactPlayer, "defaultProps", _props.defaultProps);
_defineProperty(ReactPlayer, "addCustomPlayer", function (player) {

@@ -348,8 +284,2 @@ customPlayers.push(player);

_defineProperty(ReactPlayer, "displayName", 'ReactPlayer');
_defineProperty(ReactPlayer, "propTypes", _props.propTypes);
_defineProperty(ReactPlayer, "defaultProps", _props.defaultProps);
_defineProperty(ReactPlayer, "canPlay", function (url) {

@@ -356,0 +286,0 @@ for (var _i2 = 0, _arr2 = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players["default"])); _i2 < _arr2.length; _i2++) {

@@ -18,4 +18,2 @@ "use strict";

var _react = require("react");
var _loadScript = _interopRequireDefault(require("load-script"));

@@ -254,4 +252,4 @@

return val !== null && _typeof(val) === 'object';
} // Deep comparison of two objects, but ignoring functions
// and React elements, for use in shouldComponentUpdate
} // Deep comparison of two objects but ignoring
// functions, for use in shouldComponentUpdate

@@ -264,6 +262,2 @@

if ((0, _react.isValidElement)(a) && (0, _react.isValidElement)(b)) {
return true;
}
if (a instanceof Array && b instanceof Array) {

@@ -270,0 +264,0 @@ if (a.length !== b.length) {

{
"name": "react-player",
"version": "1.14.2",
"version": "2.0.0-alpha.0",
"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",

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

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