@mjhls/mjh-framework 1.0.122 → 1.0.123
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +4755 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +4755 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -21,7 +21,6 @@ import FormControl from 'react-bootstrap/FormControl';
|
|
|
21
21
|
import Nav from 'react-bootstrap/Nav';
|
|
22
22
|
import Navbar from 'react-bootstrap/Navbar';
|
|
23
23
|
import NavDropdown from 'react-bootstrap/NavDropdown';
|
|
24
|
-
import ReactPlayer from 'react-player';
|
|
25
24
|
import Pagination from 'react-bootstrap/Pagination';
|
|
26
25
|
import Carousel$1 from 'react-bootstrap/Carousel';
|
|
27
26
|
import Breadcrumb from 'react-bootstrap/Breadcrumb';
|
|
@@ -20368,6 +20367,4481 @@ var Video = function Video(_ref) {
|
|
|
20368
20367
|
return null;
|
|
20369
20368
|
};
|
|
20370
20369
|
|
|
20370
|
+
var props = createCommonjsModule(function (module, exports) {
|
|
20371
|
+
|
|
20372
|
+
Object.defineProperty(exports, "__esModule", {
|
|
20373
|
+
value: true
|
|
20374
|
+
});
|
|
20375
|
+
exports.DEPRECATED_CONFIG_PROPS = exports.defaultProps = exports.propTypes = void 0;
|
|
20376
|
+
|
|
20377
|
+
var _propTypes = _interopRequireDefault(PropTypes);
|
|
20378
|
+
|
|
20379
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
20380
|
+
|
|
20381
|
+
var string = _propTypes["default"].string,
|
|
20382
|
+
bool = _propTypes["default"].bool,
|
|
20383
|
+
number = _propTypes["default"].number,
|
|
20384
|
+
array = _propTypes["default"].array,
|
|
20385
|
+
oneOfType = _propTypes["default"].oneOfType,
|
|
20386
|
+
shape = _propTypes["default"].shape,
|
|
20387
|
+
object = _propTypes["default"].object,
|
|
20388
|
+
func = _propTypes["default"].func,
|
|
20389
|
+
node = _propTypes["default"].node;
|
|
20390
|
+
var propTypes = {
|
|
20391
|
+
url: oneOfType([string, array, object]),
|
|
20392
|
+
playing: bool,
|
|
20393
|
+
loop: bool,
|
|
20394
|
+
controls: bool,
|
|
20395
|
+
volume: number,
|
|
20396
|
+
muted: bool,
|
|
20397
|
+
playbackRate: number,
|
|
20398
|
+
width: oneOfType([string, number]),
|
|
20399
|
+
height: oneOfType([string, number]),
|
|
20400
|
+
style: object,
|
|
20401
|
+
progressInterval: number,
|
|
20402
|
+
playsinline: bool,
|
|
20403
|
+
pip: bool,
|
|
20404
|
+
light: oneOfType([bool, string]),
|
|
20405
|
+
playIcon: node,
|
|
20406
|
+
wrapper: oneOfType([string, func, shape({
|
|
20407
|
+
render: func.isRequired
|
|
20408
|
+
})]),
|
|
20409
|
+
config: shape({
|
|
20410
|
+
soundcloud: shape({
|
|
20411
|
+
options: object,
|
|
20412
|
+
preload: bool
|
|
20413
|
+
}),
|
|
20414
|
+
youtube: shape({
|
|
20415
|
+
playerVars: object,
|
|
20416
|
+
embedOptions: object,
|
|
20417
|
+
preload: bool
|
|
20418
|
+
}),
|
|
20419
|
+
facebook: shape({
|
|
20420
|
+
appId: string,
|
|
20421
|
+
version: string,
|
|
20422
|
+
playerId: string
|
|
20423
|
+
}),
|
|
20424
|
+
dailymotion: shape({
|
|
20425
|
+
params: object,
|
|
20426
|
+
preload: bool
|
|
20427
|
+
}),
|
|
20428
|
+
vimeo: shape({
|
|
20429
|
+
playerOptions: object,
|
|
20430
|
+
preload: bool
|
|
20431
|
+
}),
|
|
20432
|
+
file: shape({
|
|
20433
|
+
attributes: object,
|
|
20434
|
+
tracks: array,
|
|
20435
|
+
forceVideo: bool,
|
|
20436
|
+
forceAudio: bool,
|
|
20437
|
+
forceHLS: bool,
|
|
20438
|
+
forceDASH: bool,
|
|
20439
|
+
hlsOptions: object,
|
|
20440
|
+
hlsVersion: string,
|
|
20441
|
+
dashVersion: string
|
|
20442
|
+
}),
|
|
20443
|
+
wistia: shape({
|
|
20444
|
+
options: object
|
|
20445
|
+
}),
|
|
20446
|
+
mixcloud: shape({
|
|
20447
|
+
options: object
|
|
20448
|
+
}),
|
|
20449
|
+
twitch: shape({
|
|
20450
|
+
options: object,
|
|
20451
|
+
playerId: string
|
|
20452
|
+
})
|
|
20453
|
+
}),
|
|
20454
|
+
onReady: func,
|
|
20455
|
+
onStart: func,
|
|
20456
|
+
onPlay: func,
|
|
20457
|
+
onPause: func,
|
|
20458
|
+
onBuffer: func,
|
|
20459
|
+
onBufferEnd: func,
|
|
20460
|
+
onEnded: func,
|
|
20461
|
+
onError: func,
|
|
20462
|
+
onDuration: func,
|
|
20463
|
+
onSeek: func,
|
|
20464
|
+
onProgress: func,
|
|
20465
|
+
onEnablePIP: func,
|
|
20466
|
+
onDisablePIP: func
|
|
20467
|
+
};
|
|
20468
|
+
exports.propTypes = propTypes;
|
|
20469
|
+
var defaultProps = {
|
|
20470
|
+
playing: false,
|
|
20471
|
+
loop: false,
|
|
20472
|
+
controls: false,
|
|
20473
|
+
volume: null,
|
|
20474
|
+
muted: false,
|
|
20475
|
+
playbackRate: 1,
|
|
20476
|
+
width: '640px',
|
|
20477
|
+
height: '360px',
|
|
20478
|
+
style: {},
|
|
20479
|
+
progressInterval: 1000,
|
|
20480
|
+
playsinline: false,
|
|
20481
|
+
pip: false,
|
|
20482
|
+
light: false,
|
|
20483
|
+
wrapper: 'div',
|
|
20484
|
+
config: {
|
|
20485
|
+
soundcloud: {
|
|
20486
|
+
options: {
|
|
20487
|
+
visual: true,
|
|
20488
|
+
// Undocumented, but makes player fill container and look better
|
|
20489
|
+
buying: false,
|
|
20490
|
+
liking: false,
|
|
20491
|
+
download: false,
|
|
20492
|
+
sharing: false,
|
|
20493
|
+
show_comments: false,
|
|
20494
|
+
show_playcount: false
|
|
20495
|
+
}
|
|
20496
|
+
},
|
|
20497
|
+
youtube: {
|
|
20498
|
+
playerVars: {
|
|
20499
|
+
playsinline: 1,
|
|
20500
|
+
showinfo: 0,
|
|
20501
|
+
rel: 0,
|
|
20502
|
+
iv_load_policy: 3,
|
|
20503
|
+
modestbranding: 1
|
|
20504
|
+
},
|
|
20505
|
+
embedOptions: {},
|
|
20506
|
+
preload: false
|
|
20507
|
+
},
|
|
20508
|
+
facebook: {
|
|
20509
|
+
appId: '1309697205772819',
|
|
20510
|
+
version: 'v3.3',
|
|
20511
|
+
playerId: null
|
|
20512
|
+
},
|
|
20513
|
+
dailymotion: {
|
|
20514
|
+
params: {
|
|
20515
|
+
api: 1,
|
|
20516
|
+
'endscreen-enable': false
|
|
20517
|
+
},
|
|
20518
|
+
preload: false
|
|
20519
|
+
},
|
|
20520
|
+
vimeo: {
|
|
20521
|
+
playerOptions: {
|
|
20522
|
+
autopause: false,
|
|
20523
|
+
byline: false,
|
|
20524
|
+
portrait: false,
|
|
20525
|
+
title: false
|
|
20526
|
+
},
|
|
20527
|
+
preload: false
|
|
20528
|
+
},
|
|
20529
|
+
file: {
|
|
20530
|
+
attributes: {},
|
|
20531
|
+
tracks: [],
|
|
20532
|
+
forceVideo: false,
|
|
20533
|
+
forceAudio: false,
|
|
20534
|
+
forceHLS: false,
|
|
20535
|
+
forceDASH: false,
|
|
20536
|
+
hlsOptions: {},
|
|
20537
|
+
hlsVersion: '0.13.1',
|
|
20538
|
+
dashVersion: '2.9.2'
|
|
20539
|
+
},
|
|
20540
|
+
wistia: {
|
|
20541
|
+
options: {}
|
|
20542
|
+
},
|
|
20543
|
+
mixcloud: {
|
|
20544
|
+
options: {
|
|
20545
|
+
hide_cover: 1
|
|
20546
|
+
}
|
|
20547
|
+
},
|
|
20548
|
+
twitch: {
|
|
20549
|
+
options: {},
|
|
20550
|
+
playerId: null
|
|
20551
|
+
}
|
|
20552
|
+
},
|
|
20553
|
+
onReady: function onReady() {},
|
|
20554
|
+
onStart: function onStart() {},
|
|
20555
|
+
onPlay: function onPlay() {},
|
|
20556
|
+
onPause: function onPause() {},
|
|
20557
|
+
onBuffer: function onBuffer() {},
|
|
20558
|
+
onBufferEnd: function onBufferEnd() {},
|
|
20559
|
+
onEnded: function onEnded() {},
|
|
20560
|
+
onError: function onError() {},
|
|
20561
|
+
onDuration: function onDuration() {},
|
|
20562
|
+
onSeek: function onSeek() {},
|
|
20563
|
+
onProgress: function onProgress() {},
|
|
20564
|
+
onEnablePIP: function onEnablePIP() {},
|
|
20565
|
+
onDisablePIP: function onDisablePIP() {}
|
|
20566
|
+
};
|
|
20567
|
+
exports.defaultProps = defaultProps;
|
|
20568
|
+
var DEPRECATED_CONFIG_PROPS = ['soundcloudConfig', 'youtubeConfig', 'facebookConfig', 'dailymotionConfig', 'vimeoConfig', 'fileConfig', 'wistiaConfig'];
|
|
20569
|
+
exports.DEPRECATED_CONFIG_PROPS = DEPRECATED_CONFIG_PROPS;
|
|
20570
|
+
});
|
|
20571
|
+
|
|
20572
|
+
unwrapExports(props);
|
|
20573
|
+
var props_1 = props.DEPRECATED_CONFIG_PROPS;
|
|
20574
|
+
var props_2 = props.defaultProps;
|
|
20575
|
+
var props_3 = props.propTypes;
|
|
20576
|
+
|
|
20577
|
+
var isMergeableObject = function isMergeableObject(value) {
|
|
20578
|
+
return isNonNullObject(value)
|
|
20579
|
+
&& !isSpecial(value)
|
|
20580
|
+
};
|
|
20581
|
+
|
|
20582
|
+
function isNonNullObject(value) {
|
|
20583
|
+
return !!value && typeof value === 'object'
|
|
20584
|
+
}
|
|
20585
|
+
|
|
20586
|
+
function isSpecial(value) {
|
|
20587
|
+
var stringValue = Object.prototype.toString.call(value);
|
|
20588
|
+
|
|
20589
|
+
return stringValue === '[object RegExp]'
|
|
20590
|
+
|| stringValue === '[object Date]'
|
|
20591
|
+
|| isReactElement(value)
|
|
20592
|
+
}
|
|
20593
|
+
|
|
20594
|
+
// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
|
|
20595
|
+
var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
20596
|
+
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
20597
|
+
|
|
20598
|
+
function isReactElement(value) {
|
|
20599
|
+
return value.$$typeof === REACT_ELEMENT_TYPE
|
|
20600
|
+
}
|
|
20601
|
+
|
|
20602
|
+
function emptyTarget(val) {
|
|
20603
|
+
return Array.isArray(val) ? [] : {}
|
|
20604
|
+
}
|
|
20605
|
+
|
|
20606
|
+
function cloneUnlessOtherwiseSpecified(value, options) {
|
|
20607
|
+
return (options.clone !== false && options.isMergeableObject(value))
|
|
20608
|
+
? deepmerge(emptyTarget(value), value, options)
|
|
20609
|
+
: value
|
|
20610
|
+
}
|
|
20611
|
+
|
|
20612
|
+
function defaultArrayMerge(target, source, options) {
|
|
20613
|
+
return target.concat(source).map(function(element) {
|
|
20614
|
+
return cloneUnlessOtherwiseSpecified(element, options)
|
|
20615
|
+
})
|
|
20616
|
+
}
|
|
20617
|
+
|
|
20618
|
+
function getMergeFunction(key, options) {
|
|
20619
|
+
if (!options.customMerge) {
|
|
20620
|
+
return deepmerge
|
|
20621
|
+
}
|
|
20622
|
+
var customMerge = options.customMerge(key);
|
|
20623
|
+
return typeof customMerge === 'function' ? customMerge : deepmerge
|
|
20624
|
+
}
|
|
20625
|
+
|
|
20626
|
+
function getEnumerableOwnPropertySymbols(target) {
|
|
20627
|
+
return Object.getOwnPropertySymbols
|
|
20628
|
+
? Object.getOwnPropertySymbols(target).filter(function(symbol) {
|
|
20629
|
+
return target.propertyIsEnumerable(symbol)
|
|
20630
|
+
})
|
|
20631
|
+
: []
|
|
20632
|
+
}
|
|
20633
|
+
|
|
20634
|
+
function getKeys(target) {
|
|
20635
|
+
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
|
|
20636
|
+
}
|
|
20637
|
+
|
|
20638
|
+
function propertyIsOnObject(object, property) {
|
|
20639
|
+
try {
|
|
20640
|
+
return property in object
|
|
20641
|
+
} catch(_) {
|
|
20642
|
+
return false
|
|
20643
|
+
}
|
|
20644
|
+
}
|
|
20645
|
+
|
|
20646
|
+
// Protects from prototype poisoning and unexpected merging up the prototype chain.
|
|
20647
|
+
function propertyIsUnsafe(target, key) {
|
|
20648
|
+
return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
|
|
20649
|
+
&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
|
|
20650
|
+
&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
|
|
20651
|
+
}
|
|
20652
|
+
|
|
20653
|
+
function mergeObject(target, source, options) {
|
|
20654
|
+
var destination = {};
|
|
20655
|
+
if (options.isMergeableObject(target)) {
|
|
20656
|
+
getKeys(target).forEach(function(key) {
|
|
20657
|
+
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
|
20658
|
+
});
|
|
20659
|
+
}
|
|
20660
|
+
getKeys(source).forEach(function(key) {
|
|
20661
|
+
if (propertyIsUnsafe(target, key)) {
|
|
20662
|
+
return
|
|
20663
|
+
}
|
|
20664
|
+
|
|
20665
|
+
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
|
|
20666
|
+
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
|
|
20667
|
+
} else {
|
|
20668
|
+
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
|
|
20669
|
+
}
|
|
20670
|
+
});
|
|
20671
|
+
return destination
|
|
20672
|
+
}
|
|
20673
|
+
|
|
20674
|
+
function deepmerge(target, source, options) {
|
|
20675
|
+
options = options || {};
|
|
20676
|
+
options.arrayMerge = options.arrayMerge || defaultArrayMerge;
|
|
20677
|
+
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
|
|
20678
|
+
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
|
|
20679
|
+
// implementations can use it. The caller may not replace it.
|
|
20680
|
+
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
|
20681
|
+
|
|
20682
|
+
var sourceIsArray = Array.isArray(source);
|
|
20683
|
+
var targetIsArray = Array.isArray(target);
|
|
20684
|
+
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
|
20685
|
+
|
|
20686
|
+
if (!sourceAndTargetTypesMatch) {
|
|
20687
|
+
return cloneUnlessOtherwiseSpecified(source, options)
|
|
20688
|
+
} else if (sourceIsArray) {
|
|
20689
|
+
return options.arrayMerge(target, source, options)
|
|
20690
|
+
} else {
|
|
20691
|
+
return mergeObject(target, source, options)
|
|
20692
|
+
}
|
|
20693
|
+
}
|
|
20694
|
+
|
|
20695
|
+
deepmerge.all = function deepmergeAll(array, options) {
|
|
20696
|
+
if (!Array.isArray(array)) {
|
|
20697
|
+
throw new Error('first argument should be an array')
|
|
20698
|
+
}
|
|
20699
|
+
|
|
20700
|
+
return array.reduce(function(prev, next) {
|
|
20701
|
+
return deepmerge(prev, next, options)
|
|
20702
|
+
}, {})
|
|
20703
|
+
};
|
|
20704
|
+
|
|
20705
|
+
var deepmerge_1 = deepmerge;
|
|
20706
|
+
|
|
20707
|
+
var cjs = deepmerge_1;
|
|
20708
|
+
|
|
20709
|
+
var utils$2 = createCommonjsModule(function (module, exports) {
|
|
20710
|
+
|
|
20711
|
+
Object.defineProperty(exports, "__esModule", {
|
|
20712
|
+
value: true
|
|
20713
|
+
});
|
|
20714
|
+
exports.parseStartTime = parseStartTime;
|
|
20715
|
+
exports.parseEndTime = parseEndTime;
|
|
20716
|
+
exports.randomString = randomString;
|
|
20717
|
+
exports.queryString = queryString;
|
|
20718
|
+
exports.getSDK = getSDK;
|
|
20719
|
+
exports.getConfig = getConfig;
|
|
20720
|
+
exports.omit = omit;
|
|
20721
|
+
exports.callPlayer = callPlayer;
|
|
20722
|
+
exports.isObject = isObject;
|
|
20723
|
+
exports.isEqual = isEqual;
|
|
20724
|
+
exports.isMediaStream = isMediaStream;
|
|
20725
|
+
|
|
20726
|
+
|
|
20727
|
+
|
|
20728
|
+
var _loadScript = _interopRequireDefault(loadScript);
|
|
20729
|
+
|
|
20730
|
+
var _deepmerge = _interopRequireDefault(cjs);
|
|
20731
|
+
|
|
20732
|
+
|
|
20733
|
+
|
|
20734
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
20735
|
+
|
|
20736
|
+
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
|
20737
|
+
|
|
20738
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20739
|
+
|
|
20740
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
20741
|
+
|
|
20742
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
20743
|
+
|
|
20744
|
+
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
20745
|
+
|
|
20746
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20747
|
+
|
|
20748
|
+
var MATCH_START_QUERY = /[?&#](?:start|t)=([0-9hms]+)/;
|
|
20749
|
+
var MATCH_END_QUERY = /[?&#]end=([0-9hms]+)/;
|
|
20750
|
+
var MATCH_START_STAMP = /(\d+)(h|m|s)/g;
|
|
20751
|
+
var MATCH_NUMERIC = /^\d+$/; // Parse YouTube URL for a start time param, ie ?t=1h14m30s
|
|
20752
|
+
// and return the start time in seconds
|
|
20753
|
+
|
|
20754
|
+
function parseTimeParam(url, pattern) {
|
|
20755
|
+
var match = url.match(pattern);
|
|
20756
|
+
|
|
20757
|
+
if (match) {
|
|
20758
|
+
var stamp = match[1];
|
|
20759
|
+
|
|
20760
|
+
if (stamp.match(MATCH_START_STAMP)) {
|
|
20761
|
+
return parseTimeString(stamp);
|
|
20762
|
+
}
|
|
20763
|
+
|
|
20764
|
+
if (MATCH_NUMERIC.test(stamp)) {
|
|
20765
|
+
return parseInt(stamp);
|
|
20766
|
+
}
|
|
20767
|
+
}
|
|
20768
|
+
|
|
20769
|
+
return undefined;
|
|
20770
|
+
}
|
|
20771
|
+
|
|
20772
|
+
function parseTimeString(stamp) {
|
|
20773
|
+
var seconds = 0;
|
|
20774
|
+
var array = MATCH_START_STAMP.exec(stamp);
|
|
20775
|
+
|
|
20776
|
+
while (array !== null) {
|
|
20777
|
+
var _array = array,
|
|
20778
|
+
_array2 = _slicedToArray(_array, 3),
|
|
20779
|
+
count = _array2[1],
|
|
20780
|
+
period = _array2[2];
|
|
20781
|
+
|
|
20782
|
+
if (period === 'h') seconds += parseInt(count, 10) * 60 * 60;
|
|
20783
|
+
if (period === 'm') seconds += parseInt(count, 10) * 60;
|
|
20784
|
+
if (period === 's') seconds += parseInt(count, 10);
|
|
20785
|
+
array = MATCH_START_STAMP.exec(stamp);
|
|
20786
|
+
}
|
|
20787
|
+
|
|
20788
|
+
return seconds;
|
|
20789
|
+
}
|
|
20790
|
+
|
|
20791
|
+
function parseStartTime(url) {
|
|
20792
|
+
return parseTimeParam(url, MATCH_START_QUERY);
|
|
20793
|
+
}
|
|
20794
|
+
|
|
20795
|
+
function parseEndTime(url) {
|
|
20796
|
+
return parseTimeParam(url, MATCH_END_QUERY);
|
|
20797
|
+
} // http://stackoverflow.com/a/38622545
|
|
20798
|
+
|
|
20799
|
+
|
|
20800
|
+
function randomString() {
|
|
20801
|
+
return Math.random().toString(36).substr(2, 5);
|
|
20802
|
+
}
|
|
20803
|
+
|
|
20804
|
+
function queryString(object) {
|
|
20805
|
+
return Object.keys(object).map(function (key) {
|
|
20806
|
+
return "".concat(key, "=").concat(object[key]);
|
|
20807
|
+
}).join('&');
|
|
20808
|
+
} // Util function to load an external SDK
|
|
20809
|
+
// or return the SDK if it is already loaded
|
|
20810
|
+
|
|
20811
|
+
|
|
20812
|
+
var requests = {};
|
|
20813
|
+
|
|
20814
|
+
function getSDK(url, sdkGlobal) {
|
|
20815
|
+
var sdkReady = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
20816
|
+
var isLoaded = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : function () {
|
|
20817
|
+
return true;
|
|
20818
|
+
};
|
|
20819
|
+
var fetchScript = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : _loadScript["default"];
|
|
20820
|
+
|
|
20821
|
+
if (window[sdkGlobal] && isLoaded(window[sdkGlobal])) {
|
|
20822
|
+
return Promise.resolve(window[sdkGlobal]);
|
|
20823
|
+
}
|
|
20824
|
+
|
|
20825
|
+
return new Promise(function (resolve, reject) {
|
|
20826
|
+
// If we are already loading the SDK, add the resolve and reject
|
|
20827
|
+
// functions to the existing array of requests
|
|
20828
|
+
if (requests[url]) {
|
|
20829
|
+
requests[url].push({
|
|
20830
|
+
resolve: resolve,
|
|
20831
|
+
reject: reject
|
|
20832
|
+
});
|
|
20833
|
+
return;
|
|
20834
|
+
}
|
|
20835
|
+
|
|
20836
|
+
requests[url] = [{
|
|
20837
|
+
resolve: resolve,
|
|
20838
|
+
reject: reject
|
|
20839
|
+
}];
|
|
20840
|
+
|
|
20841
|
+
var onLoaded = function onLoaded(sdk) {
|
|
20842
|
+
// When loaded, resolve all pending request promises
|
|
20843
|
+
requests[url].forEach(function (request) {
|
|
20844
|
+
return request.resolve(sdk);
|
|
20845
|
+
});
|
|
20846
|
+
};
|
|
20847
|
+
|
|
20848
|
+
if (sdkReady) {
|
|
20849
|
+
var previousOnReady = window[sdkReady];
|
|
20850
|
+
|
|
20851
|
+
window[sdkReady] = function () {
|
|
20852
|
+
if (previousOnReady) previousOnReady();
|
|
20853
|
+
onLoaded(window[sdkGlobal]);
|
|
20854
|
+
};
|
|
20855
|
+
}
|
|
20856
|
+
|
|
20857
|
+
fetchScript(url, function (err) {
|
|
20858
|
+
if (err) {
|
|
20859
|
+
// Loading the SDK failed – reject all requests and
|
|
20860
|
+
// reset the array of requests for this SDK
|
|
20861
|
+
requests[url].forEach(function (request) {
|
|
20862
|
+
return request.reject(err);
|
|
20863
|
+
});
|
|
20864
|
+
requests[url] = null;
|
|
20865
|
+
} else if (!sdkReady) {
|
|
20866
|
+
onLoaded(window[sdkGlobal]);
|
|
20867
|
+
}
|
|
20868
|
+
});
|
|
20869
|
+
});
|
|
20870
|
+
}
|
|
20871
|
+
|
|
20872
|
+
function getConfig(props$$1, defaultProps, showWarning) {
|
|
20873
|
+
var config = (0, _deepmerge["default"])(defaultProps.config, props$$1.config);
|
|
20874
|
+
var _iteratorNormalCompletion = true;
|
|
20875
|
+
var _didIteratorError = false;
|
|
20876
|
+
var _iteratorError = undefined;
|
|
20877
|
+
|
|
20878
|
+
try {
|
|
20879
|
+
for (var _iterator = props.DEPRECATED_CONFIG_PROPS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
20880
|
+
var p = _step.value;
|
|
20881
|
+
|
|
20882
|
+
if (props$$1[p]) {
|
|
20883
|
+
var key = p.replace(/Config$/, '');
|
|
20884
|
+
config = (0, _deepmerge["default"])(config, _defineProperty({}, key, props$$1[p]));
|
|
20885
|
+
|
|
20886
|
+
if (showWarning) {
|
|
20887
|
+
var link = 'https://github.com/CookPete/react-player#config-prop';
|
|
20888
|
+
var message = "ReactPlayer: %c".concat(p, " %cis deprecated, please use the config prop instead \u2013 ").concat(link);
|
|
20889
|
+
console.warn(message, 'font-weight: bold', '');
|
|
20890
|
+
}
|
|
20891
|
+
}
|
|
20892
|
+
}
|
|
20893
|
+
} catch (err) {
|
|
20894
|
+
_didIteratorError = true;
|
|
20895
|
+
_iteratorError = err;
|
|
20896
|
+
} finally {
|
|
20897
|
+
try {
|
|
20898
|
+
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
|
|
20899
|
+
_iterator["return"]();
|
|
20900
|
+
}
|
|
20901
|
+
} finally {
|
|
20902
|
+
if (_didIteratorError) {
|
|
20903
|
+
throw _iteratorError;
|
|
20904
|
+
}
|
|
20905
|
+
}
|
|
20906
|
+
}
|
|
20907
|
+
|
|
20908
|
+
return config;
|
|
20909
|
+
}
|
|
20910
|
+
|
|
20911
|
+
function omit(object) {
|
|
20912
|
+
var _ref;
|
|
20913
|
+
|
|
20914
|
+
for (var _len = arguments.length, arrays = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
20915
|
+
arrays[_key - 1] = arguments[_key];
|
|
20916
|
+
}
|
|
20917
|
+
|
|
20918
|
+
var omitKeys = (_ref = []).concat.apply(_ref, arrays);
|
|
20919
|
+
|
|
20920
|
+
var output = {};
|
|
20921
|
+
var keys = Object.keys(object);
|
|
20922
|
+
|
|
20923
|
+
for (var _i2 = 0, _keys = keys; _i2 < _keys.length; _i2++) {
|
|
20924
|
+
var key = _keys[_i2];
|
|
20925
|
+
|
|
20926
|
+
if (omitKeys.indexOf(key) === -1) {
|
|
20927
|
+
output[key] = object[key];
|
|
20928
|
+
}
|
|
20929
|
+
}
|
|
20930
|
+
|
|
20931
|
+
return output;
|
|
20932
|
+
}
|
|
20933
|
+
|
|
20934
|
+
function callPlayer(method) {
|
|
20935
|
+
var _this$player;
|
|
20936
|
+
|
|
20937
|
+
// Util method for calling a method on this.player
|
|
20938
|
+
// but guard against errors and console.warn instead
|
|
20939
|
+
if (!this.player || !this.player[method]) {
|
|
20940
|
+
var message = "ReactPlayer: ".concat(this.constructor.displayName, " player could not call %c").concat(method, "%c \u2013 ");
|
|
20941
|
+
|
|
20942
|
+
if (!this.player) {
|
|
20943
|
+
message += 'The player was not available';
|
|
20944
|
+
} else if (!this.player[method]) {
|
|
20945
|
+
message += 'The method was not available';
|
|
20946
|
+
}
|
|
20947
|
+
|
|
20948
|
+
console.warn(message, 'font-weight: bold', '');
|
|
20949
|
+
return null;
|
|
20950
|
+
}
|
|
20951
|
+
|
|
20952
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
20953
|
+
args[_key2 - 1] = arguments[_key2];
|
|
20954
|
+
}
|
|
20955
|
+
|
|
20956
|
+
return (_this$player = this.player)[method].apply(_this$player, args);
|
|
20957
|
+
}
|
|
20958
|
+
|
|
20959
|
+
function isObject(val) {
|
|
20960
|
+
return val !== null && _typeof(val) === 'object';
|
|
20961
|
+
} // Deep comparison of two objects, but ignoring functions
|
|
20962
|
+
// and React elements, for use in shouldComponentUpdate
|
|
20963
|
+
|
|
20964
|
+
|
|
20965
|
+
function isEqual(a, b) {
|
|
20966
|
+
if (typeof a === 'function' && typeof b === 'function') {
|
|
20967
|
+
return true;
|
|
20968
|
+
}
|
|
20969
|
+
|
|
20970
|
+
if ((0, React__default.isValidElement)(a) && (0, React__default.isValidElement)(b)) {
|
|
20971
|
+
return true;
|
|
20972
|
+
}
|
|
20973
|
+
|
|
20974
|
+
if (a instanceof Array && b instanceof Array) {
|
|
20975
|
+
if (a.length !== b.length) {
|
|
20976
|
+
return false;
|
|
20977
|
+
}
|
|
20978
|
+
|
|
20979
|
+
for (var i = 0; i !== a.length; i++) {
|
|
20980
|
+
if (!isEqual(a[i], b[i])) {
|
|
20981
|
+
return false;
|
|
20982
|
+
}
|
|
20983
|
+
}
|
|
20984
|
+
|
|
20985
|
+
return true;
|
|
20986
|
+
}
|
|
20987
|
+
|
|
20988
|
+
if (isObject(a) && isObject(b)) {
|
|
20989
|
+
if (Object.keys(a).length !== Object.keys(b).length) {
|
|
20990
|
+
return false;
|
|
20991
|
+
}
|
|
20992
|
+
|
|
20993
|
+
for (var _i3 = 0, _Object$keys = Object.keys(a); _i3 < _Object$keys.length; _i3++) {
|
|
20994
|
+
var key = _Object$keys[_i3];
|
|
20995
|
+
|
|
20996
|
+
if (!isEqual(a[key], b[key])) {
|
|
20997
|
+
return false;
|
|
20998
|
+
}
|
|
20999
|
+
}
|
|
21000
|
+
|
|
21001
|
+
return true;
|
|
21002
|
+
}
|
|
21003
|
+
|
|
21004
|
+
return a === b;
|
|
21005
|
+
}
|
|
21006
|
+
|
|
21007
|
+
function isMediaStream(url) {
|
|
21008
|
+
return typeof window !== 'undefined' && typeof window.MediaStream !== 'undefined' && url instanceof window.MediaStream;
|
|
21009
|
+
}
|
|
21010
|
+
});
|
|
21011
|
+
|
|
21012
|
+
unwrapExports(utils$2);
|
|
21013
|
+
var utils_1$1 = utils$2.parseStartTime;
|
|
21014
|
+
var utils_2 = utils$2.parseEndTime;
|
|
21015
|
+
var utils_3 = utils$2.randomString;
|
|
21016
|
+
var utils_4 = utils$2.queryString;
|
|
21017
|
+
var utils_5 = utils$2.getSDK;
|
|
21018
|
+
var utils_6 = utils$2.getConfig;
|
|
21019
|
+
var utils_7 = utils$2.omit;
|
|
21020
|
+
var utils_8 = utils$2.callPlayer;
|
|
21021
|
+
var utils_9 = utils$2.isObject;
|
|
21022
|
+
var utils_10 = utils$2.isEqual;
|
|
21023
|
+
var utils_11 = utils$2.isMediaStream;
|
|
21024
|
+
|
|
21025
|
+
var Player_1 = createCommonjsModule(function (module, exports) {
|
|
21026
|
+
|
|
21027
|
+
Object.defineProperty(exports, "__esModule", {
|
|
21028
|
+
value: true
|
|
21029
|
+
});
|
|
21030
|
+
exports["default"] = void 0;
|
|
21031
|
+
|
|
21032
|
+
var _react = _interopRequireWildcard(React__default);
|
|
21033
|
+
|
|
21034
|
+
|
|
21035
|
+
|
|
21036
|
+
|
|
21037
|
+
|
|
21038
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
21039
|
+
|
|
21040
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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; }
|
|
21041
|
+
|
|
21042
|
+
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
|
21043
|
+
|
|
21044
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21045
|
+
|
|
21046
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21047
|
+
|
|
21048
|
+
function _defineProperties(target, props$$1) { for (var i = 0; i < props$$1.length; i++) { var descriptor = props$$1[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
21049
|
+
|
|
21050
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
21051
|
+
|
|
21052
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
21053
|
+
|
|
21054
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
21055
|
+
|
|
21056
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
21057
|
+
|
|
21058
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
21059
|
+
|
|
21060
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
21061
|
+
|
|
21062
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21063
|
+
|
|
21064
|
+
var SEEK_ON_PLAY_EXPIRY = 5000;
|
|
21065
|
+
|
|
21066
|
+
var Player =
|
|
21067
|
+
/*#__PURE__*/
|
|
21068
|
+
function (_Component) {
|
|
21069
|
+
_inherits(Player, _Component);
|
|
21070
|
+
|
|
21071
|
+
function Player() {
|
|
21072
|
+
var _getPrototypeOf2;
|
|
21073
|
+
|
|
21074
|
+
var _this;
|
|
21075
|
+
|
|
21076
|
+
_classCallCheck(this, Player);
|
|
21077
|
+
|
|
21078
|
+
for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
21079
|
+
_args[_key] = arguments[_key];
|
|
21080
|
+
}
|
|
21081
|
+
|
|
21082
|
+
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Player)).call.apply(_getPrototypeOf2, [this].concat(_args)));
|
|
21083
|
+
|
|
21084
|
+
_defineProperty(_assertThisInitialized(_this), "mounted", false);
|
|
21085
|
+
|
|
21086
|
+
_defineProperty(_assertThisInitialized(_this), "isReady", false);
|
|
21087
|
+
|
|
21088
|
+
_defineProperty(_assertThisInitialized(_this), "isPlaying", false);
|
|
21089
|
+
|
|
21090
|
+
_defineProperty(_assertThisInitialized(_this), "isLoading", true);
|
|
21091
|
+
|
|
21092
|
+
_defineProperty(_assertThisInitialized(_this), "loadOnReady", null);
|
|
21093
|
+
|
|
21094
|
+
_defineProperty(_assertThisInitialized(_this), "startOnPlay", true);
|
|
21095
|
+
|
|
21096
|
+
_defineProperty(_assertThisInitialized(_this), "seekOnPlay", null);
|
|
21097
|
+
|
|
21098
|
+
_defineProperty(_assertThisInitialized(_this), "onDurationCalled", false);
|
|
21099
|
+
|
|
21100
|
+
_defineProperty(_assertThisInitialized(_this), "getInternalPlayer", function (key) {
|
|
21101
|
+
if (!_this.player) return null;
|
|
21102
|
+
return _this.player[key];
|
|
21103
|
+
});
|
|
21104
|
+
|
|
21105
|
+
_defineProperty(_assertThisInitialized(_this), "progress", function () {
|
|
21106
|
+
if (_this.props.url && _this.player && _this.isReady) {
|
|
21107
|
+
var playedSeconds = _this.getCurrentTime() || 0;
|
|
21108
|
+
|
|
21109
|
+
var loadedSeconds = _this.getSecondsLoaded();
|
|
21110
|
+
|
|
21111
|
+
var duration = _this.getDuration();
|
|
21112
|
+
|
|
21113
|
+
if (duration) {
|
|
21114
|
+
var progress = {
|
|
21115
|
+
playedSeconds: playedSeconds,
|
|
21116
|
+
played: playedSeconds / duration
|
|
21117
|
+
};
|
|
21118
|
+
|
|
21119
|
+
if (loadedSeconds !== null) {
|
|
21120
|
+
progress.loadedSeconds = loadedSeconds;
|
|
21121
|
+
progress.loaded = loadedSeconds / duration;
|
|
21122
|
+
} // Only call onProgress if values have changed
|
|
21123
|
+
|
|
21124
|
+
|
|
21125
|
+
if (progress.playedSeconds !== _this.prevPlayed || progress.loadedSeconds !== _this.prevLoaded) {
|
|
21126
|
+
_this.props.onProgress(progress);
|
|
21127
|
+
}
|
|
21128
|
+
|
|
21129
|
+
_this.prevPlayed = progress.playedSeconds;
|
|
21130
|
+
_this.prevLoaded = progress.loadedSeconds;
|
|
21131
|
+
}
|
|
21132
|
+
}
|
|
21133
|
+
|
|
21134
|
+
_this.progressTimeout = setTimeout(_this.progress, _this.props.progressFrequency || _this.props.progressInterval);
|
|
21135
|
+
});
|
|
21136
|
+
|
|
21137
|
+
_defineProperty(_assertThisInitialized(_this), "handleReady", function () {
|
|
21138
|
+
if (!_this.mounted) return;
|
|
21139
|
+
_this.isReady = true;
|
|
21140
|
+
_this.isLoading = false;
|
|
21141
|
+
var _this$props = _this.props,
|
|
21142
|
+
onReady = _this$props.onReady,
|
|
21143
|
+
playing = _this$props.playing,
|
|
21144
|
+
volume = _this$props.volume,
|
|
21145
|
+
muted = _this$props.muted;
|
|
21146
|
+
onReady();
|
|
21147
|
+
|
|
21148
|
+
if (!muted && volume !== null) {
|
|
21149
|
+
_this.player.setVolume(volume);
|
|
21150
|
+
}
|
|
21151
|
+
|
|
21152
|
+
if (_this.loadOnReady) {
|
|
21153
|
+
_this.player.load(_this.loadOnReady, true);
|
|
21154
|
+
|
|
21155
|
+
_this.loadOnReady = null;
|
|
21156
|
+
} else if (playing) {
|
|
21157
|
+
_this.player.play();
|
|
21158
|
+
}
|
|
21159
|
+
|
|
21160
|
+
_this.handleDurationCheck();
|
|
21161
|
+
});
|
|
21162
|
+
|
|
21163
|
+
_defineProperty(_assertThisInitialized(_this), "handlePlay", function () {
|
|
21164
|
+
_this.isPlaying = true;
|
|
21165
|
+
_this.isLoading = false;
|
|
21166
|
+
var _this$props2 = _this.props,
|
|
21167
|
+
onStart = _this$props2.onStart,
|
|
21168
|
+
onPlay = _this$props2.onPlay,
|
|
21169
|
+
playbackRate = _this$props2.playbackRate;
|
|
21170
|
+
|
|
21171
|
+
if (_this.startOnPlay) {
|
|
21172
|
+
if (_this.player.setPlaybackRate && playbackRate !== 1) {
|
|
21173
|
+
_this.player.setPlaybackRate(playbackRate);
|
|
21174
|
+
}
|
|
21175
|
+
|
|
21176
|
+
onStart();
|
|
21177
|
+
_this.startOnPlay = false;
|
|
21178
|
+
}
|
|
21179
|
+
|
|
21180
|
+
onPlay();
|
|
21181
|
+
|
|
21182
|
+
if (_this.seekOnPlay) {
|
|
21183
|
+
_this.seekTo(_this.seekOnPlay);
|
|
21184
|
+
|
|
21185
|
+
_this.seekOnPlay = null;
|
|
21186
|
+
}
|
|
21187
|
+
|
|
21188
|
+
_this.handleDurationCheck();
|
|
21189
|
+
});
|
|
21190
|
+
|
|
21191
|
+
_defineProperty(_assertThisInitialized(_this), "handlePause", function (e) {
|
|
21192
|
+
_this.isPlaying = false;
|
|
21193
|
+
|
|
21194
|
+
if (!_this.isLoading) {
|
|
21195
|
+
_this.props.onPause(e);
|
|
21196
|
+
}
|
|
21197
|
+
});
|
|
21198
|
+
|
|
21199
|
+
_defineProperty(_assertThisInitialized(_this), "handleEnded", function () {
|
|
21200
|
+
var _this$props3 = _this.props,
|
|
21201
|
+
activePlayer = _this$props3.activePlayer,
|
|
21202
|
+
loop = _this$props3.loop,
|
|
21203
|
+
onEnded = _this$props3.onEnded;
|
|
21204
|
+
|
|
21205
|
+
if (activePlayer.loopOnEnded && loop) {
|
|
21206
|
+
_this.seekTo(0);
|
|
21207
|
+
}
|
|
21208
|
+
|
|
21209
|
+
if (!loop) {
|
|
21210
|
+
_this.isPlaying = false;
|
|
21211
|
+
onEnded();
|
|
21212
|
+
}
|
|
21213
|
+
});
|
|
21214
|
+
|
|
21215
|
+
_defineProperty(_assertThisInitialized(_this), "handleError", function () {
|
|
21216
|
+
var _this$props4;
|
|
21217
|
+
|
|
21218
|
+
_this.isLoading = false;
|
|
21219
|
+
|
|
21220
|
+
(_this$props4 = _this.props).onError.apply(_this$props4, arguments);
|
|
21221
|
+
});
|
|
21222
|
+
|
|
21223
|
+
_defineProperty(_assertThisInitialized(_this), "handleDurationCheck", function () {
|
|
21224
|
+
clearTimeout(_this.durationCheckTimeout);
|
|
21225
|
+
|
|
21226
|
+
var duration = _this.getDuration();
|
|
21227
|
+
|
|
21228
|
+
if (duration) {
|
|
21229
|
+
if (!_this.onDurationCalled) {
|
|
21230
|
+
_this.props.onDuration(duration);
|
|
21231
|
+
|
|
21232
|
+
_this.onDurationCalled = true;
|
|
21233
|
+
}
|
|
21234
|
+
} else {
|
|
21235
|
+
_this.durationCheckTimeout = setTimeout(_this.handleDurationCheck, 100);
|
|
21236
|
+
}
|
|
21237
|
+
});
|
|
21238
|
+
|
|
21239
|
+
_defineProperty(_assertThisInitialized(_this), "handleLoaded", function () {
|
|
21240
|
+
// Sometimes we know loading has stopped but onReady/onPlay are never called
|
|
21241
|
+
// so this provides a way for players to avoid getting stuck
|
|
21242
|
+
_this.isLoading = false;
|
|
21243
|
+
});
|
|
21244
|
+
|
|
21245
|
+
_defineProperty(_assertThisInitialized(_this), "ref", function (player) {
|
|
21246
|
+
if (player) {
|
|
21247
|
+
_this.player = player;
|
|
21248
|
+
}
|
|
21249
|
+
});
|
|
21250
|
+
|
|
21251
|
+
return _this;
|
|
21252
|
+
}
|
|
21253
|
+
|
|
21254
|
+
_createClass(Player, [{
|
|
21255
|
+
key: "componentDidMount",
|
|
21256
|
+
value: function componentDidMount() {
|
|
21257
|
+
this.mounted = true;
|
|
21258
|
+
this.player.load(this.props.url);
|
|
21259
|
+
this.progress();
|
|
21260
|
+
}
|
|
21261
|
+
}, {
|
|
21262
|
+
key: "componentWillUnmount",
|
|
21263
|
+
value: function componentWillUnmount() {
|
|
21264
|
+
clearTimeout(this.progressTimeout);
|
|
21265
|
+
clearTimeout(this.durationCheckTimeout);
|
|
21266
|
+
|
|
21267
|
+
if (this.isReady) {
|
|
21268
|
+
this.player.stop();
|
|
21269
|
+
}
|
|
21270
|
+
|
|
21271
|
+
if (this.player.disablePIP) {
|
|
21272
|
+
this.player.disablePIP();
|
|
21273
|
+
}
|
|
21274
|
+
|
|
21275
|
+
this.mounted = false;
|
|
21276
|
+
}
|
|
21277
|
+
}, {
|
|
21278
|
+
key: "componentDidUpdate",
|
|
21279
|
+
value: function componentDidUpdate(prevProps) {
|
|
21280
|
+
var _this2 = this;
|
|
21281
|
+
|
|
21282
|
+
// Invoke player methods based on changed props
|
|
21283
|
+
var _this$props5 = this.props,
|
|
21284
|
+
url = _this$props5.url,
|
|
21285
|
+
playing = _this$props5.playing,
|
|
21286
|
+
volume = _this$props5.volume,
|
|
21287
|
+
muted = _this$props5.muted,
|
|
21288
|
+
playbackRate = _this$props5.playbackRate,
|
|
21289
|
+
pip = _this$props5.pip,
|
|
21290
|
+
loop = _this$props5.loop,
|
|
21291
|
+
activePlayer = _this$props5.activePlayer;
|
|
21292
|
+
|
|
21293
|
+
if (!(0, utils$2.isEqual)(prevProps.url, url)) {
|
|
21294
|
+
if (this.isLoading && !activePlayer.forceLoad) {
|
|
21295
|
+
console.warn("ReactPlayer: the attempt to load ".concat(url, " is being deferred until the player has loaded"));
|
|
21296
|
+
this.loadOnReady = url;
|
|
21297
|
+
return;
|
|
21298
|
+
}
|
|
21299
|
+
|
|
21300
|
+
this.isLoading = true;
|
|
21301
|
+
this.startOnPlay = true;
|
|
21302
|
+
this.onDurationCalled = false;
|
|
21303
|
+
this.player.load(url, this.isReady);
|
|
21304
|
+
}
|
|
21305
|
+
|
|
21306
|
+
if (!prevProps.playing && playing && !this.isPlaying) {
|
|
21307
|
+
this.player.play();
|
|
21308
|
+
}
|
|
21309
|
+
|
|
21310
|
+
if (prevProps.playing && !playing && this.isPlaying) {
|
|
21311
|
+
this.player.pause();
|
|
21312
|
+
}
|
|
21313
|
+
|
|
21314
|
+
if (!prevProps.pip && pip && this.player.enablePIP) {
|
|
21315
|
+
this.player.enablePIP();
|
|
21316
|
+
}
|
|
21317
|
+
|
|
21318
|
+
if (prevProps.pip && !pip && this.player.disablePIP) {
|
|
21319
|
+
this.player.disablePIP();
|
|
21320
|
+
}
|
|
21321
|
+
|
|
21322
|
+
if (prevProps.volume !== volume && volume !== null) {
|
|
21323
|
+
this.player.setVolume(volume);
|
|
21324
|
+
}
|
|
21325
|
+
|
|
21326
|
+
if (prevProps.muted !== muted) {
|
|
21327
|
+
if (muted) {
|
|
21328
|
+
this.player.mute();
|
|
21329
|
+
} else {
|
|
21330
|
+
this.player.unmute();
|
|
21331
|
+
|
|
21332
|
+
if (volume !== null) {
|
|
21333
|
+
// Set volume next tick to fix a bug with DailyMotion
|
|
21334
|
+
setTimeout(function () {
|
|
21335
|
+
return _this2.player.setVolume(volume);
|
|
21336
|
+
});
|
|
21337
|
+
}
|
|
21338
|
+
}
|
|
21339
|
+
}
|
|
21340
|
+
|
|
21341
|
+
if (prevProps.playbackRate !== playbackRate && this.player.setPlaybackRate) {
|
|
21342
|
+
this.player.setPlaybackRate(playbackRate);
|
|
21343
|
+
}
|
|
21344
|
+
|
|
21345
|
+
if (prevProps.loop !== loop && this.player.setLoop) {
|
|
21346
|
+
this.player.setLoop(loop);
|
|
21347
|
+
}
|
|
21348
|
+
}
|
|
21349
|
+
}, {
|
|
21350
|
+
key: "getDuration",
|
|
21351
|
+
value: function getDuration() {
|
|
21352
|
+
if (!this.isReady) return null;
|
|
21353
|
+
return this.player.getDuration();
|
|
21354
|
+
}
|
|
21355
|
+
}, {
|
|
21356
|
+
key: "getCurrentTime",
|
|
21357
|
+
value: function getCurrentTime() {
|
|
21358
|
+
if (!this.isReady) return null;
|
|
21359
|
+
return this.player.getCurrentTime();
|
|
21360
|
+
}
|
|
21361
|
+
}, {
|
|
21362
|
+
key: "getSecondsLoaded",
|
|
21363
|
+
value: function getSecondsLoaded() {
|
|
21364
|
+
if (!this.isReady) return null;
|
|
21365
|
+
return this.player.getSecondsLoaded();
|
|
21366
|
+
}
|
|
21367
|
+
}, {
|
|
21368
|
+
key: "seekTo",
|
|
21369
|
+
value: function seekTo(amount, type) {
|
|
21370
|
+
var _this3 = this;
|
|
21371
|
+
|
|
21372
|
+
// When seeking before player is ready, store value and seek later
|
|
21373
|
+
if (!this.isReady && amount !== 0) {
|
|
21374
|
+
this.seekOnPlay = amount;
|
|
21375
|
+
setTimeout(function () {
|
|
21376
|
+
_this3.seekOnPlay = null;
|
|
21377
|
+
}, SEEK_ON_PLAY_EXPIRY);
|
|
21378
|
+
return;
|
|
21379
|
+
}
|
|
21380
|
+
|
|
21381
|
+
var isFraction = !type ? amount > 0 && amount < 1 : type === 'fraction';
|
|
21382
|
+
|
|
21383
|
+
if (isFraction) {
|
|
21384
|
+
// Convert fraction to seconds based on duration
|
|
21385
|
+
var duration = this.player.getDuration();
|
|
21386
|
+
|
|
21387
|
+
if (!duration) {
|
|
21388
|
+
console.warn('ReactPlayer: could not seek using fraction – duration not yet available');
|
|
21389
|
+
return;
|
|
21390
|
+
}
|
|
21391
|
+
|
|
21392
|
+
this.player.seekTo(duration * amount);
|
|
21393
|
+
return;
|
|
21394
|
+
}
|
|
21395
|
+
|
|
21396
|
+
this.player.seekTo(amount);
|
|
21397
|
+
}
|
|
21398
|
+
}, {
|
|
21399
|
+
key: "render",
|
|
21400
|
+
value: function render() {
|
|
21401
|
+
var Player = this.props.activePlayer;
|
|
21402
|
+
|
|
21403
|
+
if (!Player) {
|
|
21404
|
+
return null;
|
|
21405
|
+
}
|
|
21406
|
+
|
|
21407
|
+
return _react["default"].createElement(Player, _extends({}, this.props, {
|
|
21408
|
+
ref: this.ref,
|
|
21409
|
+
onReady: this.handleReady,
|
|
21410
|
+
onPlay: this.handlePlay,
|
|
21411
|
+
onPause: this.handlePause,
|
|
21412
|
+
onEnded: this.handleEnded,
|
|
21413
|
+
onLoaded: this.handleLoaded,
|
|
21414
|
+
onError: this.handleError
|
|
21415
|
+
}));
|
|
21416
|
+
}
|
|
21417
|
+
}]);
|
|
21418
|
+
|
|
21419
|
+
return Player;
|
|
21420
|
+
}(_react.Component);
|
|
21421
|
+
|
|
21422
|
+
exports["default"] = Player;
|
|
21423
|
+
|
|
21424
|
+
_defineProperty(Player, "displayName", 'Player');
|
|
21425
|
+
|
|
21426
|
+
_defineProperty(Player, "propTypes", props.propTypes);
|
|
21427
|
+
|
|
21428
|
+
_defineProperty(Player, "defaultProps", props.defaultProps);
|
|
21429
|
+
});
|
|
21430
|
+
|
|
21431
|
+
unwrapExports(Player_1);
|
|
21432
|
+
|
|
21433
|
+
var singlePlayer = createCommonjsModule(function (module, exports) {
|
|
21434
|
+
|
|
21435
|
+
Object.defineProperty(exports, "__esModule", {
|
|
21436
|
+
value: true
|
|
21437
|
+
});
|
|
21438
|
+
exports["default"] = createSinglePlayer;
|
|
21439
|
+
|
|
21440
|
+
var _react = _interopRequireWildcard(React__default);
|
|
21441
|
+
|
|
21442
|
+
|
|
21443
|
+
|
|
21444
|
+
|
|
21445
|
+
|
|
21446
|
+
var _Player = _interopRequireDefault(Player_1);
|
|
21447
|
+
|
|
21448
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21449
|
+
|
|
21450
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
21451
|
+
|
|
21452
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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; }
|
|
21453
|
+
|
|
21454
|
+
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
|
21455
|
+
|
|
21456
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21457
|
+
|
|
21458
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
21459
|
+
|
|
21460
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
21461
|
+
|
|
21462
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21463
|
+
|
|
21464
|
+
function _defineProperties(target, props$$1) { for (var i = 0; i < props$$1.length; i++) { var descriptor = props$$1[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
21465
|
+
|
|
21466
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
21467
|
+
|
|
21468
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
21469
|
+
|
|
21470
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
21471
|
+
|
|
21472
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
21473
|
+
|
|
21474
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
21475
|
+
|
|
21476
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
21477
|
+
|
|
21478
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21479
|
+
|
|
21480
|
+
var SUPPORTED_PROPS = Object.keys(props.propTypes);
|
|
21481
|
+
|
|
21482
|
+
function createSinglePlayer(activePlayer) {
|
|
21483
|
+
var _class, _temp;
|
|
21484
|
+
|
|
21485
|
+
return _temp = _class =
|
|
21486
|
+
/*#__PURE__*/
|
|
21487
|
+
function (_Component) {
|
|
21488
|
+
_inherits(SinglePlayer, _Component);
|
|
21489
|
+
|
|
21490
|
+
function SinglePlayer() {
|
|
21491
|
+
var _getPrototypeOf2;
|
|
21492
|
+
|
|
21493
|
+
var _this;
|
|
21494
|
+
|
|
21495
|
+
_classCallCheck(this, SinglePlayer);
|
|
21496
|
+
|
|
21497
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
21498
|
+
args[_key] = arguments[_key];
|
|
21499
|
+
}
|
|
21500
|
+
|
|
21501
|
+
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(SinglePlayer)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
21502
|
+
|
|
21503
|
+
_defineProperty(_assertThisInitialized(_this), "config", (0, utils$2.getConfig)(_this.props, props.defaultProps, true));
|
|
21504
|
+
|
|
21505
|
+
_defineProperty(_assertThisInitialized(_this), "getDuration", function () {
|
|
21506
|
+
if (!_this.player) return null;
|
|
21507
|
+
return _this.player.getDuration();
|
|
21508
|
+
});
|
|
21509
|
+
|
|
21510
|
+
_defineProperty(_assertThisInitialized(_this), "getCurrentTime", function () {
|
|
21511
|
+
if (!_this.player) return null;
|
|
21512
|
+
return _this.player.getCurrentTime();
|
|
21513
|
+
});
|
|
21514
|
+
|
|
21515
|
+
_defineProperty(_assertThisInitialized(_this), "getSecondsLoaded", function () {
|
|
21516
|
+
if (!_this.player) return null;
|
|
21517
|
+
return _this.player.getSecondsLoaded();
|
|
21518
|
+
});
|
|
21519
|
+
|
|
21520
|
+
_defineProperty(_assertThisInitialized(_this), "getInternalPlayer", function () {
|
|
21521
|
+
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'player';
|
|
21522
|
+
if (!_this.player) return null;
|
|
21523
|
+
return _this.player.getInternalPlayer(key);
|
|
21524
|
+
});
|
|
21525
|
+
|
|
21526
|
+
_defineProperty(_assertThisInitialized(_this), "seekTo", function (fraction, type) {
|
|
21527
|
+
if (!_this.player) return null;
|
|
21528
|
+
|
|
21529
|
+
_this.player.seekTo(fraction, type);
|
|
21530
|
+
});
|
|
21531
|
+
|
|
21532
|
+
_defineProperty(_assertThisInitialized(_this), "ref", function (player) {
|
|
21533
|
+
_this.player = player;
|
|
21534
|
+
});
|
|
21535
|
+
|
|
21536
|
+
return _this;
|
|
21537
|
+
}
|
|
21538
|
+
|
|
21539
|
+
_createClass(SinglePlayer, [{
|
|
21540
|
+
key: "shouldComponentUpdate",
|
|
21541
|
+
value: function shouldComponentUpdate(nextProps) {
|
|
21542
|
+
return !(0, utils$2.isEqual)(this.props, nextProps);
|
|
21543
|
+
}
|
|
21544
|
+
}, {
|
|
21545
|
+
key: "componentDidUpdate",
|
|
21546
|
+
value: function componentDidUpdate() {
|
|
21547
|
+
this.config = (0, utils$2.getConfig)(this.props, props.defaultProps);
|
|
21548
|
+
}
|
|
21549
|
+
}, {
|
|
21550
|
+
key: "render",
|
|
21551
|
+
value: function render() {
|
|
21552
|
+
var _this$config$file = this.config.file,
|
|
21553
|
+
forceVideo = _this$config$file.forceVideo,
|
|
21554
|
+
forceAudio = _this$config$file.forceAudio,
|
|
21555
|
+
forceHLS = _this$config$file.forceHLS,
|
|
21556
|
+
forceDASH = _this$config$file.forceDASH;
|
|
21557
|
+
var skipCanPlay = forceVideo || forceAudio || forceHLS || forceDASH;
|
|
21558
|
+
|
|
21559
|
+
if (!activePlayer.canPlay(this.props.url) && !skipCanPlay) {
|
|
21560
|
+
return null;
|
|
21561
|
+
}
|
|
21562
|
+
|
|
21563
|
+
var _this$props = this.props,
|
|
21564
|
+
style = _this$props.style,
|
|
21565
|
+
width = _this$props.width,
|
|
21566
|
+
height = _this$props.height,
|
|
21567
|
+
Wrapper = _this$props.wrapper;
|
|
21568
|
+
var otherProps = (0, utils$2.omit)(this.props, SUPPORTED_PROPS, props.DEPRECATED_CONFIG_PROPS);
|
|
21569
|
+
return _react["default"].createElement(Wrapper, _extends({
|
|
21570
|
+
style: _objectSpread({}, style, {
|
|
21571
|
+
width: width,
|
|
21572
|
+
height: height
|
|
21573
|
+
})
|
|
21574
|
+
}, otherProps), _react["default"].createElement(_Player["default"], _extends({}, this.props, {
|
|
21575
|
+
ref: this.ref,
|
|
21576
|
+
activePlayer: activePlayer,
|
|
21577
|
+
config: this.config
|
|
21578
|
+
})));
|
|
21579
|
+
}
|
|
21580
|
+
}]);
|
|
21581
|
+
|
|
21582
|
+
return SinglePlayer;
|
|
21583
|
+
}(_react.Component), _defineProperty(_class, "displayName", "".concat(activePlayer.displayName, "Player")), _defineProperty(_class, "propTypes", props.propTypes), _defineProperty(_class, "defaultProps", props.defaultProps), _defineProperty(_class, "canPlay", activePlayer.canPlay), _temp;
|
|
21584
|
+
}
|
|
21585
|
+
});
|
|
21586
|
+
|
|
21587
|
+
unwrapExports(singlePlayer);
|
|
21588
|
+
|
|
21589
|
+
var YouTube_1 = createCommonjsModule(function (module, exports) {
|
|
21590
|
+
|
|
21591
|
+
Object.defineProperty(exports, "__esModule", {
|
|
21592
|
+
value: true
|
|
21593
|
+
});
|
|
21594
|
+
exports["default"] = exports.YouTube = void 0;
|
|
21595
|
+
|
|
21596
|
+
var _react = _interopRequireWildcard(React__default);
|
|
21597
|
+
|
|
21598
|
+
|
|
21599
|
+
|
|
21600
|
+
var _singlePlayer = _interopRequireDefault(singlePlayer);
|
|
21601
|
+
|
|
21602
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21603
|
+
|
|
21604
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
21605
|
+
|
|
21606
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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; }
|
|
21607
|
+
|
|
21608
|
+
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
|
21609
|
+
|
|
21610
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
21611
|
+
|
|
21612
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
21613
|
+
|
|
21614
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21615
|
+
|
|
21616
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
21617
|
+
|
|
21618
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
21619
|
+
|
|
21620
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
21621
|
+
|
|
21622
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
21623
|
+
|
|
21624
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
21625
|
+
|
|
21626
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
21627
|
+
|
|
21628
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
21629
|
+
|
|
21630
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21631
|
+
|
|
21632
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
21633
|
+
|
|
21634
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
21635
|
+
|
|
21636
|
+
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
21637
|
+
|
|
21638
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21639
|
+
|
|
21640
|
+
var SDK_URL = 'https://www.youtube.com/iframe_api';
|
|
21641
|
+
var SDK_GLOBAL = 'YT';
|
|
21642
|
+
var SDK_GLOBAL_READY = 'onYouTubeIframeAPIReady';
|
|
21643
|
+
var MATCH_URL = /(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})|youtube\.com\/playlist\?list=/;
|
|
21644
|
+
var MATCH_PLAYLIST = /list=([a-zA-Z0-9_-]+)/;
|
|
21645
|
+
|
|
21646
|
+
function parsePlaylist(url) {
|
|
21647
|
+
if (MATCH_PLAYLIST.test(url)) {
|
|
21648
|
+
var _url$match = url.match(MATCH_PLAYLIST),
|
|
21649
|
+
_url$match2 = _slicedToArray(_url$match, 2),
|
|
21650
|
+
playlistId = _url$match2[1];
|
|
21651
|
+
|
|
21652
|
+
return {
|
|
21653
|
+
listType: 'playlist',
|
|
21654
|
+
list: playlistId
|
|
21655
|
+
};
|
|
21656
|
+
}
|
|
21657
|
+
|
|
21658
|
+
return {};
|
|
21659
|
+
}
|
|
21660
|
+
|
|
21661
|
+
var YouTube =
|
|
21662
|
+
/*#__PURE__*/
|
|
21663
|
+
function (_Component) {
|
|
21664
|
+
_inherits(YouTube, _Component);
|
|
21665
|
+
|
|
21666
|
+
function YouTube() {
|
|
21667
|
+
var _getPrototypeOf2;
|
|
21668
|
+
|
|
21669
|
+
var _this;
|
|
21670
|
+
|
|
21671
|
+
_classCallCheck(this, YouTube);
|
|
21672
|
+
|
|
21673
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
21674
|
+
args[_key] = arguments[_key];
|
|
21675
|
+
}
|
|
21676
|
+
|
|
21677
|
+
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(YouTube)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
21678
|
+
|
|
21679
|
+
_defineProperty(_assertThisInitialized(_this), "callPlayer", utils$2.callPlayer);
|
|
21680
|
+
|
|
21681
|
+
_defineProperty(_assertThisInitialized(_this), "onStateChange", function (_ref) {
|
|
21682
|
+
var data = _ref.data;
|
|
21683
|
+
var _this$props = _this.props,
|
|
21684
|
+
onPlay = _this$props.onPlay,
|
|
21685
|
+
onPause = _this$props.onPause,
|
|
21686
|
+
onBuffer = _this$props.onBuffer,
|
|
21687
|
+
onBufferEnd = _this$props.onBufferEnd,
|
|
21688
|
+
onEnded = _this$props.onEnded,
|
|
21689
|
+
onReady = _this$props.onReady,
|
|
21690
|
+
loop = _this$props.loop;
|
|
21691
|
+
var _window$SDK_GLOBAL$Pl = window[SDK_GLOBAL].PlayerState,
|
|
21692
|
+
PLAYING = _window$SDK_GLOBAL$Pl.PLAYING,
|
|
21693
|
+
PAUSED = _window$SDK_GLOBAL$Pl.PAUSED,
|
|
21694
|
+
BUFFERING = _window$SDK_GLOBAL$Pl.BUFFERING,
|
|
21695
|
+
ENDED = _window$SDK_GLOBAL$Pl.ENDED,
|
|
21696
|
+
CUED = _window$SDK_GLOBAL$Pl.CUED;
|
|
21697
|
+
|
|
21698
|
+
if (data === PLAYING) {
|
|
21699
|
+
onPlay();
|
|
21700
|
+
onBufferEnd();
|
|
21701
|
+
}
|
|
21702
|
+
|
|
21703
|
+
if (data === PAUSED) onPause();
|
|
21704
|
+
if (data === BUFFERING) onBuffer();
|
|
21705
|
+
|
|
21706
|
+
if (data === ENDED) {
|
|
21707
|
+
var isPlaylist = !!_this.callPlayer('getPlaylist');
|
|
21708
|
+
|
|
21709
|
+
if (loop && !isPlaylist) {
|
|
21710
|
+
_this.play(); // Only loop manually if not playing a playlist
|
|
21711
|
+
|
|
21712
|
+
}
|
|
21713
|
+
|
|
21714
|
+
onEnded();
|
|
21715
|
+
}
|
|
21716
|
+
|
|
21717
|
+
if (data === CUED) onReady();
|
|
21718
|
+
});
|
|
21719
|
+
|
|
21720
|
+
_defineProperty(_assertThisInitialized(_this), "mute", function () {
|
|
21721
|
+
_this.callPlayer('mute');
|
|
21722
|
+
});
|
|
21723
|
+
|
|
21724
|
+
_defineProperty(_assertThisInitialized(_this), "unmute", function () {
|
|
21725
|
+
_this.callPlayer('unMute');
|
|
21726
|
+
});
|
|
21727
|
+
|
|
21728
|
+
_defineProperty(_assertThisInitialized(_this), "ref", function (container) {
|
|
21729
|
+
_this.container = container;
|
|
21730
|
+
});
|
|
21731
|
+
|
|
21732
|
+
return _this;
|
|
21733
|
+
}
|
|
21734
|
+
|
|
21735
|
+
_createClass(YouTube, [{
|
|
21736
|
+
key: "load",
|
|
21737
|
+
value: function load(url, isReady) {
|
|
21738
|
+
var _this2 = this;
|
|
21739
|
+
|
|
21740
|
+
var _this$props2 = this.props,
|
|
21741
|
+
playing = _this$props2.playing,
|
|
21742
|
+
muted = _this$props2.muted,
|
|
21743
|
+
playsinline = _this$props2.playsinline,
|
|
21744
|
+
controls = _this$props2.controls,
|
|
21745
|
+
loop = _this$props2.loop,
|
|
21746
|
+
config = _this$props2.config,
|
|
21747
|
+
_onError = _this$props2.onError;
|
|
21748
|
+
var _config$youtube = config.youtube,
|
|
21749
|
+
playerVars = _config$youtube.playerVars,
|
|
21750
|
+
embedOptions = _config$youtube.embedOptions;
|
|
21751
|
+
var id = url && url.match(MATCH_URL)[1];
|
|
21752
|
+
|
|
21753
|
+
if (isReady) {
|
|
21754
|
+
if (MATCH_PLAYLIST.test(url)) {
|
|
21755
|
+
this.player.loadPlaylist(parsePlaylist(url));
|
|
21756
|
+
return;
|
|
21757
|
+
}
|
|
21758
|
+
|
|
21759
|
+
this.player.cueVideoById({
|
|
21760
|
+
videoId: id,
|
|
21761
|
+
startSeconds: (0, utils$2.parseStartTime)(url) || playerVars.start,
|
|
21762
|
+
endSeconds: (0, utils$2.parseEndTime)(url) || playerVars.end
|
|
21763
|
+
});
|
|
21764
|
+
return;
|
|
21765
|
+
}
|
|
21766
|
+
|
|
21767
|
+
(0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY, function (YT) {
|
|
21768
|
+
return YT.loaded;
|
|
21769
|
+
}).then(function (YT) {
|
|
21770
|
+
if (!_this2.container) return;
|
|
21771
|
+
_this2.player = new YT.Player(_this2.container, _objectSpread({
|
|
21772
|
+
width: '100%',
|
|
21773
|
+
height: '100%',
|
|
21774
|
+
videoId: id,
|
|
21775
|
+
playerVars: _objectSpread({
|
|
21776
|
+
autoplay: playing ? 1 : 0,
|
|
21777
|
+
mute: muted ? 1 : 0,
|
|
21778
|
+
controls: controls ? 1 : 0,
|
|
21779
|
+
start: (0, utils$2.parseStartTime)(url),
|
|
21780
|
+
end: (0, utils$2.parseEndTime)(url),
|
|
21781
|
+
origin: window.location.origin,
|
|
21782
|
+
playsinline: playsinline
|
|
21783
|
+
}, parsePlaylist(url), {}, playerVars),
|
|
21784
|
+
events: {
|
|
21785
|
+
onReady: function onReady() {
|
|
21786
|
+
if (loop) {
|
|
21787
|
+
_this2.player.setLoop(true); // Enable playlist looping
|
|
21788
|
+
|
|
21789
|
+
}
|
|
21790
|
+
|
|
21791
|
+
_this2.props.onReady();
|
|
21792
|
+
},
|
|
21793
|
+
onStateChange: _this2.onStateChange,
|
|
21794
|
+
onError: function onError(event) {
|
|
21795
|
+
return _onError(event.data);
|
|
21796
|
+
}
|
|
21797
|
+
}
|
|
21798
|
+
}, embedOptions));
|
|
21799
|
+
}, _onError);
|
|
21800
|
+
}
|
|
21801
|
+
}, {
|
|
21802
|
+
key: "play",
|
|
21803
|
+
value: function play() {
|
|
21804
|
+
this.callPlayer('playVideo');
|
|
21805
|
+
}
|
|
21806
|
+
}, {
|
|
21807
|
+
key: "pause",
|
|
21808
|
+
value: function pause() {
|
|
21809
|
+
this.callPlayer('pauseVideo');
|
|
21810
|
+
}
|
|
21811
|
+
}, {
|
|
21812
|
+
key: "stop",
|
|
21813
|
+
value: function stop() {
|
|
21814
|
+
if (!document.body.contains(this.callPlayer('getIframe'))) return;
|
|
21815
|
+
this.callPlayer('stopVideo');
|
|
21816
|
+
}
|
|
21817
|
+
}, {
|
|
21818
|
+
key: "seekTo",
|
|
21819
|
+
value: function seekTo(amount) {
|
|
21820
|
+
this.callPlayer('seekTo', amount);
|
|
21821
|
+
|
|
21822
|
+
if (!this.props.playing) {
|
|
21823
|
+
this.pause();
|
|
21824
|
+
}
|
|
21825
|
+
}
|
|
21826
|
+
}, {
|
|
21827
|
+
key: "setVolume",
|
|
21828
|
+
value: function setVolume(fraction) {
|
|
21829
|
+
this.callPlayer('setVolume', fraction * 100);
|
|
21830
|
+
}
|
|
21831
|
+
}, {
|
|
21832
|
+
key: "setPlaybackRate",
|
|
21833
|
+
value: function setPlaybackRate(rate) {
|
|
21834
|
+
this.callPlayer('setPlaybackRate', rate);
|
|
21835
|
+
}
|
|
21836
|
+
}, {
|
|
21837
|
+
key: "setLoop",
|
|
21838
|
+
value: function setLoop(loop) {
|
|
21839
|
+
this.callPlayer('setLoop', loop);
|
|
21840
|
+
}
|
|
21841
|
+
}, {
|
|
21842
|
+
key: "getDuration",
|
|
21843
|
+
value: function getDuration() {
|
|
21844
|
+
return this.callPlayer('getDuration');
|
|
21845
|
+
}
|
|
21846
|
+
}, {
|
|
21847
|
+
key: "getCurrentTime",
|
|
21848
|
+
value: function getCurrentTime() {
|
|
21849
|
+
return this.callPlayer('getCurrentTime');
|
|
21850
|
+
}
|
|
21851
|
+
}, {
|
|
21852
|
+
key: "getSecondsLoaded",
|
|
21853
|
+
value: function getSecondsLoaded() {
|
|
21854
|
+
return this.callPlayer('getVideoLoadedFraction') * this.getDuration();
|
|
21855
|
+
}
|
|
21856
|
+
}, {
|
|
21857
|
+
key: "render",
|
|
21858
|
+
value: function render() {
|
|
21859
|
+
var display = this.props.display;
|
|
21860
|
+
var style = {
|
|
21861
|
+
width: '100%',
|
|
21862
|
+
height: '100%',
|
|
21863
|
+
display: display
|
|
21864
|
+
};
|
|
21865
|
+
return _react["default"].createElement("div", {
|
|
21866
|
+
style: style
|
|
21867
|
+
}, _react["default"].createElement("div", {
|
|
21868
|
+
ref: this.ref
|
|
21869
|
+
}));
|
|
21870
|
+
}
|
|
21871
|
+
}]);
|
|
21872
|
+
|
|
21873
|
+
return YouTube;
|
|
21874
|
+
}(_react.Component);
|
|
21875
|
+
|
|
21876
|
+
exports.YouTube = YouTube;
|
|
21877
|
+
|
|
21878
|
+
_defineProperty(YouTube, "displayName", 'YouTube');
|
|
21879
|
+
|
|
21880
|
+
_defineProperty(YouTube, "canPlay", function (url) {
|
|
21881
|
+
return MATCH_URL.test(url);
|
|
21882
|
+
});
|
|
21883
|
+
|
|
21884
|
+
var _default = (0, _singlePlayer["default"])(YouTube);
|
|
21885
|
+
|
|
21886
|
+
exports["default"] = _default;
|
|
21887
|
+
});
|
|
21888
|
+
|
|
21889
|
+
unwrapExports(YouTube_1);
|
|
21890
|
+
var YouTube_2 = YouTube_1.YouTube;
|
|
21891
|
+
|
|
21892
|
+
var SoundCloud_1 = createCommonjsModule(function (module, exports) {
|
|
21893
|
+
|
|
21894
|
+
Object.defineProperty(exports, "__esModule", {
|
|
21895
|
+
value: true
|
|
21896
|
+
});
|
|
21897
|
+
exports["default"] = exports.SoundCloud = void 0;
|
|
21898
|
+
|
|
21899
|
+
var _react = _interopRequireWildcard(React__default);
|
|
21900
|
+
|
|
21901
|
+
|
|
21902
|
+
|
|
21903
|
+
var _singlePlayer = _interopRequireDefault(singlePlayer);
|
|
21904
|
+
|
|
21905
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
21906
|
+
|
|
21907
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
21908
|
+
|
|
21909
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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; }
|
|
21910
|
+
|
|
21911
|
+
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
|
21912
|
+
|
|
21913
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
21914
|
+
|
|
21915
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
21916
|
+
|
|
21917
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21918
|
+
|
|
21919
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
21920
|
+
|
|
21921
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
21922
|
+
|
|
21923
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
21924
|
+
|
|
21925
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
21926
|
+
|
|
21927
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
21928
|
+
|
|
21929
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
21930
|
+
|
|
21931
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
21932
|
+
|
|
21933
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
21934
|
+
|
|
21935
|
+
var SDK_URL = 'https://w.soundcloud.com/player/api.js';
|
|
21936
|
+
var SDK_GLOBAL = 'SC';
|
|
21937
|
+
var MATCH_URL = /(soundcloud\.com|snd\.sc)\/.+$/;
|
|
21938
|
+
|
|
21939
|
+
var SoundCloud =
|
|
21940
|
+
/*#__PURE__*/
|
|
21941
|
+
function (_Component) {
|
|
21942
|
+
_inherits(SoundCloud, _Component);
|
|
21943
|
+
|
|
21944
|
+
function SoundCloud() {
|
|
21945
|
+
var _getPrototypeOf2;
|
|
21946
|
+
|
|
21947
|
+
var _this;
|
|
21948
|
+
|
|
21949
|
+
_classCallCheck(this, SoundCloud);
|
|
21950
|
+
|
|
21951
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
21952
|
+
args[_key] = arguments[_key];
|
|
21953
|
+
}
|
|
21954
|
+
|
|
21955
|
+
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(SoundCloud)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
21956
|
+
|
|
21957
|
+
_defineProperty(_assertThisInitialized(_this), "callPlayer", utils$2.callPlayer);
|
|
21958
|
+
|
|
21959
|
+
_defineProperty(_assertThisInitialized(_this), "duration", null);
|
|
21960
|
+
|
|
21961
|
+
_defineProperty(_assertThisInitialized(_this), "currentTime", null);
|
|
21962
|
+
|
|
21963
|
+
_defineProperty(_assertThisInitialized(_this), "fractionLoaded", null);
|
|
21964
|
+
|
|
21965
|
+
_defineProperty(_assertThisInitialized(_this), "mute", function () {
|
|
21966
|
+
_this.setVolume(0);
|
|
21967
|
+
});
|
|
21968
|
+
|
|
21969
|
+
_defineProperty(_assertThisInitialized(_this), "unmute", function () {
|
|
21970
|
+
if (_this.props.volume !== null) {
|
|
21971
|
+
_this.setVolume(_this.props.volume);
|
|
21972
|
+
}
|
|
21973
|
+
});
|
|
21974
|
+
|
|
21975
|
+
_defineProperty(_assertThisInitialized(_this), "ref", function (iframe) {
|
|
21976
|
+
_this.iframe = iframe;
|
|
21977
|
+
});
|
|
21978
|
+
|
|
21979
|
+
return _this;
|
|
21980
|
+
}
|
|
21981
|
+
|
|
21982
|
+
_createClass(SoundCloud, [{
|
|
21983
|
+
key: "load",
|
|
21984
|
+
value: function load(url, isReady) {
|
|
21985
|
+
var _this2 = this;
|
|
21986
|
+
|
|
21987
|
+
(0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL).then(function (SC) {
|
|
21988
|
+
if (!_this2.iframe) return;
|
|
21989
|
+
var _SC$Widget$Events = SC.Widget.Events,
|
|
21990
|
+
PLAY = _SC$Widget$Events.PLAY,
|
|
21991
|
+
PLAY_PROGRESS = _SC$Widget$Events.PLAY_PROGRESS,
|
|
21992
|
+
PAUSE = _SC$Widget$Events.PAUSE,
|
|
21993
|
+
FINISH = _SC$Widget$Events.FINISH,
|
|
21994
|
+
ERROR = _SC$Widget$Events.ERROR;
|
|
21995
|
+
|
|
21996
|
+
if (!isReady) {
|
|
21997
|
+
_this2.player = SC.Widget(_this2.iframe);
|
|
21998
|
+
|
|
21999
|
+
_this2.player.bind(PLAY, _this2.props.onPlay);
|
|
22000
|
+
|
|
22001
|
+
_this2.player.bind(PAUSE, _this2.props.onPause);
|
|
22002
|
+
|
|
22003
|
+
_this2.player.bind(PLAY_PROGRESS, function (e) {
|
|
22004
|
+
_this2.currentTime = e.currentPosition / 1000;
|
|
22005
|
+
_this2.fractionLoaded = e.loadedProgress;
|
|
22006
|
+
});
|
|
22007
|
+
|
|
22008
|
+
_this2.player.bind(FINISH, function () {
|
|
22009
|
+
return _this2.props.onEnded();
|
|
22010
|
+
});
|
|
22011
|
+
|
|
22012
|
+
_this2.player.bind(ERROR, function (e) {
|
|
22013
|
+
return _this2.props.onError(e);
|
|
22014
|
+
});
|
|
22015
|
+
}
|
|
22016
|
+
|
|
22017
|
+
_this2.player.load(url, _objectSpread({}, _this2.props.config.soundcloud.options, {
|
|
22018
|
+
callback: function callback() {
|
|
22019
|
+
_this2.player.getDuration(function (duration) {
|
|
22020
|
+
_this2.duration = duration / 1000;
|
|
22021
|
+
|
|
22022
|
+
_this2.props.onReady();
|
|
22023
|
+
});
|
|
22024
|
+
}
|
|
22025
|
+
}));
|
|
22026
|
+
});
|
|
22027
|
+
}
|
|
22028
|
+
}, {
|
|
22029
|
+
key: "play",
|
|
22030
|
+
value: function play() {
|
|
22031
|
+
this.callPlayer('play');
|
|
22032
|
+
}
|
|
22033
|
+
}, {
|
|
22034
|
+
key: "pause",
|
|
22035
|
+
value: function pause() {
|
|
22036
|
+
this.callPlayer('pause');
|
|
22037
|
+
}
|
|
22038
|
+
}, {
|
|
22039
|
+
key: "stop",
|
|
22040
|
+
value: function stop() {// Nothing to do
|
|
22041
|
+
}
|
|
22042
|
+
}, {
|
|
22043
|
+
key: "seekTo",
|
|
22044
|
+
value: function seekTo(seconds) {
|
|
22045
|
+
this.callPlayer('seekTo', seconds * 1000);
|
|
22046
|
+
}
|
|
22047
|
+
}, {
|
|
22048
|
+
key: "setVolume",
|
|
22049
|
+
value: function setVolume(fraction) {
|
|
22050
|
+
this.callPlayer('setVolume', fraction * 100);
|
|
22051
|
+
}
|
|
22052
|
+
}, {
|
|
22053
|
+
key: "getDuration",
|
|
22054
|
+
value: function getDuration() {
|
|
22055
|
+
return this.duration;
|
|
22056
|
+
}
|
|
22057
|
+
}, {
|
|
22058
|
+
key: "getCurrentTime",
|
|
22059
|
+
value: function getCurrentTime() {
|
|
22060
|
+
return this.currentTime;
|
|
22061
|
+
}
|
|
22062
|
+
}, {
|
|
22063
|
+
key: "getSecondsLoaded",
|
|
22064
|
+
value: function getSecondsLoaded() {
|
|
22065
|
+
return this.fractionLoaded * this.duration;
|
|
22066
|
+
}
|
|
22067
|
+
}, {
|
|
22068
|
+
key: "render",
|
|
22069
|
+
value: function render() {
|
|
22070
|
+
var display = this.props.display;
|
|
22071
|
+
var style = {
|
|
22072
|
+
width: '100%',
|
|
22073
|
+
height: '100%',
|
|
22074
|
+
display: display
|
|
22075
|
+
};
|
|
22076
|
+
return _react["default"].createElement("iframe", {
|
|
22077
|
+
ref: this.ref,
|
|
22078
|
+
src: "https://w.soundcloud.com/player/?url=".concat(encodeURIComponent(this.props.url)),
|
|
22079
|
+
style: style,
|
|
22080
|
+
frameBorder: 0,
|
|
22081
|
+
allow: "autoplay"
|
|
22082
|
+
});
|
|
22083
|
+
}
|
|
22084
|
+
}]);
|
|
22085
|
+
|
|
22086
|
+
return SoundCloud;
|
|
22087
|
+
}(_react.Component);
|
|
22088
|
+
|
|
22089
|
+
exports.SoundCloud = SoundCloud;
|
|
22090
|
+
|
|
22091
|
+
_defineProperty(SoundCloud, "displayName", 'SoundCloud');
|
|
22092
|
+
|
|
22093
|
+
_defineProperty(SoundCloud, "canPlay", function (url) {
|
|
22094
|
+
return MATCH_URL.test(url);
|
|
22095
|
+
});
|
|
22096
|
+
|
|
22097
|
+
_defineProperty(SoundCloud, "loopOnEnded", true);
|
|
22098
|
+
|
|
22099
|
+
var _default = (0, _singlePlayer["default"])(SoundCloud);
|
|
22100
|
+
|
|
22101
|
+
exports["default"] = _default;
|
|
22102
|
+
});
|
|
22103
|
+
|
|
22104
|
+
unwrapExports(SoundCloud_1);
|
|
22105
|
+
var SoundCloud_2 = SoundCloud_1.SoundCloud;
|
|
22106
|
+
|
|
22107
|
+
var Vimeo_1 = createCommonjsModule(function (module, exports) {
|
|
22108
|
+
|
|
22109
|
+
Object.defineProperty(exports, "__esModule", {
|
|
22110
|
+
value: true
|
|
22111
|
+
});
|
|
22112
|
+
exports["default"] = exports.Vimeo = void 0;
|
|
22113
|
+
|
|
22114
|
+
var _react = _interopRequireWildcard(React__default);
|
|
22115
|
+
|
|
22116
|
+
|
|
22117
|
+
|
|
22118
|
+
var _singlePlayer = _interopRequireDefault(singlePlayer);
|
|
22119
|
+
|
|
22120
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
22121
|
+
|
|
22122
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
22123
|
+
|
|
22124
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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; }
|
|
22125
|
+
|
|
22126
|
+
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
|
22127
|
+
|
|
22128
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
22129
|
+
|
|
22130
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
22131
|
+
|
|
22132
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
22133
|
+
|
|
22134
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
22135
|
+
|
|
22136
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
22137
|
+
|
|
22138
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
22139
|
+
|
|
22140
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22141
|
+
|
|
22142
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
22143
|
+
|
|
22144
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
22145
|
+
|
|
22146
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
22147
|
+
|
|
22148
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22149
|
+
|
|
22150
|
+
var SDK_URL = 'https://player.vimeo.com/api/player.js';
|
|
22151
|
+
var SDK_GLOBAL = 'Vimeo';
|
|
22152
|
+
var MATCH_URL = /vimeo\.com\/.+/;
|
|
22153
|
+
var MATCH_FILE_URL = /vimeo\.com\/external\/[0-9]+\..+/;
|
|
22154
|
+
|
|
22155
|
+
var Vimeo =
|
|
22156
|
+
/*#__PURE__*/
|
|
22157
|
+
function (_Component) {
|
|
22158
|
+
_inherits(Vimeo, _Component);
|
|
22159
|
+
|
|
22160
|
+
function Vimeo() {
|
|
22161
|
+
var _getPrototypeOf2;
|
|
22162
|
+
|
|
22163
|
+
var _this;
|
|
22164
|
+
|
|
22165
|
+
_classCallCheck(this, Vimeo);
|
|
22166
|
+
|
|
22167
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
22168
|
+
args[_key] = arguments[_key];
|
|
22169
|
+
}
|
|
22170
|
+
|
|
22171
|
+
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Vimeo)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
22172
|
+
|
|
22173
|
+
_defineProperty(_assertThisInitialized(_this), "callPlayer", utils$2.callPlayer);
|
|
22174
|
+
|
|
22175
|
+
_defineProperty(_assertThisInitialized(_this), "duration", null);
|
|
22176
|
+
|
|
22177
|
+
_defineProperty(_assertThisInitialized(_this), "currentTime", null);
|
|
22178
|
+
|
|
22179
|
+
_defineProperty(_assertThisInitialized(_this), "secondsLoaded", null);
|
|
22180
|
+
|
|
22181
|
+
_defineProperty(_assertThisInitialized(_this), "mute", function () {
|
|
22182
|
+
_this.setVolume(0);
|
|
22183
|
+
});
|
|
22184
|
+
|
|
22185
|
+
_defineProperty(_assertThisInitialized(_this), "unmute", function () {
|
|
22186
|
+
if (_this.props.volume !== null) {
|
|
22187
|
+
_this.setVolume(_this.props.volume);
|
|
22188
|
+
}
|
|
22189
|
+
});
|
|
22190
|
+
|
|
22191
|
+
_defineProperty(_assertThisInitialized(_this), "ref", function (container) {
|
|
22192
|
+
_this.container = container;
|
|
22193
|
+
});
|
|
22194
|
+
|
|
22195
|
+
return _this;
|
|
22196
|
+
}
|
|
22197
|
+
|
|
22198
|
+
_createClass(Vimeo, [{
|
|
22199
|
+
key: "load",
|
|
22200
|
+
value: function load(url) {
|
|
22201
|
+
var _this2 = this;
|
|
22202
|
+
|
|
22203
|
+
this.duration = null;
|
|
22204
|
+
(0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL).then(function (Vimeo) {
|
|
22205
|
+
if (!_this2.container) return;
|
|
22206
|
+
_this2.player = new Vimeo.Player(_this2.container, _objectSpread({
|
|
22207
|
+
url: url,
|
|
22208
|
+
autoplay: _this2.props.playing,
|
|
22209
|
+
muted: _this2.props.muted,
|
|
22210
|
+
loop: _this2.props.loop,
|
|
22211
|
+
playsinline: _this2.props.playsinline,
|
|
22212
|
+
controls: _this2.props.controls
|
|
22213
|
+
}, _this2.props.config.vimeo.playerOptions));
|
|
22214
|
+
|
|
22215
|
+
_this2.player.ready().then(function () {
|
|
22216
|
+
var iframe = _this2.container.querySelector('iframe');
|
|
22217
|
+
|
|
22218
|
+
iframe.style.width = '100%';
|
|
22219
|
+
iframe.style.height = '100%';
|
|
22220
|
+
})["catch"](_this2.props.onError);
|
|
22221
|
+
|
|
22222
|
+
_this2.player.on('loaded', function () {
|
|
22223
|
+
_this2.props.onReady();
|
|
22224
|
+
|
|
22225
|
+
_this2.refreshDuration();
|
|
22226
|
+
});
|
|
22227
|
+
|
|
22228
|
+
_this2.player.on('play', function () {
|
|
22229
|
+
_this2.props.onPlay();
|
|
22230
|
+
|
|
22231
|
+
_this2.refreshDuration();
|
|
22232
|
+
});
|
|
22233
|
+
|
|
22234
|
+
_this2.player.on('pause', _this2.props.onPause);
|
|
22235
|
+
|
|
22236
|
+
_this2.player.on('seeked', function (e) {
|
|
22237
|
+
return _this2.props.onSeek(e.seconds);
|
|
22238
|
+
});
|
|
22239
|
+
|
|
22240
|
+
_this2.player.on('ended', _this2.props.onEnded);
|
|
22241
|
+
|
|
22242
|
+
_this2.player.on('error', _this2.props.onError);
|
|
22243
|
+
|
|
22244
|
+
_this2.player.on('timeupdate', function (_ref) {
|
|
22245
|
+
var seconds = _ref.seconds;
|
|
22246
|
+
_this2.currentTime = seconds;
|
|
22247
|
+
});
|
|
22248
|
+
|
|
22249
|
+
_this2.player.on('progress', function (_ref2) {
|
|
22250
|
+
var seconds = _ref2.seconds;
|
|
22251
|
+
_this2.secondsLoaded = seconds;
|
|
22252
|
+
});
|
|
22253
|
+
}, this.props.onError);
|
|
22254
|
+
}
|
|
22255
|
+
}, {
|
|
22256
|
+
key: "refreshDuration",
|
|
22257
|
+
value: function refreshDuration() {
|
|
22258
|
+
var _this3 = this;
|
|
22259
|
+
|
|
22260
|
+
this.player.getDuration().then(function (duration) {
|
|
22261
|
+
_this3.duration = duration;
|
|
22262
|
+
});
|
|
22263
|
+
}
|
|
22264
|
+
}, {
|
|
22265
|
+
key: "play",
|
|
22266
|
+
value: function play() {
|
|
22267
|
+
var promise = this.callPlayer('play');
|
|
22268
|
+
|
|
22269
|
+
if (promise) {
|
|
22270
|
+
promise["catch"](this.props.onError);
|
|
22271
|
+
}
|
|
22272
|
+
}
|
|
22273
|
+
}, {
|
|
22274
|
+
key: "pause",
|
|
22275
|
+
value: function pause() {
|
|
22276
|
+
this.callPlayer('pause');
|
|
22277
|
+
}
|
|
22278
|
+
}, {
|
|
22279
|
+
key: "stop",
|
|
22280
|
+
value: function stop() {
|
|
22281
|
+
this.callPlayer('unload');
|
|
22282
|
+
}
|
|
22283
|
+
}, {
|
|
22284
|
+
key: "seekTo",
|
|
22285
|
+
value: function seekTo(seconds) {
|
|
22286
|
+
this.callPlayer('setCurrentTime', seconds);
|
|
22287
|
+
}
|
|
22288
|
+
}, {
|
|
22289
|
+
key: "setVolume",
|
|
22290
|
+
value: function setVolume(fraction) {
|
|
22291
|
+
this.callPlayer('setVolume', fraction);
|
|
22292
|
+
}
|
|
22293
|
+
}, {
|
|
22294
|
+
key: "setLoop",
|
|
22295
|
+
value: function setLoop(loop) {
|
|
22296
|
+
this.callPlayer('setLoop', loop);
|
|
22297
|
+
}
|
|
22298
|
+
}, {
|
|
22299
|
+
key: "setPlaybackRate",
|
|
22300
|
+
value: function setPlaybackRate(rate) {
|
|
22301
|
+
this.callPlayer('setPlaybackRate', rate);
|
|
22302
|
+
}
|
|
22303
|
+
}, {
|
|
22304
|
+
key: "getDuration",
|
|
22305
|
+
value: function getDuration() {
|
|
22306
|
+
return this.duration;
|
|
22307
|
+
}
|
|
22308
|
+
}, {
|
|
22309
|
+
key: "getCurrentTime",
|
|
22310
|
+
value: function getCurrentTime() {
|
|
22311
|
+
return this.currentTime;
|
|
22312
|
+
}
|
|
22313
|
+
}, {
|
|
22314
|
+
key: "getSecondsLoaded",
|
|
22315
|
+
value: function getSecondsLoaded() {
|
|
22316
|
+
return this.secondsLoaded;
|
|
22317
|
+
}
|
|
22318
|
+
}, {
|
|
22319
|
+
key: "render",
|
|
22320
|
+
value: function render() {
|
|
22321
|
+
var display = this.props.display;
|
|
22322
|
+
var style = {
|
|
22323
|
+
width: '100%',
|
|
22324
|
+
height: '100%',
|
|
22325
|
+
overflow: 'hidden',
|
|
22326
|
+
display: display
|
|
22327
|
+
};
|
|
22328
|
+
return _react["default"].createElement("div", {
|
|
22329
|
+
key: this.props.url,
|
|
22330
|
+
ref: this.ref,
|
|
22331
|
+
style: style
|
|
22332
|
+
});
|
|
22333
|
+
}
|
|
22334
|
+
}]);
|
|
22335
|
+
|
|
22336
|
+
return Vimeo;
|
|
22337
|
+
}(_react.Component);
|
|
22338
|
+
|
|
22339
|
+
exports.Vimeo = Vimeo;
|
|
22340
|
+
|
|
22341
|
+
_defineProperty(Vimeo, "displayName", 'Vimeo');
|
|
22342
|
+
|
|
22343
|
+
_defineProperty(Vimeo, "forceLoad", true);
|
|
22344
|
+
|
|
22345
|
+
_defineProperty(Vimeo, "canPlay", function (url) {
|
|
22346
|
+
if (MATCH_FILE_URL.test(url)) {
|
|
22347
|
+
return false;
|
|
22348
|
+
}
|
|
22349
|
+
|
|
22350
|
+
return MATCH_URL.test(url);
|
|
22351
|
+
});
|
|
22352
|
+
|
|
22353
|
+
var _default = (0, _singlePlayer["default"])(Vimeo);
|
|
22354
|
+
|
|
22355
|
+
exports["default"] = _default;
|
|
22356
|
+
});
|
|
22357
|
+
|
|
22358
|
+
unwrapExports(Vimeo_1);
|
|
22359
|
+
var Vimeo_2 = Vimeo_1.Vimeo;
|
|
22360
|
+
|
|
22361
|
+
var Facebook_1 = createCommonjsModule(function (module, exports) {
|
|
22362
|
+
|
|
22363
|
+
Object.defineProperty(exports, "__esModule", {
|
|
22364
|
+
value: true
|
|
22365
|
+
});
|
|
22366
|
+
exports["default"] = exports.Facebook = void 0;
|
|
22367
|
+
|
|
22368
|
+
var _react = _interopRequireWildcard(React__default);
|
|
22369
|
+
|
|
22370
|
+
|
|
22371
|
+
|
|
22372
|
+
var _singlePlayer = _interopRequireDefault(singlePlayer);
|
|
22373
|
+
|
|
22374
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
22375
|
+
|
|
22376
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
22377
|
+
|
|
22378
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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; }
|
|
22379
|
+
|
|
22380
|
+
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
|
22381
|
+
|
|
22382
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
22383
|
+
|
|
22384
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
22385
|
+
|
|
22386
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
22387
|
+
|
|
22388
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
22389
|
+
|
|
22390
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22391
|
+
|
|
22392
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
22393
|
+
|
|
22394
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
22395
|
+
|
|
22396
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
22397
|
+
|
|
22398
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22399
|
+
|
|
22400
|
+
var SDK_URL = 'https://connect.facebook.net/en_US/sdk.js';
|
|
22401
|
+
var SDK_GLOBAL = 'FB';
|
|
22402
|
+
var SDK_GLOBAL_READY = 'fbAsyncInit';
|
|
22403
|
+
var MATCH_URL = /^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/;
|
|
22404
|
+
var PLAYER_ID_PREFIX = 'facebook-player-';
|
|
22405
|
+
|
|
22406
|
+
var Facebook =
|
|
22407
|
+
/*#__PURE__*/
|
|
22408
|
+
function (_Component) {
|
|
22409
|
+
_inherits(Facebook, _Component);
|
|
22410
|
+
|
|
22411
|
+
function Facebook() {
|
|
22412
|
+
var _getPrototypeOf2;
|
|
22413
|
+
|
|
22414
|
+
var _this;
|
|
22415
|
+
|
|
22416
|
+
_classCallCheck(this, Facebook);
|
|
22417
|
+
|
|
22418
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
22419
|
+
args[_key] = arguments[_key];
|
|
22420
|
+
}
|
|
22421
|
+
|
|
22422
|
+
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Facebook)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
22423
|
+
|
|
22424
|
+
_defineProperty(_assertThisInitialized(_this), "callPlayer", utils$2.callPlayer);
|
|
22425
|
+
|
|
22426
|
+
_defineProperty(_assertThisInitialized(_this), "playerID", _this.props.config.facebook.playerId || "".concat(PLAYER_ID_PREFIX).concat((0, utils$2.randomString)()));
|
|
22427
|
+
|
|
22428
|
+
_defineProperty(_assertThisInitialized(_this), "mute", function () {
|
|
22429
|
+
_this.callPlayer('mute');
|
|
22430
|
+
});
|
|
22431
|
+
|
|
22432
|
+
_defineProperty(_assertThisInitialized(_this), "unmute", function () {
|
|
22433
|
+
_this.callPlayer('unmute');
|
|
22434
|
+
});
|
|
22435
|
+
|
|
22436
|
+
return _this;
|
|
22437
|
+
}
|
|
22438
|
+
|
|
22439
|
+
_createClass(Facebook, [{
|
|
22440
|
+
key: "load",
|
|
22441
|
+
value: function load(url, isReady) {
|
|
22442
|
+
var _this2 = this;
|
|
22443
|
+
|
|
22444
|
+
if (isReady) {
|
|
22445
|
+
(0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then(function (FB) {
|
|
22446
|
+
return FB.XFBML.parse();
|
|
22447
|
+
});
|
|
22448
|
+
return;
|
|
22449
|
+
}
|
|
22450
|
+
|
|
22451
|
+
(0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY).then(function (FB) {
|
|
22452
|
+
FB.init({
|
|
22453
|
+
appId: _this2.props.config.facebook.appId,
|
|
22454
|
+
xfbml: true,
|
|
22455
|
+
version: _this2.props.config.facebook.version
|
|
22456
|
+
});
|
|
22457
|
+
FB.Event.subscribe('xfbml.render', function (msg) {
|
|
22458
|
+
// Here we know the SDK has loaded, even if onReady/onPlay
|
|
22459
|
+
// is not called due to a video that cannot be embedded
|
|
22460
|
+
_this2.props.onLoaded();
|
|
22461
|
+
});
|
|
22462
|
+
FB.Event.subscribe('xfbml.ready', function (msg) {
|
|
22463
|
+
if (msg.type === 'video' && msg.id === _this2.playerID) {
|
|
22464
|
+
_this2.player = msg.instance;
|
|
22465
|
+
|
|
22466
|
+
_this2.player.subscribe('startedPlaying', _this2.props.onPlay);
|
|
22467
|
+
|
|
22468
|
+
_this2.player.subscribe('paused', _this2.props.onPause);
|
|
22469
|
+
|
|
22470
|
+
_this2.player.subscribe('finishedPlaying', _this2.props.onEnded);
|
|
22471
|
+
|
|
22472
|
+
_this2.player.subscribe('startedBuffering', _this2.props.onBuffer);
|
|
22473
|
+
|
|
22474
|
+
_this2.player.subscribe('finishedBuffering', _this2.props.onBufferEnd);
|
|
22475
|
+
|
|
22476
|
+
_this2.player.subscribe('error', _this2.props.onError);
|
|
22477
|
+
|
|
22478
|
+
if (!_this2.props.muted) {
|
|
22479
|
+
// Player is muted by default
|
|
22480
|
+
_this2.callPlayer('unmute');
|
|
22481
|
+
}
|
|
22482
|
+
|
|
22483
|
+
_this2.props.onReady(); // For some reason Facebook have added `visibility: hidden`
|
|
22484
|
+
// to the iframe when autoplay fails, so here we set it back
|
|
22485
|
+
|
|
22486
|
+
|
|
22487
|
+
document.getElementById(_this2.playerID).querySelector('iframe').style.visibility = 'visible';
|
|
22488
|
+
}
|
|
22489
|
+
});
|
|
22490
|
+
});
|
|
22491
|
+
}
|
|
22492
|
+
}, {
|
|
22493
|
+
key: "play",
|
|
22494
|
+
value: function play() {
|
|
22495
|
+
this.callPlayer('play');
|
|
22496
|
+
}
|
|
22497
|
+
}, {
|
|
22498
|
+
key: "pause",
|
|
22499
|
+
value: function pause() {
|
|
22500
|
+
this.callPlayer('pause');
|
|
22501
|
+
}
|
|
22502
|
+
}, {
|
|
22503
|
+
key: "stop",
|
|
22504
|
+
value: function stop() {// Nothing to do
|
|
22505
|
+
}
|
|
22506
|
+
}, {
|
|
22507
|
+
key: "seekTo",
|
|
22508
|
+
value: function seekTo(seconds) {
|
|
22509
|
+
this.callPlayer('seek', seconds);
|
|
22510
|
+
}
|
|
22511
|
+
}, {
|
|
22512
|
+
key: "setVolume",
|
|
22513
|
+
value: function setVolume(fraction) {
|
|
22514
|
+
this.callPlayer('setVolume', fraction);
|
|
22515
|
+
}
|
|
22516
|
+
}, {
|
|
22517
|
+
key: "getDuration",
|
|
22518
|
+
value: function getDuration() {
|
|
22519
|
+
return this.callPlayer('getDuration');
|
|
22520
|
+
}
|
|
22521
|
+
}, {
|
|
22522
|
+
key: "getCurrentTime",
|
|
22523
|
+
value: function getCurrentTime() {
|
|
22524
|
+
return this.callPlayer('getCurrentPosition');
|
|
22525
|
+
}
|
|
22526
|
+
}, {
|
|
22527
|
+
key: "getSecondsLoaded",
|
|
22528
|
+
value: function getSecondsLoaded() {
|
|
22529
|
+
return null;
|
|
22530
|
+
}
|
|
22531
|
+
}, {
|
|
22532
|
+
key: "render",
|
|
22533
|
+
value: function render() {
|
|
22534
|
+
var style = {
|
|
22535
|
+
width: '100%',
|
|
22536
|
+
height: '100%'
|
|
22537
|
+
};
|
|
22538
|
+
return _react["default"].createElement("div", {
|
|
22539
|
+
style: style,
|
|
22540
|
+
id: this.playerID,
|
|
22541
|
+
className: "fb-video",
|
|
22542
|
+
"data-href": this.props.url,
|
|
22543
|
+
"data-autoplay": this.props.playing ? 'true' : 'false',
|
|
22544
|
+
"data-allowfullscreen": "true",
|
|
22545
|
+
"data-controls": this.props.controls ? 'true' : 'false'
|
|
22546
|
+
});
|
|
22547
|
+
}
|
|
22548
|
+
}]);
|
|
22549
|
+
|
|
22550
|
+
return Facebook;
|
|
22551
|
+
}(_react.Component);
|
|
22552
|
+
|
|
22553
|
+
exports.Facebook = Facebook;
|
|
22554
|
+
|
|
22555
|
+
_defineProperty(Facebook, "displayName", 'Facebook');
|
|
22556
|
+
|
|
22557
|
+
_defineProperty(Facebook, "canPlay", function (url) {
|
|
22558
|
+
return MATCH_URL.test(url);
|
|
22559
|
+
});
|
|
22560
|
+
|
|
22561
|
+
_defineProperty(Facebook, "loopOnEnded", true);
|
|
22562
|
+
|
|
22563
|
+
var _default = (0, _singlePlayer["default"])(Facebook);
|
|
22564
|
+
|
|
22565
|
+
exports["default"] = _default;
|
|
22566
|
+
});
|
|
22567
|
+
|
|
22568
|
+
unwrapExports(Facebook_1);
|
|
22569
|
+
var Facebook_2 = Facebook_1.Facebook;
|
|
22570
|
+
|
|
22571
|
+
var Streamable_1 = createCommonjsModule(function (module, exports) {
|
|
22572
|
+
|
|
22573
|
+
Object.defineProperty(exports, "__esModule", {
|
|
22574
|
+
value: true
|
|
22575
|
+
});
|
|
22576
|
+
exports["default"] = exports.Streamable = void 0;
|
|
22577
|
+
|
|
22578
|
+
var _react = _interopRequireWildcard(React__default);
|
|
22579
|
+
|
|
22580
|
+
|
|
22581
|
+
|
|
22582
|
+
var _singlePlayer = _interopRequireDefault(singlePlayer);
|
|
22583
|
+
|
|
22584
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
22585
|
+
|
|
22586
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
22587
|
+
|
|
22588
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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; }
|
|
22589
|
+
|
|
22590
|
+
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
|
22591
|
+
|
|
22592
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
22593
|
+
|
|
22594
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
22595
|
+
|
|
22596
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
22597
|
+
|
|
22598
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
22599
|
+
|
|
22600
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22601
|
+
|
|
22602
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
22603
|
+
|
|
22604
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
22605
|
+
|
|
22606
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
22607
|
+
|
|
22608
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22609
|
+
|
|
22610
|
+
var SDK_URL = 'https://cdn.embed.ly/player-0.1.0.min.js';
|
|
22611
|
+
var SDK_GLOBAL = 'playerjs';
|
|
22612
|
+
var MATCH_URL = /streamable\.com\/([a-z0-9]+)$/;
|
|
22613
|
+
|
|
22614
|
+
var Streamable =
|
|
22615
|
+
/*#__PURE__*/
|
|
22616
|
+
function (_Component) {
|
|
22617
|
+
_inherits(Streamable, _Component);
|
|
22618
|
+
|
|
22619
|
+
function Streamable() {
|
|
22620
|
+
var _getPrototypeOf2;
|
|
22621
|
+
|
|
22622
|
+
var _this;
|
|
22623
|
+
|
|
22624
|
+
_classCallCheck(this, Streamable);
|
|
22625
|
+
|
|
22626
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
22627
|
+
args[_key] = arguments[_key];
|
|
22628
|
+
}
|
|
22629
|
+
|
|
22630
|
+
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Streamable)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
22631
|
+
|
|
22632
|
+
_defineProperty(_assertThisInitialized(_this), "callPlayer", utils$2.callPlayer);
|
|
22633
|
+
|
|
22634
|
+
_defineProperty(_assertThisInitialized(_this), "duration", null);
|
|
22635
|
+
|
|
22636
|
+
_defineProperty(_assertThisInitialized(_this), "currentTime", null);
|
|
22637
|
+
|
|
22638
|
+
_defineProperty(_assertThisInitialized(_this), "secondsLoaded", null);
|
|
22639
|
+
|
|
22640
|
+
_defineProperty(_assertThisInitialized(_this), "mute", function () {
|
|
22641
|
+
_this.callPlayer('mute');
|
|
22642
|
+
});
|
|
22643
|
+
|
|
22644
|
+
_defineProperty(_assertThisInitialized(_this), "unmute", function () {
|
|
22645
|
+
_this.callPlayer('unmute');
|
|
22646
|
+
});
|
|
22647
|
+
|
|
22648
|
+
_defineProperty(_assertThisInitialized(_this), "ref", function (iframe) {
|
|
22649
|
+
_this.iframe = iframe;
|
|
22650
|
+
});
|
|
22651
|
+
|
|
22652
|
+
return _this;
|
|
22653
|
+
}
|
|
22654
|
+
|
|
22655
|
+
_createClass(Streamable, [{
|
|
22656
|
+
key: "load",
|
|
22657
|
+
value: function load(url) {
|
|
22658
|
+
var _this2 = this;
|
|
22659
|
+
|
|
22660
|
+
(0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL).then(function (playerjs) {
|
|
22661
|
+
if (!_this2.iframe) return;
|
|
22662
|
+
_this2.player = new playerjs.Player(_this2.iframe);
|
|
22663
|
+
|
|
22664
|
+
_this2.player.setLoop(_this2.props.loop);
|
|
22665
|
+
|
|
22666
|
+
_this2.player.on('ready', _this2.props.onReady);
|
|
22667
|
+
|
|
22668
|
+
_this2.player.on('play', _this2.props.onPlay);
|
|
22669
|
+
|
|
22670
|
+
_this2.player.on('pause', _this2.props.onPause);
|
|
22671
|
+
|
|
22672
|
+
_this2.player.on('seeked', _this2.props.onSeek);
|
|
22673
|
+
|
|
22674
|
+
_this2.player.on('ended', _this2.props.onEnded);
|
|
22675
|
+
|
|
22676
|
+
_this2.player.on('error', _this2.props.onError);
|
|
22677
|
+
|
|
22678
|
+
_this2.player.on('timeupdate', function (_ref) {
|
|
22679
|
+
var duration = _ref.duration,
|
|
22680
|
+
seconds = _ref.seconds;
|
|
22681
|
+
_this2.duration = duration;
|
|
22682
|
+
_this2.currentTime = seconds;
|
|
22683
|
+
});
|
|
22684
|
+
|
|
22685
|
+
_this2.player.on('buffered', function (_ref2) {
|
|
22686
|
+
var percent = _ref2.percent;
|
|
22687
|
+
|
|
22688
|
+
if (_this2.duration) {
|
|
22689
|
+
_this2.secondsLoaded = _this2.duration * percent;
|
|
22690
|
+
}
|
|
22691
|
+
});
|
|
22692
|
+
|
|
22693
|
+
if (_this2.props.muted) {
|
|
22694
|
+
_this2.player.mute();
|
|
22695
|
+
}
|
|
22696
|
+
}, this.props.onError);
|
|
22697
|
+
}
|
|
22698
|
+
}, {
|
|
22699
|
+
key: "play",
|
|
22700
|
+
value: function play() {
|
|
22701
|
+
this.callPlayer('play');
|
|
22702
|
+
}
|
|
22703
|
+
}, {
|
|
22704
|
+
key: "pause",
|
|
22705
|
+
value: function pause() {
|
|
22706
|
+
this.callPlayer('pause');
|
|
22707
|
+
}
|
|
22708
|
+
}, {
|
|
22709
|
+
key: "stop",
|
|
22710
|
+
value: function stop() {// Nothing to do
|
|
22711
|
+
}
|
|
22712
|
+
}, {
|
|
22713
|
+
key: "seekTo",
|
|
22714
|
+
value: function seekTo(seconds) {
|
|
22715
|
+
this.callPlayer('setCurrentTime', seconds);
|
|
22716
|
+
}
|
|
22717
|
+
}, {
|
|
22718
|
+
key: "setVolume",
|
|
22719
|
+
value: function setVolume(fraction) {
|
|
22720
|
+
this.callPlayer('setVolume', fraction * 100);
|
|
22721
|
+
}
|
|
22722
|
+
}, {
|
|
22723
|
+
key: "setLoop",
|
|
22724
|
+
value: function setLoop(loop) {
|
|
22725
|
+
this.callPlayer('setLoop', loop);
|
|
22726
|
+
}
|
|
22727
|
+
}, {
|
|
22728
|
+
key: "getDuration",
|
|
22729
|
+
value: function getDuration() {
|
|
22730
|
+
return this.duration;
|
|
22731
|
+
}
|
|
22732
|
+
}, {
|
|
22733
|
+
key: "getCurrentTime",
|
|
22734
|
+
value: function getCurrentTime() {
|
|
22735
|
+
return this.currentTime;
|
|
22736
|
+
}
|
|
22737
|
+
}, {
|
|
22738
|
+
key: "getSecondsLoaded",
|
|
22739
|
+
value: function getSecondsLoaded() {
|
|
22740
|
+
return this.secondsLoaded;
|
|
22741
|
+
}
|
|
22742
|
+
}, {
|
|
22743
|
+
key: "render",
|
|
22744
|
+
value: function render() {
|
|
22745
|
+
var id = this.props.url.match(MATCH_URL)[1];
|
|
22746
|
+
var style = {
|
|
22747
|
+
width: '100%',
|
|
22748
|
+
height: '100%'
|
|
22749
|
+
};
|
|
22750
|
+
return _react["default"].createElement("iframe", {
|
|
22751
|
+
ref: this.ref,
|
|
22752
|
+
src: "https://streamable.com/o/".concat(id),
|
|
22753
|
+
frameBorder: "0",
|
|
22754
|
+
scrolling: "no",
|
|
22755
|
+
style: style,
|
|
22756
|
+
allowFullScreen: true
|
|
22757
|
+
});
|
|
22758
|
+
}
|
|
22759
|
+
}]);
|
|
22760
|
+
|
|
22761
|
+
return Streamable;
|
|
22762
|
+
}(_react.Component);
|
|
22763
|
+
|
|
22764
|
+
exports.Streamable = Streamable;
|
|
22765
|
+
|
|
22766
|
+
_defineProperty(Streamable, "displayName", 'Streamable');
|
|
22767
|
+
|
|
22768
|
+
_defineProperty(Streamable, "canPlay", function (url) {
|
|
22769
|
+
return MATCH_URL.test(url);
|
|
22770
|
+
});
|
|
22771
|
+
|
|
22772
|
+
var _default = (0, _singlePlayer["default"])(Streamable);
|
|
22773
|
+
|
|
22774
|
+
exports["default"] = _default;
|
|
22775
|
+
});
|
|
22776
|
+
|
|
22777
|
+
unwrapExports(Streamable_1);
|
|
22778
|
+
var Streamable_2 = Streamable_1.Streamable;
|
|
22779
|
+
|
|
22780
|
+
var Wistia_1 = createCommonjsModule(function (module, exports) {
|
|
22781
|
+
|
|
22782
|
+
Object.defineProperty(exports, "__esModule", {
|
|
22783
|
+
value: true
|
|
22784
|
+
});
|
|
22785
|
+
exports["default"] = exports.Wistia = void 0;
|
|
22786
|
+
|
|
22787
|
+
var _react = _interopRequireWildcard(React__default);
|
|
22788
|
+
|
|
22789
|
+
|
|
22790
|
+
|
|
22791
|
+
var _singlePlayer = _interopRequireDefault(singlePlayer);
|
|
22792
|
+
|
|
22793
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
22794
|
+
|
|
22795
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
22796
|
+
|
|
22797
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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; }
|
|
22798
|
+
|
|
22799
|
+
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
|
22800
|
+
|
|
22801
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
22802
|
+
|
|
22803
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
22804
|
+
|
|
22805
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
22806
|
+
|
|
22807
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
22808
|
+
|
|
22809
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
22810
|
+
|
|
22811
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
22812
|
+
|
|
22813
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
22814
|
+
|
|
22815
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
22816
|
+
|
|
22817
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
22818
|
+
|
|
22819
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
22820
|
+
|
|
22821
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
22822
|
+
|
|
22823
|
+
var SDK_URL = 'https://fast.wistia.com/assets/external/E-v1.js';
|
|
22824
|
+
var SDK_GLOBAL = 'Wistia';
|
|
22825
|
+
var MATCH_URL = /(?:wistia\.com|wi\.st)\/(?:medias|embed)\/(.*)$/;
|
|
22826
|
+
|
|
22827
|
+
var Wistia =
|
|
22828
|
+
/*#__PURE__*/
|
|
22829
|
+
function (_Component) {
|
|
22830
|
+
_inherits(Wistia, _Component);
|
|
22831
|
+
|
|
22832
|
+
function Wistia() {
|
|
22833
|
+
var _getPrototypeOf2;
|
|
22834
|
+
|
|
22835
|
+
var _this;
|
|
22836
|
+
|
|
22837
|
+
_classCallCheck(this, Wistia);
|
|
22838
|
+
|
|
22839
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
22840
|
+
args[_key] = arguments[_key];
|
|
22841
|
+
}
|
|
22842
|
+
|
|
22843
|
+
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Wistia)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
22844
|
+
|
|
22845
|
+
_defineProperty(_assertThisInitialized(_this), "callPlayer", utils$2.callPlayer);
|
|
22846
|
+
|
|
22847
|
+
_defineProperty(_assertThisInitialized(_this), "mute", function () {
|
|
22848
|
+
_this.callPlayer('mute');
|
|
22849
|
+
});
|
|
22850
|
+
|
|
22851
|
+
_defineProperty(_assertThisInitialized(_this), "unmute", function () {
|
|
22852
|
+
_this.callPlayer('unmute');
|
|
22853
|
+
});
|
|
22854
|
+
|
|
22855
|
+
return _this;
|
|
22856
|
+
}
|
|
22857
|
+
|
|
22858
|
+
_createClass(Wistia, [{
|
|
22859
|
+
key: "getID",
|
|
22860
|
+
value: function getID(url) {
|
|
22861
|
+
return url && url.match(MATCH_URL)[1];
|
|
22862
|
+
}
|
|
22863
|
+
}, {
|
|
22864
|
+
key: "load",
|
|
22865
|
+
value: function load(url) {
|
|
22866
|
+
var _this2 = this;
|
|
22867
|
+
|
|
22868
|
+
var _this$props = this.props,
|
|
22869
|
+
playing = _this$props.playing,
|
|
22870
|
+
muted = _this$props.muted,
|
|
22871
|
+
controls = _this$props.controls,
|
|
22872
|
+
_onReady = _this$props.onReady,
|
|
22873
|
+
onPlay = _this$props.onPlay,
|
|
22874
|
+
onPause = _this$props.onPause,
|
|
22875
|
+
onSeek = _this$props.onSeek,
|
|
22876
|
+
onEnded = _this$props.onEnded,
|
|
22877
|
+
config = _this$props.config,
|
|
22878
|
+
onError = _this$props.onError;
|
|
22879
|
+
(0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL).then(function () {
|
|
22880
|
+
window._wq = window._wq || [];
|
|
22881
|
+
|
|
22882
|
+
window._wq.push({
|
|
22883
|
+
id: _this2.getID(url),
|
|
22884
|
+
options: _objectSpread({
|
|
22885
|
+
autoPlay: playing,
|
|
22886
|
+
silentAutoPlay: 'allow',
|
|
22887
|
+
muted: muted,
|
|
22888
|
+
controlsVisibleOnLoad: controls
|
|
22889
|
+
}, config.wistia.options),
|
|
22890
|
+
onReady: function onReady(player) {
|
|
22891
|
+
_this2.player = player;
|
|
22892
|
+
|
|
22893
|
+
_this2.unbind();
|
|
22894
|
+
|
|
22895
|
+
_this2.player.bind('play', onPlay);
|
|
22896
|
+
|
|
22897
|
+
_this2.player.bind('pause', onPause);
|
|
22898
|
+
|
|
22899
|
+
_this2.player.bind('seek', onSeek);
|
|
22900
|
+
|
|
22901
|
+
_this2.player.bind('end', onEnded);
|
|
22902
|
+
|
|
22903
|
+
_onReady();
|
|
22904
|
+
}
|
|
22905
|
+
});
|
|
22906
|
+
}, onError);
|
|
22907
|
+
}
|
|
22908
|
+
}, {
|
|
22909
|
+
key: "play",
|
|
22910
|
+
value: function play() {
|
|
22911
|
+
this.callPlayer('play');
|
|
22912
|
+
}
|
|
22913
|
+
}, {
|
|
22914
|
+
key: "pause",
|
|
22915
|
+
value: function pause() {
|
|
22916
|
+
this.callPlayer('pause');
|
|
22917
|
+
}
|
|
22918
|
+
}, {
|
|
22919
|
+
key: "unbind",
|
|
22920
|
+
value: function unbind() {
|
|
22921
|
+
var _this$props2 = this.props,
|
|
22922
|
+
onPlay = _this$props2.onPlay,
|
|
22923
|
+
onPause = _this$props2.onPause,
|
|
22924
|
+
onSeek = _this$props2.onSeek,
|
|
22925
|
+
onEnded = _this$props2.onEnded;
|
|
22926
|
+
this.player.unbind('play', onPlay);
|
|
22927
|
+
this.player.unbind('pause', onPause);
|
|
22928
|
+
this.player.unbind('seek', onSeek);
|
|
22929
|
+
this.player.unbind('end', onEnded);
|
|
22930
|
+
}
|
|
22931
|
+
}, {
|
|
22932
|
+
key: "stop",
|
|
22933
|
+
value: function stop() {
|
|
22934
|
+
this.unbind();
|
|
22935
|
+
this.callPlayer('remove');
|
|
22936
|
+
}
|
|
22937
|
+
}, {
|
|
22938
|
+
key: "seekTo",
|
|
22939
|
+
value: function seekTo(seconds) {
|
|
22940
|
+
this.callPlayer('time', seconds);
|
|
22941
|
+
}
|
|
22942
|
+
}, {
|
|
22943
|
+
key: "setVolume",
|
|
22944
|
+
value: function setVolume(fraction) {
|
|
22945
|
+
this.callPlayer('volume', fraction);
|
|
22946
|
+
}
|
|
22947
|
+
}, {
|
|
22948
|
+
key: "setPlaybackRate",
|
|
22949
|
+
value: function setPlaybackRate(rate) {
|
|
22950
|
+
this.callPlayer('playbackRate', rate);
|
|
22951
|
+
}
|
|
22952
|
+
}, {
|
|
22953
|
+
key: "getDuration",
|
|
22954
|
+
value: function getDuration() {
|
|
22955
|
+
return this.callPlayer('duration');
|
|
22956
|
+
}
|
|
22957
|
+
}, {
|
|
22958
|
+
key: "getCurrentTime",
|
|
22959
|
+
value: function getCurrentTime() {
|
|
22960
|
+
return this.callPlayer('time');
|
|
22961
|
+
}
|
|
22962
|
+
}, {
|
|
22963
|
+
key: "getSecondsLoaded",
|
|
22964
|
+
value: function getSecondsLoaded() {
|
|
22965
|
+
return null;
|
|
22966
|
+
}
|
|
22967
|
+
}, {
|
|
22968
|
+
key: "render",
|
|
22969
|
+
value: function render() {
|
|
22970
|
+
var id = this.getID(this.props.url);
|
|
22971
|
+
var className = "wistia_embed wistia_async_".concat(id);
|
|
22972
|
+
var style = {
|
|
22973
|
+
width: '100%',
|
|
22974
|
+
height: '100%'
|
|
22975
|
+
};
|
|
22976
|
+
return _react["default"].createElement("div", {
|
|
22977
|
+
key: id,
|
|
22978
|
+
className: className,
|
|
22979
|
+
style: style
|
|
22980
|
+
});
|
|
22981
|
+
}
|
|
22982
|
+
}]);
|
|
22983
|
+
|
|
22984
|
+
return Wistia;
|
|
22985
|
+
}(_react.Component);
|
|
22986
|
+
|
|
22987
|
+
exports.Wistia = Wistia;
|
|
22988
|
+
|
|
22989
|
+
_defineProperty(Wistia, "displayName", 'Wistia');
|
|
22990
|
+
|
|
22991
|
+
_defineProperty(Wistia, "canPlay", function (url) {
|
|
22992
|
+
return MATCH_URL.test(url);
|
|
22993
|
+
});
|
|
22994
|
+
|
|
22995
|
+
_defineProperty(Wistia, "loopOnEnded", true);
|
|
22996
|
+
|
|
22997
|
+
var _default = (0, _singlePlayer["default"])(Wistia);
|
|
22998
|
+
|
|
22999
|
+
exports["default"] = _default;
|
|
23000
|
+
});
|
|
23001
|
+
|
|
23002
|
+
unwrapExports(Wistia_1);
|
|
23003
|
+
var Wistia_2 = Wistia_1.Wistia;
|
|
23004
|
+
|
|
23005
|
+
var Twitch_1 = createCommonjsModule(function (module, exports) {
|
|
23006
|
+
|
|
23007
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23008
|
+
value: true
|
|
23009
|
+
});
|
|
23010
|
+
exports["default"] = exports.Twitch = void 0;
|
|
23011
|
+
|
|
23012
|
+
var _react = _interopRequireWildcard(React__default);
|
|
23013
|
+
|
|
23014
|
+
|
|
23015
|
+
|
|
23016
|
+
var _singlePlayer = _interopRequireDefault(singlePlayer);
|
|
23017
|
+
|
|
23018
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23019
|
+
|
|
23020
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
23021
|
+
|
|
23022
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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; }
|
|
23023
|
+
|
|
23024
|
+
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
|
23025
|
+
|
|
23026
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
23027
|
+
|
|
23028
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
23029
|
+
|
|
23030
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
23031
|
+
|
|
23032
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
23033
|
+
|
|
23034
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
23035
|
+
|
|
23036
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
23037
|
+
|
|
23038
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
23039
|
+
|
|
23040
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
23041
|
+
|
|
23042
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
23043
|
+
|
|
23044
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
23045
|
+
|
|
23046
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23047
|
+
|
|
23048
|
+
var SDK_URL = 'https://player.twitch.tv/js/embed/v1.js';
|
|
23049
|
+
var SDK_GLOBAL = 'Twitch';
|
|
23050
|
+
var MATCH_VIDEO_URL = /(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/;
|
|
23051
|
+
var MATCH_CHANNEL_URL = /(?:www\.|go\.)?twitch\.tv\/([a-z0-9_]+)($|\?)/;
|
|
23052
|
+
var PLAYER_ID_PREFIX = 'twitch-player-';
|
|
23053
|
+
|
|
23054
|
+
var Twitch =
|
|
23055
|
+
/*#__PURE__*/
|
|
23056
|
+
function (_Component) {
|
|
23057
|
+
_inherits(Twitch, _Component);
|
|
23058
|
+
|
|
23059
|
+
function Twitch() {
|
|
23060
|
+
var _getPrototypeOf2;
|
|
23061
|
+
|
|
23062
|
+
var _this;
|
|
23063
|
+
|
|
23064
|
+
_classCallCheck(this, Twitch);
|
|
23065
|
+
|
|
23066
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
23067
|
+
args[_key] = arguments[_key];
|
|
23068
|
+
}
|
|
23069
|
+
|
|
23070
|
+
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Twitch)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
23071
|
+
|
|
23072
|
+
_defineProperty(_assertThisInitialized(_this), "callPlayer", utils$2.callPlayer);
|
|
23073
|
+
|
|
23074
|
+
_defineProperty(_assertThisInitialized(_this), "playerID", _this.props.config.twitch.playerId || "".concat(PLAYER_ID_PREFIX).concat((0, utils$2.randomString)()));
|
|
23075
|
+
|
|
23076
|
+
_defineProperty(_assertThisInitialized(_this), "mute", function () {
|
|
23077
|
+
_this.callPlayer('setMuted', true);
|
|
23078
|
+
});
|
|
23079
|
+
|
|
23080
|
+
_defineProperty(_assertThisInitialized(_this), "unmute", function () {
|
|
23081
|
+
_this.callPlayer('setMuted', false);
|
|
23082
|
+
});
|
|
23083
|
+
|
|
23084
|
+
return _this;
|
|
23085
|
+
}
|
|
23086
|
+
|
|
23087
|
+
_createClass(Twitch, [{
|
|
23088
|
+
key: "load",
|
|
23089
|
+
value: function load(url, isReady) {
|
|
23090
|
+
var _this2 = this;
|
|
23091
|
+
|
|
23092
|
+
var _this$props = this.props,
|
|
23093
|
+
playsinline = _this$props.playsinline,
|
|
23094
|
+
onError = _this$props.onError,
|
|
23095
|
+
config = _this$props.config,
|
|
23096
|
+
controls = _this$props.controls;
|
|
23097
|
+
var isChannel = MATCH_CHANNEL_URL.test(url);
|
|
23098
|
+
var id = isChannel ? url.match(MATCH_CHANNEL_URL)[1] : url.match(MATCH_VIDEO_URL)[1];
|
|
23099
|
+
|
|
23100
|
+
if (isReady) {
|
|
23101
|
+
if (isChannel) {
|
|
23102
|
+
this.player.setChannel(id);
|
|
23103
|
+
} else {
|
|
23104
|
+
this.player.setVideo('v' + id);
|
|
23105
|
+
}
|
|
23106
|
+
|
|
23107
|
+
return;
|
|
23108
|
+
}
|
|
23109
|
+
|
|
23110
|
+
(0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL).then(function (Twitch) {
|
|
23111
|
+
_this2.player = new Twitch.Player(_this2.playerID, _objectSpread({
|
|
23112
|
+
video: isChannel ? '' : id,
|
|
23113
|
+
channel: isChannel ? id : '',
|
|
23114
|
+
height: '100%',
|
|
23115
|
+
width: '100%',
|
|
23116
|
+
playsinline: playsinline,
|
|
23117
|
+
autoplay: _this2.props.playing,
|
|
23118
|
+
muted: _this2.props.muted,
|
|
23119
|
+
// https://github.com/CookPete/react-player/issues/733#issuecomment-549085859
|
|
23120
|
+
controls: isChannel ? true : controls
|
|
23121
|
+
}, config.twitch.options));
|
|
23122
|
+
var _Twitch$Player = Twitch.Player,
|
|
23123
|
+
READY = _Twitch$Player.READY,
|
|
23124
|
+
PLAYING = _Twitch$Player.PLAYING,
|
|
23125
|
+
PAUSE = _Twitch$Player.PAUSE,
|
|
23126
|
+
ENDED = _Twitch$Player.ENDED,
|
|
23127
|
+
ONLINE = _Twitch$Player.ONLINE,
|
|
23128
|
+
OFFLINE = _Twitch$Player.OFFLINE;
|
|
23129
|
+
|
|
23130
|
+
_this2.player.addEventListener(READY, _this2.props.onReady);
|
|
23131
|
+
|
|
23132
|
+
_this2.player.addEventListener(PLAYING, _this2.props.onPlay);
|
|
23133
|
+
|
|
23134
|
+
_this2.player.addEventListener(PAUSE, _this2.props.onPause);
|
|
23135
|
+
|
|
23136
|
+
_this2.player.addEventListener(ENDED, _this2.props.onEnded); // Prevent weird isLoading behaviour when streams are offline
|
|
23137
|
+
|
|
23138
|
+
|
|
23139
|
+
_this2.player.addEventListener(ONLINE, _this2.props.onLoaded);
|
|
23140
|
+
|
|
23141
|
+
_this2.player.addEventListener(OFFLINE, _this2.props.onLoaded);
|
|
23142
|
+
}, onError);
|
|
23143
|
+
}
|
|
23144
|
+
}, {
|
|
23145
|
+
key: "play",
|
|
23146
|
+
value: function play() {
|
|
23147
|
+
this.callPlayer('play');
|
|
23148
|
+
}
|
|
23149
|
+
}, {
|
|
23150
|
+
key: "pause",
|
|
23151
|
+
value: function pause() {
|
|
23152
|
+
this.callPlayer('pause');
|
|
23153
|
+
}
|
|
23154
|
+
}, {
|
|
23155
|
+
key: "stop",
|
|
23156
|
+
value: function stop() {
|
|
23157
|
+
this.callPlayer('pause');
|
|
23158
|
+
}
|
|
23159
|
+
}, {
|
|
23160
|
+
key: "seekTo",
|
|
23161
|
+
value: function seekTo(seconds) {
|
|
23162
|
+
this.callPlayer('seek', seconds);
|
|
23163
|
+
}
|
|
23164
|
+
}, {
|
|
23165
|
+
key: "setVolume",
|
|
23166
|
+
value: function setVolume(fraction) {
|
|
23167
|
+
this.callPlayer('setVolume', fraction);
|
|
23168
|
+
}
|
|
23169
|
+
}, {
|
|
23170
|
+
key: "getDuration",
|
|
23171
|
+
value: function getDuration() {
|
|
23172
|
+
return this.callPlayer('getDuration');
|
|
23173
|
+
}
|
|
23174
|
+
}, {
|
|
23175
|
+
key: "getCurrentTime",
|
|
23176
|
+
value: function getCurrentTime() {
|
|
23177
|
+
return this.callPlayer('getCurrentTime');
|
|
23178
|
+
}
|
|
23179
|
+
}, {
|
|
23180
|
+
key: "getSecondsLoaded",
|
|
23181
|
+
value: function getSecondsLoaded() {
|
|
23182
|
+
return null;
|
|
23183
|
+
}
|
|
23184
|
+
}, {
|
|
23185
|
+
key: "render",
|
|
23186
|
+
value: function render() {
|
|
23187
|
+
var style = {
|
|
23188
|
+
width: '100%',
|
|
23189
|
+
height: '100%'
|
|
23190
|
+
};
|
|
23191
|
+
return _react["default"].createElement("div", {
|
|
23192
|
+
style: style,
|
|
23193
|
+
id: this.playerID
|
|
23194
|
+
});
|
|
23195
|
+
}
|
|
23196
|
+
}]);
|
|
23197
|
+
|
|
23198
|
+
return Twitch;
|
|
23199
|
+
}(_react.Component);
|
|
23200
|
+
|
|
23201
|
+
exports.Twitch = Twitch;
|
|
23202
|
+
|
|
23203
|
+
_defineProperty(Twitch, "displayName", 'Twitch');
|
|
23204
|
+
|
|
23205
|
+
_defineProperty(Twitch, "canPlay", function (url) {
|
|
23206
|
+
return MATCH_VIDEO_URL.test(url) || MATCH_CHANNEL_URL.test(url);
|
|
23207
|
+
});
|
|
23208
|
+
|
|
23209
|
+
_defineProperty(Twitch, "loopOnEnded", true);
|
|
23210
|
+
|
|
23211
|
+
var _default = (0, _singlePlayer["default"])(Twitch);
|
|
23212
|
+
|
|
23213
|
+
exports["default"] = _default;
|
|
23214
|
+
});
|
|
23215
|
+
|
|
23216
|
+
unwrapExports(Twitch_1);
|
|
23217
|
+
var Twitch_2 = Twitch_1.Twitch;
|
|
23218
|
+
|
|
23219
|
+
var DailyMotion_1 = createCommonjsModule(function (module, exports) {
|
|
23220
|
+
|
|
23221
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23222
|
+
value: true
|
|
23223
|
+
});
|
|
23224
|
+
exports["default"] = exports.DailyMotion = void 0;
|
|
23225
|
+
|
|
23226
|
+
var _react = _interopRequireWildcard(React__default);
|
|
23227
|
+
|
|
23228
|
+
|
|
23229
|
+
|
|
23230
|
+
var _singlePlayer = _interopRequireDefault(singlePlayer);
|
|
23231
|
+
|
|
23232
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23233
|
+
|
|
23234
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
23235
|
+
|
|
23236
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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; }
|
|
23237
|
+
|
|
23238
|
+
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
|
23239
|
+
|
|
23240
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
23241
|
+
|
|
23242
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
23243
|
+
|
|
23244
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
|
|
23245
|
+
|
|
23246
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
|
23247
|
+
|
|
23248
|
+
function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
23249
|
+
|
|
23250
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
23251
|
+
|
|
23252
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
23253
|
+
|
|
23254
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
23255
|
+
|
|
23256
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
23257
|
+
|
|
23258
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
23259
|
+
|
|
23260
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
23261
|
+
|
|
23262
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
23263
|
+
|
|
23264
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
23265
|
+
|
|
23266
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
23267
|
+
|
|
23268
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23269
|
+
|
|
23270
|
+
var SDK_URL = 'https://api.dmcdn.net/all.js';
|
|
23271
|
+
var SDK_GLOBAL = 'DM';
|
|
23272
|
+
var SDK_GLOBAL_READY = 'dmAsyncInit';
|
|
23273
|
+
var MATCH_URL = /^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?$/;
|
|
23274
|
+
|
|
23275
|
+
var DailyMotion =
|
|
23276
|
+
/*#__PURE__*/
|
|
23277
|
+
function (_Component) {
|
|
23278
|
+
_inherits(DailyMotion, _Component);
|
|
23279
|
+
|
|
23280
|
+
function DailyMotion() {
|
|
23281
|
+
var _getPrototypeOf2;
|
|
23282
|
+
|
|
23283
|
+
var _this;
|
|
23284
|
+
|
|
23285
|
+
_classCallCheck(this, DailyMotion);
|
|
23286
|
+
|
|
23287
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
23288
|
+
args[_key] = arguments[_key];
|
|
23289
|
+
}
|
|
23290
|
+
|
|
23291
|
+
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(DailyMotion)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
23292
|
+
|
|
23293
|
+
_defineProperty(_assertThisInitialized(_this), "callPlayer", utils$2.callPlayer);
|
|
23294
|
+
|
|
23295
|
+
_defineProperty(_assertThisInitialized(_this), "onDurationChange", function () {
|
|
23296
|
+
var duration = _this.getDuration();
|
|
23297
|
+
|
|
23298
|
+
_this.props.onDuration(duration);
|
|
23299
|
+
});
|
|
23300
|
+
|
|
23301
|
+
_defineProperty(_assertThisInitialized(_this), "mute", function () {
|
|
23302
|
+
_this.callPlayer('setMuted', true);
|
|
23303
|
+
});
|
|
23304
|
+
|
|
23305
|
+
_defineProperty(_assertThisInitialized(_this), "unmute", function () {
|
|
23306
|
+
_this.callPlayer('setMuted', false);
|
|
23307
|
+
});
|
|
23308
|
+
|
|
23309
|
+
_defineProperty(_assertThisInitialized(_this), "ref", function (container) {
|
|
23310
|
+
_this.container = container;
|
|
23311
|
+
});
|
|
23312
|
+
|
|
23313
|
+
return _this;
|
|
23314
|
+
}
|
|
23315
|
+
|
|
23316
|
+
_createClass(DailyMotion, [{
|
|
23317
|
+
key: "load",
|
|
23318
|
+
value: function load(url) {
|
|
23319
|
+
var _this2 = this;
|
|
23320
|
+
|
|
23321
|
+
var _this$props = this.props,
|
|
23322
|
+
controls = _this$props.controls,
|
|
23323
|
+
config = _this$props.config,
|
|
23324
|
+
onError = _this$props.onError,
|
|
23325
|
+
playing = _this$props.playing;
|
|
23326
|
+
|
|
23327
|
+
var _url$match = url.match(MATCH_URL),
|
|
23328
|
+
_url$match2 = _slicedToArray(_url$match, 2),
|
|
23329
|
+
id = _url$match2[1];
|
|
23330
|
+
|
|
23331
|
+
if (this.player) {
|
|
23332
|
+
this.player.load(id, {
|
|
23333
|
+
start: (0, utils$2.parseStartTime)(url),
|
|
23334
|
+
autoplay: playing
|
|
23335
|
+
});
|
|
23336
|
+
return;
|
|
23337
|
+
}
|
|
23338
|
+
|
|
23339
|
+
(0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY, function (DM) {
|
|
23340
|
+
return DM.player;
|
|
23341
|
+
}).then(function (DM) {
|
|
23342
|
+
if (!_this2.container) return;
|
|
23343
|
+
var Player = DM.player;
|
|
23344
|
+
_this2.player = new Player(_this2.container, {
|
|
23345
|
+
width: '100%',
|
|
23346
|
+
height: '100%',
|
|
23347
|
+
video: id,
|
|
23348
|
+
params: _objectSpread({
|
|
23349
|
+
controls: controls,
|
|
23350
|
+
autoplay: _this2.props.playing,
|
|
23351
|
+
mute: _this2.props.muted,
|
|
23352
|
+
start: (0, utils$2.parseStartTime)(url),
|
|
23353
|
+
origin: window.location.origin
|
|
23354
|
+
}, config.dailymotion.params),
|
|
23355
|
+
events: {
|
|
23356
|
+
apiready: _this2.props.onReady,
|
|
23357
|
+
seeked: function seeked() {
|
|
23358
|
+
return _this2.props.onSeek(_this2.player.currentTime);
|
|
23359
|
+
},
|
|
23360
|
+
video_end: _this2.props.onEnded,
|
|
23361
|
+
durationchange: _this2.onDurationChange,
|
|
23362
|
+
pause: _this2.props.onPause,
|
|
23363
|
+
playing: _this2.props.onPlay,
|
|
23364
|
+
waiting: _this2.props.onBuffer,
|
|
23365
|
+
error: function error(event) {
|
|
23366
|
+
return onError(event);
|
|
23367
|
+
}
|
|
23368
|
+
}
|
|
23369
|
+
});
|
|
23370
|
+
}, onError);
|
|
23371
|
+
}
|
|
23372
|
+
}, {
|
|
23373
|
+
key: "play",
|
|
23374
|
+
value: function play() {
|
|
23375
|
+
this.callPlayer('play');
|
|
23376
|
+
}
|
|
23377
|
+
}, {
|
|
23378
|
+
key: "pause",
|
|
23379
|
+
value: function pause() {
|
|
23380
|
+
this.callPlayer('pause');
|
|
23381
|
+
}
|
|
23382
|
+
}, {
|
|
23383
|
+
key: "stop",
|
|
23384
|
+
value: function stop() {// Nothing to do
|
|
23385
|
+
}
|
|
23386
|
+
}, {
|
|
23387
|
+
key: "seekTo",
|
|
23388
|
+
value: function seekTo(seconds) {
|
|
23389
|
+
this.callPlayer('seek', seconds);
|
|
23390
|
+
}
|
|
23391
|
+
}, {
|
|
23392
|
+
key: "setVolume",
|
|
23393
|
+
value: function setVolume(fraction) {
|
|
23394
|
+
this.callPlayer('setVolume', fraction);
|
|
23395
|
+
}
|
|
23396
|
+
}, {
|
|
23397
|
+
key: "getDuration",
|
|
23398
|
+
value: function getDuration() {
|
|
23399
|
+
return this.player.duration || null;
|
|
23400
|
+
}
|
|
23401
|
+
}, {
|
|
23402
|
+
key: "getCurrentTime",
|
|
23403
|
+
value: function getCurrentTime() {
|
|
23404
|
+
return this.player.currentTime;
|
|
23405
|
+
}
|
|
23406
|
+
}, {
|
|
23407
|
+
key: "getSecondsLoaded",
|
|
23408
|
+
value: function getSecondsLoaded() {
|
|
23409
|
+
return this.player.bufferedTime;
|
|
23410
|
+
}
|
|
23411
|
+
}, {
|
|
23412
|
+
key: "render",
|
|
23413
|
+
value: function render() {
|
|
23414
|
+
var display = this.props.display;
|
|
23415
|
+
var style = {
|
|
23416
|
+
width: '100%',
|
|
23417
|
+
height: '100%',
|
|
23418
|
+
display: display
|
|
23419
|
+
};
|
|
23420
|
+
return _react["default"].createElement("div", {
|
|
23421
|
+
style: style
|
|
23422
|
+
}, _react["default"].createElement("div", {
|
|
23423
|
+
ref: this.ref
|
|
23424
|
+
}));
|
|
23425
|
+
}
|
|
23426
|
+
}]);
|
|
23427
|
+
|
|
23428
|
+
return DailyMotion;
|
|
23429
|
+
}(_react.Component);
|
|
23430
|
+
|
|
23431
|
+
exports.DailyMotion = DailyMotion;
|
|
23432
|
+
|
|
23433
|
+
_defineProperty(DailyMotion, "displayName", 'DailyMotion');
|
|
23434
|
+
|
|
23435
|
+
_defineProperty(DailyMotion, "canPlay", function (url) {
|
|
23436
|
+
return MATCH_URL.test(url);
|
|
23437
|
+
});
|
|
23438
|
+
|
|
23439
|
+
_defineProperty(DailyMotion, "loopOnEnded", true);
|
|
23440
|
+
|
|
23441
|
+
var _default = (0, _singlePlayer["default"])(DailyMotion);
|
|
23442
|
+
|
|
23443
|
+
exports["default"] = _default;
|
|
23444
|
+
});
|
|
23445
|
+
|
|
23446
|
+
unwrapExports(DailyMotion_1);
|
|
23447
|
+
var DailyMotion_2 = DailyMotion_1.DailyMotion;
|
|
23448
|
+
|
|
23449
|
+
var Mixcloud_1 = createCommonjsModule(function (module, exports) {
|
|
23450
|
+
|
|
23451
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23452
|
+
value: true
|
|
23453
|
+
});
|
|
23454
|
+
exports["default"] = exports.Mixcloud = void 0;
|
|
23455
|
+
|
|
23456
|
+
var _react = _interopRequireWildcard(React__default);
|
|
23457
|
+
|
|
23458
|
+
|
|
23459
|
+
|
|
23460
|
+
var _singlePlayer = _interopRequireDefault(singlePlayer);
|
|
23461
|
+
|
|
23462
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23463
|
+
|
|
23464
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
23465
|
+
|
|
23466
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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; }
|
|
23467
|
+
|
|
23468
|
+
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
|
23469
|
+
|
|
23470
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
23471
|
+
|
|
23472
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
23473
|
+
|
|
23474
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
23475
|
+
|
|
23476
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
23477
|
+
|
|
23478
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
23479
|
+
|
|
23480
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
23481
|
+
|
|
23482
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
23483
|
+
|
|
23484
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
23485
|
+
|
|
23486
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
23487
|
+
|
|
23488
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
23489
|
+
|
|
23490
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23491
|
+
|
|
23492
|
+
var SDK_URL = 'https://widget.mixcloud.com/media/js/widgetApi.js';
|
|
23493
|
+
var SDK_GLOBAL = 'Mixcloud';
|
|
23494
|
+
var MATCH_URL = /mixcloud\.com\/([^/]+\/[^/]+)/;
|
|
23495
|
+
|
|
23496
|
+
var Mixcloud =
|
|
23497
|
+
/*#__PURE__*/
|
|
23498
|
+
function (_Component) {
|
|
23499
|
+
_inherits(Mixcloud, _Component);
|
|
23500
|
+
|
|
23501
|
+
function Mixcloud() {
|
|
23502
|
+
var _getPrototypeOf2;
|
|
23503
|
+
|
|
23504
|
+
var _this;
|
|
23505
|
+
|
|
23506
|
+
_classCallCheck(this, Mixcloud);
|
|
23507
|
+
|
|
23508
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
23509
|
+
args[_key] = arguments[_key];
|
|
23510
|
+
}
|
|
23511
|
+
|
|
23512
|
+
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Mixcloud)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
23513
|
+
|
|
23514
|
+
_defineProperty(_assertThisInitialized(_this), "callPlayer", utils$2.callPlayer);
|
|
23515
|
+
|
|
23516
|
+
_defineProperty(_assertThisInitialized(_this), "duration", null);
|
|
23517
|
+
|
|
23518
|
+
_defineProperty(_assertThisInitialized(_this), "currentTime", null);
|
|
23519
|
+
|
|
23520
|
+
_defineProperty(_assertThisInitialized(_this), "secondsLoaded", null);
|
|
23521
|
+
|
|
23522
|
+
_defineProperty(_assertThisInitialized(_this), "mute", function () {// No volume support
|
|
23523
|
+
});
|
|
23524
|
+
|
|
23525
|
+
_defineProperty(_assertThisInitialized(_this), "unmute", function () {// No volume support
|
|
23526
|
+
});
|
|
23527
|
+
|
|
23528
|
+
_defineProperty(_assertThisInitialized(_this), "ref", function (iframe) {
|
|
23529
|
+
_this.iframe = iframe;
|
|
23530
|
+
});
|
|
23531
|
+
|
|
23532
|
+
return _this;
|
|
23533
|
+
}
|
|
23534
|
+
|
|
23535
|
+
_createClass(Mixcloud, [{
|
|
23536
|
+
key: "load",
|
|
23537
|
+
value: function load(url) {
|
|
23538
|
+
var _this2 = this;
|
|
23539
|
+
|
|
23540
|
+
(0, utils$2.getSDK)(SDK_URL, SDK_GLOBAL).then(function (Mixcloud) {
|
|
23541
|
+
_this2.player = Mixcloud.PlayerWidget(_this2.iframe);
|
|
23542
|
+
|
|
23543
|
+
_this2.player.ready.then(function () {
|
|
23544
|
+
_this2.player.events.play.on(_this2.props.onPlay);
|
|
23545
|
+
|
|
23546
|
+
_this2.player.events.pause.on(_this2.props.onPause);
|
|
23547
|
+
|
|
23548
|
+
_this2.player.events.ended.on(_this2.props.onEnded);
|
|
23549
|
+
|
|
23550
|
+
_this2.player.events.error.on(_this2.props.error);
|
|
23551
|
+
|
|
23552
|
+
_this2.player.events.progress.on(function (seconds, duration) {
|
|
23553
|
+
_this2.currentTime = seconds;
|
|
23554
|
+
_this2.duration = duration;
|
|
23555
|
+
});
|
|
23556
|
+
|
|
23557
|
+
_this2.props.onReady();
|
|
23558
|
+
});
|
|
23559
|
+
}, this.props.onError);
|
|
23560
|
+
}
|
|
23561
|
+
}, {
|
|
23562
|
+
key: "play",
|
|
23563
|
+
value: function play() {
|
|
23564
|
+
this.callPlayer('play');
|
|
23565
|
+
}
|
|
23566
|
+
}, {
|
|
23567
|
+
key: "pause",
|
|
23568
|
+
value: function pause() {
|
|
23569
|
+
this.callPlayer('pause');
|
|
23570
|
+
}
|
|
23571
|
+
}, {
|
|
23572
|
+
key: "stop",
|
|
23573
|
+
value: function stop() {// Nothing to do
|
|
23574
|
+
}
|
|
23575
|
+
}, {
|
|
23576
|
+
key: "seekTo",
|
|
23577
|
+
value: function seekTo(seconds) {
|
|
23578
|
+
this.callPlayer('seek', seconds);
|
|
23579
|
+
}
|
|
23580
|
+
}, {
|
|
23581
|
+
key: "setVolume",
|
|
23582
|
+
value: function setVolume(fraction) {// No volume support
|
|
23583
|
+
}
|
|
23584
|
+
}, {
|
|
23585
|
+
key: "getDuration",
|
|
23586
|
+
value: function getDuration() {
|
|
23587
|
+
return this.duration;
|
|
23588
|
+
}
|
|
23589
|
+
}, {
|
|
23590
|
+
key: "getCurrentTime",
|
|
23591
|
+
value: function getCurrentTime() {
|
|
23592
|
+
return this.currentTime;
|
|
23593
|
+
}
|
|
23594
|
+
}, {
|
|
23595
|
+
key: "getSecondsLoaded",
|
|
23596
|
+
value: function getSecondsLoaded() {
|
|
23597
|
+
return null;
|
|
23598
|
+
}
|
|
23599
|
+
}, {
|
|
23600
|
+
key: "render",
|
|
23601
|
+
value: function render() {
|
|
23602
|
+
var _this$props = this.props,
|
|
23603
|
+
url = _this$props.url,
|
|
23604
|
+
config = _this$props.config;
|
|
23605
|
+
var id = url.match(MATCH_URL)[1];
|
|
23606
|
+
var style = {
|
|
23607
|
+
width: '100%',
|
|
23608
|
+
height: '100%'
|
|
23609
|
+
};
|
|
23610
|
+
var query = (0, utils$2.queryString)(_objectSpread({}, config.mixcloud.options, {
|
|
23611
|
+
feed: "/".concat(id, "/")
|
|
23612
|
+
})); // We have to give the iframe a key here to prevent a
|
|
23613
|
+
// weird dialog appearing when loading a new track
|
|
23614
|
+
|
|
23615
|
+
return _react["default"].createElement("iframe", {
|
|
23616
|
+
key: id,
|
|
23617
|
+
ref: this.ref,
|
|
23618
|
+
style: style,
|
|
23619
|
+
src: "https://www.mixcloud.com/widget/iframe/?".concat(query),
|
|
23620
|
+
frameBorder: "0"
|
|
23621
|
+
});
|
|
23622
|
+
}
|
|
23623
|
+
}]);
|
|
23624
|
+
|
|
23625
|
+
return Mixcloud;
|
|
23626
|
+
}(_react.Component);
|
|
23627
|
+
|
|
23628
|
+
exports.Mixcloud = Mixcloud;
|
|
23629
|
+
|
|
23630
|
+
_defineProperty(Mixcloud, "displayName", 'Mixcloud');
|
|
23631
|
+
|
|
23632
|
+
_defineProperty(Mixcloud, "canPlay", function (url) {
|
|
23633
|
+
return MATCH_URL.test(url);
|
|
23634
|
+
});
|
|
23635
|
+
|
|
23636
|
+
_defineProperty(Mixcloud, "loopOnEnded", true);
|
|
23637
|
+
|
|
23638
|
+
var _default = (0, _singlePlayer["default"])(Mixcloud);
|
|
23639
|
+
|
|
23640
|
+
exports["default"] = _default;
|
|
23641
|
+
});
|
|
23642
|
+
|
|
23643
|
+
unwrapExports(Mixcloud_1);
|
|
23644
|
+
var Mixcloud_2 = Mixcloud_1.Mixcloud;
|
|
23645
|
+
|
|
23646
|
+
var FilePlayer_1 = createCommonjsModule(function (module, exports) {
|
|
23647
|
+
|
|
23648
|
+
Object.defineProperty(exports, "__esModule", {
|
|
23649
|
+
value: true
|
|
23650
|
+
});
|
|
23651
|
+
exports["default"] = exports.FilePlayer = void 0;
|
|
23652
|
+
|
|
23653
|
+
var _react = _interopRequireWildcard(React__default);
|
|
23654
|
+
|
|
23655
|
+
|
|
23656
|
+
|
|
23657
|
+
var _singlePlayer = _interopRequireDefault(singlePlayer);
|
|
23658
|
+
|
|
23659
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
23660
|
+
|
|
23661
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
23662
|
+
|
|
23663
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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; }
|
|
23664
|
+
|
|
23665
|
+
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
|
23666
|
+
|
|
23667
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
23668
|
+
|
|
23669
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
23670
|
+
|
|
23671
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
23672
|
+
|
|
23673
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
23674
|
+
|
|
23675
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
23676
|
+
|
|
23677
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
23678
|
+
|
|
23679
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
23680
|
+
|
|
23681
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
23682
|
+
|
|
23683
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
23684
|
+
|
|
23685
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
23686
|
+
|
|
23687
|
+
var IOS = typeof navigator !== 'undefined' && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
|
23688
|
+
var AUDIO_EXTENSIONS = /\.(m4a|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i;
|
|
23689
|
+
var VIDEO_EXTENSIONS = /\.(mp4|og[gv]|webm|mov|m4v)($|\?)/i;
|
|
23690
|
+
var HLS_EXTENSIONS = /\.(m3u8)($|\?)/i;
|
|
23691
|
+
var HLS_SDK_URL = 'https://cdn.jsdelivr.net/npm/hls.js@VERSION';
|
|
23692
|
+
var HLS_GLOBAL = 'Hls';
|
|
23693
|
+
var DASH_EXTENSIONS = /\.(mpd)($|\?)/i;
|
|
23694
|
+
var DASH_SDK_URL = 'https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js';
|
|
23695
|
+
var DASH_GLOBAL = 'dashjs';
|
|
23696
|
+
var MATCH_DROPBOX_URL = /www\.dropbox\.com\/.+/;
|
|
23697
|
+
|
|
23698
|
+
function canPlay(url) {
|
|
23699
|
+
if (url instanceof Array) {
|
|
23700
|
+
var _iteratorNormalCompletion = true;
|
|
23701
|
+
var _didIteratorError = false;
|
|
23702
|
+
var _iteratorError = undefined;
|
|
23703
|
+
|
|
23704
|
+
try {
|
|
23705
|
+
for (var _iterator = url[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
23706
|
+
var item = _step.value;
|
|
23707
|
+
|
|
23708
|
+
if (typeof item === 'string' && canPlay(item)) {
|
|
23709
|
+
return true;
|
|
23710
|
+
}
|
|
23711
|
+
|
|
23712
|
+
if (canPlay(item.src)) {
|
|
23713
|
+
return true;
|
|
23714
|
+
}
|
|
23715
|
+
}
|
|
23716
|
+
} catch (err) {
|
|
23717
|
+
_didIteratorError = true;
|
|
23718
|
+
_iteratorError = err;
|
|
23719
|
+
} finally {
|
|
23720
|
+
try {
|
|
23721
|
+
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
|
|
23722
|
+
_iterator["return"]();
|
|
23723
|
+
}
|
|
23724
|
+
} finally {
|
|
23725
|
+
if (_didIteratorError) {
|
|
23726
|
+
throw _iteratorError;
|
|
23727
|
+
}
|
|
23728
|
+
}
|
|
23729
|
+
}
|
|
23730
|
+
|
|
23731
|
+
return false;
|
|
23732
|
+
}
|
|
23733
|
+
|
|
23734
|
+
if ((0, utils$2.isMediaStream)(url)) {
|
|
23735
|
+
return true;
|
|
23736
|
+
}
|
|
23737
|
+
|
|
23738
|
+
return AUDIO_EXTENSIONS.test(url) || VIDEO_EXTENSIONS.test(url) || HLS_EXTENSIONS.test(url) || DASH_EXTENSIONS.test(url);
|
|
23739
|
+
}
|
|
23740
|
+
|
|
23741
|
+
function supportsWebKitPresentationMode(video) {
|
|
23742
|
+
if (!video) video = document.createElement('video'); // Check if Safari supports PiP, and is not on mobile (other than iPad)
|
|
23743
|
+
// iPhone safari appears to "support" PiP through the check, however PiP does not function
|
|
23744
|
+
|
|
23745
|
+
return video.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === 'function' && !/iPhone|iPod/.test(navigator.userAgent);
|
|
23746
|
+
}
|
|
23747
|
+
|
|
23748
|
+
function canEnablePIP(url) {
|
|
23749
|
+
return canPlay(url) && (!!document.pictureInPictureEnabled || supportsWebKitPresentationMode()) && !AUDIO_EXTENSIONS.test(url);
|
|
23750
|
+
}
|
|
23751
|
+
|
|
23752
|
+
var FilePlayer =
|
|
23753
|
+
/*#__PURE__*/
|
|
23754
|
+
function (_Component) {
|
|
23755
|
+
_inherits(FilePlayer, _Component);
|
|
23756
|
+
|
|
23757
|
+
function FilePlayer() {
|
|
23758
|
+
var _getPrototypeOf2;
|
|
23759
|
+
|
|
23760
|
+
var _this;
|
|
23761
|
+
|
|
23762
|
+
_classCallCheck(this, FilePlayer);
|
|
23763
|
+
|
|
23764
|
+
for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
23765
|
+
_args[_key] = arguments[_key];
|
|
23766
|
+
}
|
|
23767
|
+
|
|
23768
|
+
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(FilePlayer)).call.apply(_getPrototypeOf2, [this].concat(_args)));
|
|
23769
|
+
|
|
23770
|
+
_defineProperty(_assertThisInitialized(_this), "onReady", function () {
|
|
23771
|
+
var _this$props;
|
|
23772
|
+
|
|
23773
|
+
return (_this$props = _this.props).onReady.apply(_this$props, arguments);
|
|
23774
|
+
});
|
|
23775
|
+
|
|
23776
|
+
_defineProperty(_assertThisInitialized(_this), "onPlay", function () {
|
|
23777
|
+
var _this$props2;
|
|
23778
|
+
|
|
23779
|
+
return (_this$props2 = _this.props).onPlay.apply(_this$props2, arguments);
|
|
23780
|
+
});
|
|
23781
|
+
|
|
23782
|
+
_defineProperty(_assertThisInitialized(_this), "onBuffer", function () {
|
|
23783
|
+
var _this$props3;
|
|
23784
|
+
|
|
23785
|
+
return (_this$props3 = _this.props).onBuffer.apply(_this$props3, arguments);
|
|
23786
|
+
});
|
|
23787
|
+
|
|
23788
|
+
_defineProperty(_assertThisInitialized(_this), "onBufferEnd", function () {
|
|
23789
|
+
var _this$props4;
|
|
23790
|
+
|
|
23791
|
+
return (_this$props4 = _this.props).onBufferEnd.apply(_this$props4, arguments);
|
|
23792
|
+
});
|
|
23793
|
+
|
|
23794
|
+
_defineProperty(_assertThisInitialized(_this), "onPause", function () {
|
|
23795
|
+
var _this$props5;
|
|
23796
|
+
|
|
23797
|
+
return (_this$props5 = _this.props).onPause.apply(_this$props5, arguments);
|
|
23798
|
+
});
|
|
23799
|
+
|
|
23800
|
+
_defineProperty(_assertThisInitialized(_this), "onEnded", function () {
|
|
23801
|
+
var _this$props6;
|
|
23802
|
+
|
|
23803
|
+
return (_this$props6 = _this.props).onEnded.apply(_this$props6, arguments);
|
|
23804
|
+
});
|
|
23805
|
+
|
|
23806
|
+
_defineProperty(_assertThisInitialized(_this), "onError", function () {
|
|
23807
|
+
var _this$props7;
|
|
23808
|
+
|
|
23809
|
+
return (_this$props7 = _this.props).onError.apply(_this$props7, arguments);
|
|
23810
|
+
});
|
|
23811
|
+
|
|
23812
|
+
_defineProperty(_assertThisInitialized(_this), "onEnablePIP", function () {
|
|
23813
|
+
var _this$props8;
|
|
23814
|
+
|
|
23815
|
+
return (_this$props8 = _this.props).onEnablePIP.apply(_this$props8, arguments);
|
|
23816
|
+
});
|
|
23817
|
+
|
|
23818
|
+
_defineProperty(_assertThisInitialized(_this), "onDisablePIP", function (e) {
|
|
23819
|
+
var _this$props9 = _this.props,
|
|
23820
|
+
onDisablePIP = _this$props9.onDisablePIP,
|
|
23821
|
+
playing = _this$props9.playing;
|
|
23822
|
+
onDisablePIP(e);
|
|
23823
|
+
|
|
23824
|
+
if (playing) {
|
|
23825
|
+
_this.play();
|
|
23826
|
+
}
|
|
23827
|
+
});
|
|
23828
|
+
|
|
23829
|
+
_defineProperty(_assertThisInitialized(_this), "onPresentationModeChange", function (e) {
|
|
23830
|
+
if (_this.player && supportsWebKitPresentationMode(_this.player)) {
|
|
23831
|
+
var webkitPresentationMode = _this.player.webkitPresentationMode;
|
|
23832
|
+
|
|
23833
|
+
if (webkitPresentationMode === 'picture-in-picture') {
|
|
23834
|
+
_this.onEnablePIP(e);
|
|
23835
|
+
} else if (webkitPresentationMode === 'inline') {
|
|
23836
|
+
_this.onDisablePIP(e);
|
|
23837
|
+
}
|
|
23838
|
+
}
|
|
23839
|
+
});
|
|
23840
|
+
|
|
23841
|
+
_defineProperty(_assertThisInitialized(_this), "onSeek", function (e) {
|
|
23842
|
+
_this.props.onSeek(e.target.currentTime);
|
|
23843
|
+
});
|
|
23844
|
+
|
|
23845
|
+
_defineProperty(_assertThisInitialized(_this), "mute", function () {
|
|
23846
|
+
_this.player.muted = true;
|
|
23847
|
+
});
|
|
23848
|
+
|
|
23849
|
+
_defineProperty(_assertThisInitialized(_this), "unmute", function () {
|
|
23850
|
+
_this.player.muted = false;
|
|
23851
|
+
});
|
|
23852
|
+
|
|
23853
|
+
_defineProperty(_assertThisInitialized(_this), "renderSourceElement", function (source, index) {
|
|
23854
|
+
if (typeof source === 'string') {
|
|
23855
|
+
return _react["default"].createElement("source", {
|
|
23856
|
+
key: index,
|
|
23857
|
+
src: source
|
|
23858
|
+
});
|
|
23859
|
+
}
|
|
23860
|
+
|
|
23861
|
+
return _react["default"].createElement("source", _extends({
|
|
23862
|
+
key: index
|
|
23863
|
+
}, source));
|
|
23864
|
+
});
|
|
23865
|
+
|
|
23866
|
+
_defineProperty(_assertThisInitialized(_this), "renderTrack", function (track, index) {
|
|
23867
|
+
return _react["default"].createElement("track", _extends({
|
|
23868
|
+
key: index
|
|
23869
|
+
}, track));
|
|
23870
|
+
});
|
|
23871
|
+
|
|
23872
|
+
_defineProperty(_assertThisInitialized(_this), "ref", function (player) {
|
|
23873
|
+
if (_this.player) {
|
|
23874
|
+
// Store previous player to be used by removeListeners()
|
|
23875
|
+
_this.prevPlayer = _this.player;
|
|
23876
|
+
}
|
|
23877
|
+
|
|
23878
|
+
_this.player = player;
|
|
23879
|
+
});
|
|
23880
|
+
|
|
23881
|
+
return _this;
|
|
23882
|
+
}
|
|
23883
|
+
|
|
23884
|
+
_createClass(FilePlayer, [{
|
|
23885
|
+
key: "componentDidMount",
|
|
23886
|
+
value: function componentDidMount() {
|
|
23887
|
+
this.addListeners(this.player);
|
|
23888
|
+
|
|
23889
|
+
if (IOS) {
|
|
23890
|
+
this.player.load();
|
|
23891
|
+
}
|
|
23892
|
+
}
|
|
23893
|
+
}, {
|
|
23894
|
+
key: "componentDidUpdate",
|
|
23895
|
+
value: function componentDidUpdate(prevProps) {
|
|
23896
|
+
if (this.shouldUseAudio(this.props) !== this.shouldUseAudio(prevProps)) {
|
|
23897
|
+
this.removeListeners(this.prevPlayer);
|
|
23898
|
+
this.addListeners(this.player);
|
|
23899
|
+
}
|
|
23900
|
+
}
|
|
23901
|
+
}, {
|
|
23902
|
+
key: "componentWillUnmount",
|
|
23903
|
+
value: function componentWillUnmount() {
|
|
23904
|
+
this.removeListeners(this.player);
|
|
23905
|
+
}
|
|
23906
|
+
}, {
|
|
23907
|
+
key: "addListeners",
|
|
23908
|
+
value: function addListeners(player) {
|
|
23909
|
+
var playsinline = this.props.playsinline;
|
|
23910
|
+
player.addEventListener('canplay', this.onReady);
|
|
23911
|
+
player.addEventListener('play', this.onPlay);
|
|
23912
|
+
player.addEventListener('waiting', this.onBuffer);
|
|
23913
|
+
player.addEventListener('playing', this.onBufferEnd);
|
|
23914
|
+
player.addEventListener('pause', this.onPause);
|
|
23915
|
+
player.addEventListener('seeked', this.onSeek);
|
|
23916
|
+
player.addEventListener('ended', this.onEnded);
|
|
23917
|
+
player.addEventListener('error', this.onError);
|
|
23918
|
+
player.addEventListener('enterpictureinpicture', this.onEnablePIP);
|
|
23919
|
+
player.addEventListener('leavepictureinpicture', this.onDisablePIP);
|
|
23920
|
+
player.addEventListener('webkitpresentationmodechanged', this.onPresentationModeChange);
|
|
23921
|
+
|
|
23922
|
+
if (playsinline) {
|
|
23923
|
+
player.setAttribute('playsinline', '');
|
|
23924
|
+
player.setAttribute('webkit-playsinline', '');
|
|
23925
|
+
player.setAttribute('x5-playsinline', '');
|
|
23926
|
+
}
|
|
23927
|
+
}
|
|
23928
|
+
}, {
|
|
23929
|
+
key: "removeListeners",
|
|
23930
|
+
value: function removeListeners(player) {
|
|
23931
|
+
player.removeEventListener('canplay', this.onReady);
|
|
23932
|
+
player.removeEventListener('play', this.onPlay);
|
|
23933
|
+
player.removeEventListener('waiting', this.onBuffer);
|
|
23934
|
+
player.removeEventListener('playing', this.onBufferEnd);
|
|
23935
|
+
player.removeEventListener('pause', this.onPause);
|
|
23936
|
+
player.removeEventListener('seeked', this.onSeek);
|
|
23937
|
+
player.removeEventListener('ended', this.onEnded);
|
|
23938
|
+
player.removeEventListener('error', this.onError);
|
|
23939
|
+
player.removeEventListener('enterpictureinpicture', this.onEnablePIP);
|
|
23940
|
+
player.removeEventListener('leavepictureinpicture', this.onDisablePIP);
|
|
23941
|
+
player.removeEventListener('webkitpresentationmodechanged', this.onPresentationModeChange);
|
|
23942
|
+
} // Proxy methods to prevent listener leaks
|
|
23943
|
+
|
|
23944
|
+
}, {
|
|
23945
|
+
key: "shouldUseAudio",
|
|
23946
|
+
value: function shouldUseAudio(props) {
|
|
23947
|
+
if (props.config.file.forceVideo) {
|
|
23948
|
+
return false;
|
|
23949
|
+
}
|
|
23950
|
+
|
|
23951
|
+
if (props.config.file.attributes.poster) {
|
|
23952
|
+
return false; // Use <video> so that poster is shown
|
|
23953
|
+
}
|
|
23954
|
+
|
|
23955
|
+
return AUDIO_EXTENSIONS.test(props.url) || props.config.file.forceAudio;
|
|
23956
|
+
}
|
|
23957
|
+
}, {
|
|
23958
|
+
key: "shouldUseHLS",
|
|
23959
|
+
value: function shouldUseHLS(url) {
|
|
23960
|
+
return HLS_EXTENSIONS.test(url) && !IOS || this.props.config.file.forceHLS;
|
|
23961
|
+
}
|
|
23962
|
+
}, {
|
|
23963
|
+
key: "shouldUseDASH",
|
|
23964
|
+
value: function shouldUseDASH(url) {
|
|
23965
|
+
return DASH_EXTENSIONS.test(url) || this.props.config.file.forceDASH;
|
|
23966
|
+
}
|
|
23967
|
+
}, {
|
|
23968
|
+
key: "load",
|
|
23969
|
+
value: function load(url) {
|
|
23970
|
+
var _this2 = this;
|
|
23971
|
+
|
|
23972
|
+
var _this$props$config$fi = this.props.config.file,
|
|
23973
|
+
hlsVersion = _this$props$config$fi.hlsVersion,
|
|
23974
|
+
dashVersion = _this$props$config$fi.dashVersion;
|
|
23975
|
+
|
|
23976
|
+
if (this.shouldUseHLS(url)) {
|
|
23977
|
+
(0, utils$2.getSDK)(HLS_SDK_URL.replace('VERSION', hlsVersion), HLS_GLOBAL).then(function (Hls) {
|
|
23978
|
+
_this2.hls = new Hls(_this2.props.config.file.hlsOptions);
|
|
23979
|
+
|
|
23980
|
+
_this2.hls.on(Hls.Events.ERROR, function (e, data) {
|
|
23981
|
+
_this2.props.onError(e, data, _this2.hls, Hls);
|
|
23982
|
+
});
|
|
23983
|
+
|
|
23984
|
+
_this2.hls.loadSource(url);
|
|
23985
|
+
|
|
23986
|
+
_this2.hls.attachMedia(_this2.player);
|
|
23987
|
+
});
|
|
23988
|
+
}
|
|
23989
|
+
|
|
23990
|
+
if (this.shouldUseDASH(url)) {
|
|
23991
|
+
(0, utils$2.getSDK)(DASH_SDK_URL.replace('VERSION', dashVersion), DASH_GLOBAL).then(function (dashjs) {
|
|
23992
|
+
_this2.dash = dashjs.MediaPlayer().create();
|
|
23993
|
+
|
|
23994
|
+
_this2.dash.initialize(_this2.player, url, _this2.props.playing);
|
|
23995
|
+
|
|
23996
|
+
_this2.dash.on('error', _this2.props.onError);
|
|
23997
|
+
|
|
23998
|
+
_this2.dash.getDebug().setLogToBrowserConsole(false);
|
|
23999
|
+
});
|
|
24000
|
+
}
|
|
24001
|
+
|
|
24002
|
+
if (url instanceof Array) {
|
|
24003
|
+
// When setting new urls (<source>) on an already loaded video,
|
|
24004
|
+
// HTMLMediaElement.load() is needed to reset the media element
|
|
24005
|
+
// and restart the media resource. Just replacing children source
|
|
24006
|
+
// dom nodes is not enough
|
|
24007
|
+
this.player.load();
|
|
24008
|
+
} else if ((0, utils$2.isMediaStream)(url)) {
|
|
24009
|
+
try {
|
|
24010
|
+
this.player.srcObject = url;
|
|
24011
|
+
} catch (e) {
|
|
24012
|
+
this.player.src = window.URL.createObjectURL(url);
|
|
24013
|
+
}
|
|
24014
|
+
}
|
|
24015
|
+
}
|
|
24016
|
+
}, {
|
|
24017
|
+
key: "play",
|
|
24018
|
+
value: function play() {
|
|
24019
|
+
var promise = this.player.play();
|
|
24020
|
+
|
|
24021
|
+
if (promise) {
|
|
24022
|
+
promise["catch"](this.props.onError);
|
|
24023
|
+
}
|
|
24024
|
+
}
|
|
24025
|
+
}, {
|
|
24026
|
+
key: "pause",
|
|
24027
|
+
value: function pause() {
|
|
24028
|
+
this.player.pause();
|
|
24029
|
+
}
|
|
24030
|
+
}, {
|
|
24031
|
+
key: "stop",
|
|
24032
|
+
value: function stop() {
|
|
24033
|
+
this.player.removeAttribute('src');
|
|
24034
|
+
|
|
24035
|
+
if (this.hls) {
|
|
24036
|
+
this.hls.destroy();
|
|
24037
|
+
}
|
|
24038
|
+
|
|
24039
|
+
if (this.dash) {
|
|
24040
|
+
this.dash.reset();
|
|
24041
|
+
}
|
|
24042
|
+
}
|
|
24043
|
+
}, {
|
|
24044
|
+
key: "seekTo",
|
|
24045
|
+
value: function seekTo(seconds) {
|
|
24046
|
+
this.player.currentTime = seconds;
|
|
24047
|
+
}
|
|
24048
|
+
}, {
|
|
24049
|
+
key: "setVolume",
|
|
24050
|
+
value: function setVolume(fraction) {
|
|
24051
|
+
this.player.volume = fraction;
|
|
24052
|
+
}
|
|
24053
|
+
}, {
|
|
24054
|
+
key: "enablePIP",
|
|
24055
|
+
value: function enablePIP() {
|
|
24056
|
+
if (this.player.requestPictureInPicture && document.pictureInPictureElement !== this.player) {
|
|
24057
|
+
this.player.requestPictureInPicture();
|
|
24058
|
+
} else if (supportsWebKitPresentationMode(this.player) && this.player.webkitPresentationMode !== 'picture-in-picture') {
|
|
24059
|
+
this.player.webkitSetPresentationMode('picture-in-picture');
|
|
24060
|
+
}
|
|
24061
|
+
}
|
|
24062
|
+
}, {
|
|
24063
|
+
key: "disablePIP",
|
|
24064
|
+
value: function disablePIP() {
|
|
24065
|
+
if (document.exitPictureInPicture && document.pictureInPictureElement === this.player) {
|
|
24066
|
+
document.exitPictureInPicture();
|
|
24067
|
+
} else if (supportsWebKitPresentationMode(this.player) && this.player.webkitPresentationMode !== 'inline') {
|
|
24068
|
+
this.player.webkitSetPresentationMode('inline');
|
|
24069
|
+
}
|
|
24070
|
+
}
|
|
24071
|
+
}, {
|
|
24072
|
+
key: "setPlaybackRate",
|
|
24073
|
+
value: function setPlaybackRate(rate) {
|
|
24074
|
+
this.player.playbackRate = rate;
|
|
24075
|
+
}
|
|
24076
|
+
}, {
|
|
24077
|
+
key: "getDuration",
|
|
24078
|
+
value: function getDuration() {
|
|
24079
|
+
if (!this.player) return null;
|
|
24080
|
+
var _this$player = this.player,
|
|
24081
|
+
duration = _this$player.duration,
|
|
24082
|
+
seekable = _this$player.seekable; // on iOS, live streams return Infinity for the duration
|
|
24083
|
+
// so instead we use the end of the seekable timerange
|
|
24084
|
+
|
|
24085
|
+
if (duration === Infinity && seekable.length > 0) {
|
|
24086
|
+
return seekable.end(seekable.length - 1);
|
|
24087
|
+
}
|
|
24088
|
+
|
|
24089
|
+
return duration;
|
|
24090
|
+
}
|
|
24091
|
+
}, {
|
|
24092
|
+
key: "getCurrentTime",
|
|
24093
|
+
value: function getCurrentTime() {
|
|
24094
|
+
if (!this.player) return null;
|
|
24095
|
+
return this.player.currentTime;
|
|
24096
|
+
}
|
|
24097
|
+
}, {
|
|
24098
|
+
key: "getSecondsLoaded",
|
|
24099
|
+
value: function getSecondsLoaded() {
|
|
24100
|
+
if (!this.player) return null;
|
|
24101
|
+
var buffered = this.player.buffered;
|
|
24102
|
+
|
|
24103
|
+
if (buffered.length === 0) {
|
|
24104
|
+
return 0;
|
|
24105
|
+
}
|
|
24106
|
+
|
|
24107
|
+
var end = buffered.end(buffered.length - 1);
|
|
24108
|
+
var duration = this.getDuration();
|
|
24109
|
+
|
|
24110
|
+
if (end > duration) {
|
|
24111
|
+
return duration;
|
|
24112
|
+
}
|
|
24113
|
+
|
|
24114
|
+
return end;
|
|
24115
|
+
}
|
|
24116
|
+
}, {
|
|
24117
|
+
key: "getSource",
|
|
24118
|
+
value: function getSource(url) {
|
|
24119
|
+
var useHLS = this.shouldUseHLS(url);
|
|
24120
|
+
var useDASH = this.shouldUseDASH(url);
|
|
24121
|
+
|
|
24122
|
+
if (url instanceof Array || (0, utils$2.isMediaStream)(url) || useHLS || useDASH) {
|
|
24123
|
+
return undefined;
|
|
24124
|
+
}
|
|
24125
|
+
|
|
24126
|
+
if (MATCH_DROPBOX_URL.test(url)) {
|
|
24127
|
+
return url.replace('www.dropbox.com', 'dl.dropboxusercontent.com');
|
|
24128
|
+
}
|
|
24129
|
+
|
|
24130
|
+
return url;
|
|
24131
|
+
}
|
|
24132
|
+
}, {
|
|
24133
|
+
key: "render",
|
|
24134
|
+
value: function render() {
|
|
24135
|
+
var _this$props10 = this.props,
|
|
24136
|
+
url = _this$props10.url,
|
|
24137
|
+
playing = _this$props10.playing,
|
|
24138
|
+
loop = _this$props10.loop,
|
|
24139
|
+
controls = _this$props10.controls,
|
|
24140
|
+
muted = _this$props10.muted,
|
|
24141
|
+
config = _this$props10.config,
|
|
24142
|
+
width = _this$props10.width,
|
|
24143
|
+
height = _this$props10.height;
|
|
24144
|
+
var useAudio = this.shouldUseAudio(this.props);
|
|
24145
|
+
var Element = useAudio ? 'audio' : 'video';
|
|
24146
|
+
var style = {
|
|
24147
|
+
width: width === 'auto' ? width : '100%',
|
|
24148
|
+
height: height === 'auto' ? height : '100%'
|
|
24149
|
+
};
|
|
24150
|
+
return _react["default"].createElement(Element, _extends({
|
|
24151
|
+
ref: this.ref,
|
|
24152
|
+
src: this.getSource(url),
|
|
24153
|
+
style: style,
|
|
24154
|
+
preload: "auto",
|
|
24155
|
+
autoPlay: playing || undefined,
|
|
24156
|
+
controls: controls,
|
|
24157
|
+
muted: muted,
|
|
24158
|
+
loop: loop
|
|
24159
|
+
}, config.file.attributes), url instanceof Array && url.map(this.renderSourceElement), config.file.tracks.map(this.renderTrack));
|
|
24160
|
+
}
|
|
24161
|
+
}]);
|
|
24162
|
+
|
|
24163
|
+
return FilePlayer;
|
|
24164
|
+
}(_react.Component);
|
|
24165
|
+
|
|
24166
|
+
exports.FilePlayer = FilePlayer;
|
|
24167
|
+
|
|
24168
|
+
_defineProperty(FilePlayer, "displayName", 'FilePlayer');
|
|
24169
|
+
|
|
24170
|
+
_defineProperty(FilePlayer, "canPlay", canPlay);
|
|
24171
|
+
|
|
24172
|
+
_defineProperty(FilePlayer, "canEnablePIP", canEnablePIP);
|
|
24173
|
+
|
|
24174
|
+
var _default = (0, _singlePlayer["default"])(FilePlayer);
|
|
24175
|
+
|
|
24176
|
+
exports["default"] = _default;
|
|
24177
|
+
});
|
|
24178
|
+
|
|
24179
|
+
unwrapExports(FilePlayer_1);
|
|
24180
|
+
var FilePlayer_2 = FilePlayer_1.FilePlayer;
|
|
24181
|
+
|
|
24182
|
+
var players = createCommonjsModule(function (module, exports) {
|
|
24183
|
+
|
|
24184
|
+
Object.defineProperty(exports, "__esModule", {
|
|
24185
|
+
value: true
|
|
24186
|
+
});
|
|
24187
|
+
exports["default"] = void 0;
|
|
24188
|
+
|
|
24189
|
+
|
|
24190
|
+
|
|
24191
|
+
|
|
24192
|
+
|
|
24193
|
+
|
|
24194
|
+
|
|
24195
|
+
|
|
24196
|
+
|
|
24197
|
+
|
|
24198
|
+
|
|
24199
|
+
|
|
24200
|
+
|
|
24201
|
+
|
|
24202
|
+
|
|
24203
|
+
|
|
24204
|
+
|
|
24205
|
+
|
|
24206
|
+
|
|
24207
|
+
|
|
24208
|
+
|
|
24209
|
+
var _default = [YouTube_1.YouTube, SoundCloud_1.SoundCloud, Vimeo_1.Vimeo, Facebook_1.Facebook, Streamable_1.Streamable, Wistia_1.Wistia, Twitch_1.Twitch, DailyMotion_1.DailyMotion, Mixcloud_1.Mixcloud, FilePlayer_1.FilePlayer];
|
|
24210
|
+
exports["default"] = _default;
|
|
24211
|
+
});
|
|
24212
|
+
|
|
24213
|
+
unwrapExports(players);
|
|
24214
|
+
|
|
24215
|
+
var Preview_1 = createCommonjsModule(function (module, exports) {
|
|
24216
|
+
|
|
24217
|
+
Object.defineProperty(exports, "__esModule", {
|
|
24218
|
+
value: true
|
|
24219
|
+
});
|
|
24220
|
+
exports["default"] = void 0;
|
|
24221
|
+
|
|
24222
|
+
var _react = _interopRequireWildcard(React__default);
|
|
24223
|
+
|
|
24224
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
24225
|
+
|
|
24226
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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; }
|
|
24227
|
+
|
|
24228
|
+
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
|
24229
|
+
|
|
24230
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
24231
|
+
|
|
24232
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
24233
|
+
|
|
24234
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
24235
|
+
|
|
24236
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
24237
|
+
|
|
24238
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
24239
|
+
|
|
24240
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
24241
|
+
|
|
24242
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
24243
|
+
|
|
24244
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
24245
|
+
|
|
24246
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
24247
|
+
|
|
24248
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
24249
|
+
|
|
24250
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
24251
|
+
|
|
24252
|
+
var ICON_SIZE = '64px';
|
|
24253
|
+
|
|
24254
|
+
var Preview =
|
|
24255
|
+
/*#__PURE__*/
|
|
24256
|
+
function (_Component) {
|
|
24257
|
+
_inherits(Preview, _Component);
|
|
24258
|
+
|
|
24259
|
+
function Preview() {
|
|
24260
|
+
var _getPrototypeOf2;
|
|
24261
|
+
|
|
24262
|
+
var _this;
|
|
24263
|
+
|
|
24264
|
+
_classCallCheck(this, Preview);
|
|
24265
|
+
|
|
24266
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
24267
|
+
args[_key] = arguments[_key];
|
|
24268
|
+
}
|
|
24269
|
+
|
|
24270
|
+
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Preview)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
24271
|
+
|
|
24272
|
+
_defineProperty(_assertThisInitialized(_this), "mounted", false);
|
|
24273
|
+
|
|
24274
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
24275
|
+
image: null
|
|
24276
|
+
});
|
|
24277
|
+
|
|
24278
|
+
return _this;
|
|
24279
|
+
}
|
|
24280
|
+
|
|
24281
|
+
_createClass(Preview, [{
|
|
24282
|
+
key: "componentDidMount",
|
|
24283
|
+
value: function componentDidMount() {
|
|
24284
|
+
this.mounted = true;
|
|
24285
|
+
this.fetchImage(this.props);
|
|
24286
|
+
}
|
|
24287
|
+
}, {
|
|
24288
|
+
key: "componentDidUpdate",
|
|
24289
|
+
value: function componentDidUpdate(prevProps) {
|
|
24290
|
+
var _this$props = this.props,
|
|
24291
|
+
url = _this$props.url,
|
|
24292
|
+
light = _this$props.light;
|
|
24293
|
+
|
|
24294
|
+
if (prevProps.url !== url || prevProps.light !== light) {
|
|
24295
|
+
this.fetchImage(this.props);
|
|
24296
|
+
}
|
|
24297
|
+
}
|
|
24298
|
+
}, {
|
|
24299
|
+
key: "componentWillUnmount",
|
|
24300
|
+
value: function componentWillUnmount() {
|
|
24301
|
+
this.mounted = false;
|
|
24302
|
+
}
|
|
24303
|
+
}, {
|
|
24304
|
+
key: "fetchImage",
|
|
24305
|
+
value: function fetchImage(_ref) {
|
|
24306
|
+
var _this2 = this;
|
|
24307
|
+
|
|
24308
|
+
var url = _ref.url,
|
|
24309
|
+
light = _ref.light;
|
|
24310
|
+
|
|
24311
|
+
if (typeof light === 'string') {
|
|
24312
|
+
this.setState({
|
|
24313
|
+
image: light
|
|
24314
|
+
});
|
|
24315
|
+
return;
|
|
24316
|
+
}
|
|
24317
|
+
|
|
24318
|
+
this.setState({
|
|
24319
|
+
image: null
|
|
24320
|
+
});
|
|
24321
|
+
return window.fetch("https://noembed.com/embed?url=".concat(url)).then(function (response) {
|
|
24322
|
+
return response.json();
|
|
24323
|
+
}).then(function (data) {
|
|
24324
|
+
if (data.thumbnail_url && _this2.mounted) {
|
|
24325
|
+
var image = data.thumbnail_url.replace('height=100', 'height=480');
|
|
24326
|
+
|
|
24327
|
+
_this2.setState({
|
|
24328
|
+
image: image
|
|
24329
|
+
});
|
|
24330
|
+
}
|
|
24331
|
+
});
|
|
24332
|
+
}
|
|
24333
|
+
}, {
|
|
24334
|
+
key: "render",
|
|
24335
|
+
value: function render() {
|
|
24336
|
+
var _this$props2 = this.props,
|
|
24337
|
+
onClick = _this$props2.onClick,
|
|
24338
|
+
playIcon = _this$props2.playIcon;
|
|
24339
|
+
var image = this.state.image;
|
|
24340
|
+
var flexCenter = {
|
|
24341
|
+
display: 'flex',
|
|
24342
|
+
alignItems: 'center',
|
|
24343
|
+
justifyContent: 'center'
|
|
24344
|
+
};
|
|
24345
|
+
var styles = {
|
|
24346
|
+
preview: _objectSpread({
|
|
24347
|
+
width: '100%',
|
|
24348
|
+
height: '100%',
|
|
24349
|
+
backgroundImage: image ? "url(".concat(image, ")") : undefined,
|
|
24350
|
+
backgroundSize: 'cover',
|
|
24351
|
+
backgroundPosition: 'center',
|
|
24352
|
+
cursor: 'pointer'
|
|
24353
|
+
}, flexCenter),
|
|
24354
|
+
shadow: _objectSpread({
|
|
24355
|
+
background: 'radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)',
|
|
24356
|
+
borderRadius: ICON_SIZE,
|
|
24357
|
+
width: ICON_SIZE,
|
|
24358
|
+
height: ICON_SIZE
|
|
24359
|
+
}, flexCenter),
|
|
24360
|
+
playIcon: {
|
|
24361
|
+
borderStyle: 'solid',
|
|
24362
|
+
borderWidth: '16px 0 16px 26px',
|
|
24363
|
+
borderColor: 'transparent transparent transparent white',
|
|
24364
|
+
marginLeft: '7px'
|
|
24365
|
+
}
|
|
24366
|
+
};
|
|
24367
|
+
|
|
24368
|
+
var defaultPlayIcon = _react["default"].createElement("div", {
|
|
24369
|
+
style: styles.shadow,
|
|
24370
|
+
className: "react-player__shadow"
|
|
24371
|
+
}, _react["default"].createElement("div", {
|
|
24372
|
+
style: styles.playIcon,
|
|
24373
|
+
className: "react-player__play-icon"
|
|
24374
|
+
}));
|
|
24375
|
+
|
|
24376
|
+
return _react["default"].createElement("div", {
|
|
24377
|
+
style: styles.preview,
|
|
24378
|
+
className: "react-player__preview",
|
|
24379
|
+
onClick: onClick
|
|
24380
|
+
}, playIcon || defaultPlayIcon);
|
|
24381
|
+
}
|
|
24382
|
+
}]);
|
|
24383
|
+
|
|
24384
|
+
return Preview;
|
|
24385
|
+
}(_react.Component);
|
|
24386
|
+
|
|
24387
|
+
exports["default"] = Preview;
|
|
24388
|
+
});
|
|
24389
|
+
|
|
24390
|
+
unwrapExports(Preview_1);
|
|
24391
|
+
|
|
24392
|
+
var preload = createCommonjsModule(function (module, exports) {
|
|
24393
|
+
|
|
24394
|
+
Object.defineProperty(exports, "__esModule", {
|
|
24395
|
+
value: true
|
|
24396
|
+
});
|
|
24397
|
+
exports["default"] = renderPreloadPlayers;
|
|
24398
|
+
|
|
24399
|
+
var _react = _interopRequireDefault(React__default);
|
|
24400
|
+
|
|
24401
|
+
var _Player = _interopRequireDefault(Player_1);
|
|
24402
|
+
|
|
24403
|
+
|
|
24404
|
+
|
|
24405
|
+
|
|
24406
|
+
|
|
24407
|
+
|
|
24408
|
+
|
|
24409
|
+
|
|
24410
|
+
|
|
24411
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
24412
|
+
|
|
24413
|
+
var PRELOAD_PLAYERS = [{
|
|
24414
|
+
Player: YouTube_1.YouTube,
|
|
24415
|
+
configKey: 'youtube',
|
|
24416
|
+
url: 'https://www.youtube.com/watch?v=GlCmAC4MHek'
|
|
24417
|
+
}, {
|
|
24418
|
+
Player: SoundCloud_1.SoundCloud,
|
|
24419
|
+
configKey: 'soundcloud',
|
|
24420
|
+
url: 'https://soundcloud.com/seucheu/john-cage-433-8-bit-version'
|
|
24421
|
+
}, {
|
|
24422
|
+
Player: Vimeo_1.Vimeo,
|
|
24423
|
+
configKey: 'vimeo',
|
|
24424
|
+
url: 'https://vimeo.com/300970506'
|
|
24425
|
+
}, {
|
|
24426
|
+
Player: DailyMotion_1.DailyMotion,
|
|
24427
|
+
configKey: 'dailymotion',
|
|
24428
|
+
url: 'http://www.dailymotion.com/video/xqdpyk'
|
|
24429
|
+
}];
|
|
24430
|
+
|
|
24431
|
+
function renderPreloadPlayers(url, controls, config) {
|
|
24432
|
+
var players = [];
|
|
24433
|
+
var _iteratorNormalCompletion = true;
|
|
24434
|
+
var _didIteratorError = false;
|
|
24435
|
+
var _iteratorError = undefined;
|
|
24436
|
+
|
|
24437
|
+
try {
|
|
24438
|
+
for (var _iterator = PRELOAD_PLAYERS[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
24439
|
+
var player = _step.value;
|
|
24440
|
+
|
|
24441
|
+
if (!player.Player.canPlay(url) && config[player.configKey].preload) {
|
|
24442
|
+
players.push(_react["default"].createElement(_Player["default"], {
|
|
24443
|
+
key: player.Player.displayName,
|
|
24444
|
+
activePlayer: player.Player,
|
|
24445
|
+
url: player.url,
|
|
24446
|
+
controls: controls,
|
|
24447
|
+
playing: true,
|
|
24448
|
+
muted: true,
|
|
24449
|
+
display: "none"
|
|
24450
|
+
}));
|
|
24451
|
+
}
|
|
24452
|
+
}
|
|
24453
|
+
} catch (err) {
|
|
24454
|
+
_didIteratorError = true;
|
|
24455
|
+
_iteratorError = err;
|
|
24456
|
+
} finally {
|
|
24457
|
+
try {
|
|
24458
|
+
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
|
|
24459
|
+
_iterator["return"]();
|
|
24460
|
+
}
|
|
24461
|
+
} finally {
|
|
24462
|
+
if (_didIteratorError) {
|
|
24463
|
+
throw _iteratorError;
|
|
24464
|
+
}
|
|
24465
|
+
}
|
|
24466
|
+
}
|
|
24467
|
+
|
|
24468
|
+
return players;
|
|
24469
|
+
}
|
|
24470
|
+
});
|
|
24471
|
+
|
|
24472
|
+
unwrapExports(preload);
|
|
24473
|
+
|
|
24474
|
+
var ReactPlayer_1 = createCommonjsModule(function (module, exports) {
|
|
24475
|
+
|
|
24476
|
+
Object.defineProperty(exports, "__esModule", {
|
|
24477
|
+
value: true
|
|
24478
|
+
});
|
|
24479
|
+
Object.defineProperty(exports, "FilePlayer", {
|
|
24480
|
+
enumerable: true,
|
|
24481
|
+
get: function get() {
|
|
24482
|
+
return _FilePlayer["default"];
|
|
24483
|
+
}
|
|
24484
|
+
});
|
|
24485
|
+
Object.defineProperty(exports, "YouTube", {
|
|
24486
|
+
enumerable: true,
|
|
24487
|
+
get: function get() {
|
|
24488
|
+
return _YouTube["default"];
|
|
24489
|
+
}
|
|
24490
|
+
});
|
|
24491
|
+
Object.defineProperty(exports, "SoundCloud", {
|
|
24492
|
+
enumerable: true,
|
|
24493
|
+
get: function get() {
|
|
24494
|
+
return _SoundCloud["default"];
|
|
24495
|
+
}
|
|
24496
|
+
});
|
|
24497
|
+
Object.defineProperty(exports, "Vimeo", {
|
|
24498
|
+
enumerable: true,
|
|
24499
|
+
get: function get() {
|
|
24500
|
+
return _Vimeo["default"];
|
|
24501
|
+
}
|
|
24502
|
+
});
|
|
24503
|
+
Object.defineProperty(exports, "Facebook", {
|
|
24504
|
+
enumerable: true,
|
|
24505
|
+
get: function get() {
|
|
24506
|
+
return _Facebook["default"];
|
|
24507
|
+
}
|
|
24508
|
+
});
|
|
24509
|
+
Object.defineProperty(exports, "Streamable", {
|
|
24510
|
+
enumerable: true,
|
|
24511
|
+
get: function get() {
|
|
24512
|
+
return _Streamable["default"];
|
|
24513
|
+
}
|
|
24514
|
+
});
|
|
24515
|
+
Object.defineProperty(exports, "Wistia", {
|
|
24516
|
+
enumerable: true,
|
|
24517
|
+
get: function get() {
|
|
24518
|
+
return _Wistia["default"];
|
|
24519
|
+
}
|
|
24520
|
+
});
|
|
24521
|
+
Object.defineProperty(exports, "Twitch", {
|
|
24522
|
+
enumerable: true,
|
|
24523
|
+
get: function get() {
|
|
24524
|
+
return _Twitch["default"];
|
|
24525
|
+
}
|
|
24526
|
+
});
|
|
24527
|
+
Object.defineProperty(exports, "DailyMotion", {
|
|
24528
|
+
enumerable: true,
|
|
24529
|
+
get: function get() {
|
|
24530
|
+
return _DailyMotion["default"];
|
|
24531
|
+
}
|
|
24532
|
+
});
|
|
24533
|
+
Object.defineProperty(exports, "Mixcloud", {
|
|
24534
|
+
enumerable: true,
|
|
24535
|
+
get: function get() {
|
|
24536
|
+
return _Mixcloud["default"];
|
|
24537
|
+
}
|
|
24538
|
+
});
|
|
24539
|
+
exports["default"] = void 0;
|
|
24540
|
+
|
|
24541
|
+
var _react = _interopRequireWildcard(React__default);
|
|
24542
|
+
|
|
24543
|
+
|
|
24544
|
+
|
|
24545
|
+
|
|
24546
|
+
|
|
24547
|
+
var _players = _interopRequireDefault(players);
|
|
24548
|
+
|
|
24549
|
+
var _Player4 = _interopRequireDefault(Player_1);
|
|
24550
|
+
|
|
24551
|
+
var _Preview = _interopRequireDefault(Preview_1);
|
|
24552
|
+
|
|
24553
|
+
var _FilePlayer = _interopRequireWildcard(FilePlayer_1);
|
|
24554
|
+
|
|
24555
|
+
var _preload = _interopRequireDefault(preload);
|
|
24556
|
+
|
|
24557
|
+
var _YouTube = _interopRequireDefault(YouTube_1);
|
|
24558
|
+
|
|
24559
|
+
var _SoundCloud = _interopRequireDefault(SoundCloud_1);
|
|
24560
|
+
|
|
24561
|
+
var _Vimeo = _interopRequireDefault(Vimeo_1);
|
|
24562
|
+
|
|
24563
|
+
var _Facebook = _interopRequireDefault(Facebook_1);
|
|
24564
|
+
|
|
24565
|
+
var _Streamable = _interopRequireDefault(Streamable_1);
|
|
24566
|
+
|
|
24567
|
+
var _Wistia = _interopRequireDefault(Wistia_1);
|
|
24568
|
+
|
|
24569
|
+
var _Twitch = _interopRequireDefault(Twitch_1);
|
|
24570
|
+
|
|
24571
|
+
var _DailyMotion = _interopRequireDefault(DailyMotion_1);
|
|
24572
|
+
|
|
24573
|
+
var _Mixcloud = _interopRequireDefault(Mixcloud_1);
|
|
24574
|
+
|
|
24575
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
24576
|
+
|
|
24577
|
+
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
24578
|
+
|
|
24579
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; 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; }
|
|
24580
|
+
|
|
24581
|
+
function _typeof(obj) { "@babel/helpers - typeof"; 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); }
|
|
24582
|
+
|
|
24583
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
24584
|
+
|
|
24585
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
24586
|
+
|
|
24587
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
24588
|
+
|
|
24589
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
|
24590
|
+
|
|
24591
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
|
24592
|
+
|
|
24593
|
+
function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
|
24594
|
+
|
|
24595
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
|
24596
|
+
|
|
24597
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
24598
|
+
|
|
24599
|
+
function _defineProperties(target, props$$1) { for (var i = 0; i < props$$1.length; i++) { var descriptor = props$$1[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
24600
|
+
|
|
24601
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
24602
|
+
|
|
24603
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
24604
|
+
|
|
24605
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
24606
|
+
|
|
24607
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
24608
|
+
|
|
24609
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
24610
|
+
|
|
24611
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
24612
|
+
|
|
24613
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
24614
|
+
|
|
24615
|
+
var SUPPORTED_PROPS = Object.keys(props.propTypes);
|
|
24616
|
+
var customPlayers = [];
|
|
24617
|
+
|
|
24618
|
+
var ReactPlayer =
|
|
24619
|
+
/*#__PURE__*/
|
|
24620
|
+
function (_Component) {
|
|
24621
|
+
_inherits(ReactPlayer, _Component);
|
|
24622
|
+
|
|
24623
|
+
function ReactPlayer() {
|
|
24624
|
+
var _getPrototypeOf2;
|
|
24625
|
+
|
|
24626
|
+
var _this;
|
|
24627
|
+
|
|
24628
|
+
_classCallCheck(this, ReactPlayer);
|
|
24629
|
+
|
|
24630
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
24631
|
+
args[_key] = arguments[_key];
|
|
24632
|
+
}
|
|
24633
|
+
|
|
24634
|
+
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(ReactPlayer)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
|
24635
|
+
|
|
24636
|
+
_defineProperty(_assertThisInitialized(_this), "config", (0, utils$2.getConfig)(_this.props, props.defaultProps, true));
|
|
24637
|
+
|
|
24638
|
+
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
24639
|
+
showPreview: !!_this.props.light
|
|
24640
|
+
});
|
|
24641
|
+
|
|
24642
|
+
_defineProperty(_assertThisInitialized(_this), "handleClickPreview", function () {
|
|
24643
|
+
_this.setState({
|
|
24644
|
+
showPreview: false
|
|
24645
|
+
});
|
|
24646
|
+
});
|
|
24647
|
+
|
|
24648
|
+
_defineProperty(_assertThisInitialized(_this), "showPreview", function () {
|
|
24649
|
+
_this.setState({
|
|
24650
|
+
showPreview: true
|
|
24651
|
+
});
|
|
24652
|
+
});
|
|
24653
|
+
|
|
24654
|
+
_defineProperty(_assertThisInitialized(_this), "getDuration", function () {
|
|
24655
|
+
if (!_this.player) return null;
|
|
24656
|
+
return _this.player.getDuration();
|
|
24657
|
+
});
|
|
24658
|
+
|
|
24659
|
+
_defineProperty(_assertThisInitialized(_this), "getCurrentTime", function () {
|
|
24660
|
+
if (!_this.player) return null;
|
|
24661
|
+
return _this.player.getCurrentTime();
|
|
24662
|
+
});
|
|
24663
|
+
|
|
24664
|
+
_defineProperty(_assertThisInitialized(_this), "getSecondsLoaded", function () {
|
|
24665
|
+
if (!_this.player) return null;
|
|
24666
|
+
return _this.player.getSecondsLoaded();
|
|
24667
|
+
});
|
|
24668
|
+
|
|
24669
|
+
_defineProperty(_assertThisInitialized(_this), "getInternalPlayer", function () {
|
|
24670
|
+
var key = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'player';
|
|
24671
|
+
if (!_this.player) return null;
|
|
24672
|
+
return _this.player.getInternalPlayer(key);
|
|
24673
|
+
});
|
|
24674
|
+
|
|
24675
|
+
_defineProperty(_assertThisInitialized(_this), "seekTo", function (fraction, type) {
|
|
24676
|
+
if (!_this.player) return null;
|
|
24677
|
+
|
|
24678
|
+
_this.player.seekTo(fraction, type);
|
|
24679
|
+
});
|
|
24680
|
+
|
|
24681
|
+
_defineProperty(_assertThisInitialized(_this), "handleReady", function () {
|
|
24682
|
+
_this.props.onReady(_assertThisInitialized(_this));
|
|
24683
|
+
});
|
|
24684
|
+
|
|
24685
|
+
_defineProperty(_assertThisInitialized(_this), "wrapperRef", function (wrapper) {
|
|
24686
|
+
_this.wrapper = wrapper;
|
|
24687
|
+
});
|
|
24688
|
+
|
|
24689
|
+
_defineProperty(_assertThisInitialized(_this), "activePlayerRef", function (player) {
|
|
24690
|
+
_this.player = player;
|
|
24691
|
+
});
|
|
24692
|
+
|
|
24693
|
+
return _this;
|
|
24694
|
+
}
|
|
24695
|
+
|
|
24696
|
+
_createClass(ReactPlayer, [{
|
|
24697
|
+
key: "componentDidMount",
|
|
24698
|
+
value: function componentDidMount() {
|
|
24699
|
+
if (this.props.progressFrequency) {
|
|
24700
|
+
var message = 'ReactPlayer: %cprogressFrequency%c is deprecated, please use %cprogressInterval%c instead';
|
|
24701
|
+
console.warn(message, 'font-weight: bold', '', 'font-weight: bold', '');
|
|
24702
|
+
}
|
|
24703
|
+
}
|
|
24704
|
+
}, {
|
|
24705
|
+
key: "shouldComponentUpdate",
|
|
24706
|
+
value: function shouldComponentUpdate(nextProps, nextState) {
|
|
24707
|
+
return !(0, utils$2.isEqual)(this.props, nextProps) || !(0, utils$2.isEqual)(this.state, nextState);
|
|
24708
|
+
}
|
|
24709
|
+
}, {
|
|
24710
|
+
key: "componentDidUpdate",
|
|
24711
|
+
value: function componentDidUpdate(prevProps) {
|
|
24712
|
+
var light = this.props.light;
|
|
24713
|
+
this.config = (0, utils$2.getConfig)(this.props, props.defaultProps);
|
|
24714
|
+
|
|
24715
|
+
if (!prevProps.light && light) {
|
|
24716
|
+
this.setState({
|
|
24717
|
+
showPreview: true
|
|
24718
|
+
});
|
|
24719
|
+
}
|
|
24720
|
+
|
|
24721
|
+
if (prevProps.light && !light) {
|
|
24722
|
+
this.setState({
|
|
24723
|
+
showPreview: false
|
|
24724
|
+
});
|
|
24725
|
+
}
|
|
24726
|
+
}
|
|
24727
|
+
}, {
|
|
24728
|
+
key: "getActivePlayer",
|
|
24729
|
+
value: function getActivePlayer(url) {
|
|
24730
|
+
for (var _i = 0, _arr = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players["default"])); _i < _arr.length; _i++) {
|
|
24731
|
+
var _Player = _arr[_i];
|
|
24732
|
+
|
|
24733
|
+
if (_Player.canPlay(url)) {
|
|
24734
|
+
return _Player;
|
|
24735
|
+
}
|
|
24736
|
+
} // Fall back to FilePlayer if nothing else can play the URL
|
|
24737
|
+
|
|
24738
|
+
|
|
24739
|
+
return _FilePlayer.FilePlayer;
|
|
24740
|
+
}
|
|
24741
|
+
}, {
|
|
24742
|
+
key: "renderActivePlayer",
|
|
24743
|
+
value: function renderActivePlayer(url, activePlayer) {
|
|
24744
|
+
if (!url) return null;
|
|
24745
|
+
return _react["default"].createElement(_Player4["default"], _extends({}, this.props, {
|
|
24746
|
+
key: activePlayer.displayName,
|
|
24747
|
+
ref: this.activePlayerRef,
|
|
24748
|
+
config: this.config,
|
|
24749
|
+
activePlayer: activePlayer,
|
|
24750
|
+
onReady: this.handleReady
|
|
24751
|
+
}));
|
|
24752
|
+
}
|
|
24753
|
+
}, {
|
|
24754
|
+
key: "sortPlayers",
|
|
24755
|
+
value: function sortPlayers(a, b) {
|
|
24756
|
+
// Retain player order to prevent weird iframe behaviour when switching players
|
|
24757
|
+
if (a && b) {
|
|
24758
|
+
return a.key < b.key ? -1 : 1;
|
|
24759
|
+
}
|
|
24760
|
+
|
|
24761
|
+
return 0;
|
|
24762
|
+
}
|
|
24763
|
+
}, {
|
|
24764
|
+
key: "render",
|
|
24765
|
+
value: function render() {
|
|
24766
|
+
var _this$props = this.props,
|
|
24767
|
+
url = _this$props.url,
|
|
24768
|
+
controls = _this$props.controls,
|
|
24769
|
+
style = _this$props.style,
|
|
24770
|
+
width = _this$props.width,
|
|
24771
|
+
height = _this$props.height,
|
|
24772
|
+
light = _this$props.light,
|
|
24773
|
+
playIcon = _this$props.playIcon,
|
|
24774
|
+
Wrapper = _this$props.wrapper;
|
|
24775
|
+
var showPreview = this.state.showPreview && url;
|
|
24776
|
+
var otherProps = (0, utils$2.omit)(this.props, SUPPORTED_PROPS, props.DEPRECATED_CONFIG_PROPS);
|
|
24777
|
+
var activePlayer = this.getActivePlayer(url);
|
|
24778
|
+
var renderedActivePlayer = this.renderActivePlayer(url, activePlayer);
|
|
24779
|
+
var preloadPlayers = (0, _preload["default"])(url, controls, this.config);
|
|
24780
|
+
var players$$1 = [renderedActivePlayer].concat(_toConsumableArray(preloadPlayers)).sort(this.sortPlayers);
|
|
24781
|
+
|
|
24782
|
+
var preview = _react["default"].createElement(_Preview["default"], {
|
|
24783
|
+
url: url,
|
|
24784
|
+
light: light,
|
|
24785
|
+
playIcon: playIcon,
|
|
24786
|
+
onClick: this.handleClickPreview
|
|
24787
|
+
});
|
|
24788
|
+
|
|
24789
|
+
return _react["default"].createElement(Wrapper, _extends({
|
|
24790
|
+
ref: this.wrapperRef,
|
|
24791
|
+
style: _objectSpread({}, style, {
|
|
24792
|
+
width: width,
|
|
24793
|
+
height: height
|
|
24794
|
+
})
|
|
24795
|
+
}, otherProps), showPreview ? preview : players$$1);
|
|
24796
|
+
}
|
|
24797
|
+
}]);
|
|
24798
|
+
|
|
24799
|
+
return ReactPlayer;
|
|
24800
|
+
}(_react.Component);
|
|
24801
|
+
|
|
24802
|
+
exports["default"] = ReactPlayer;
|
|
24803
|
+
|
|
24804
|
+
_defineProperty(ReactPlayer, "addCustomPlayer", function (player) {
|
|
24805
|
+
customPlayers.push(player);
|
|
24806
|
+
});
|
|
24807
|
+
|
|
24808
|
+
_defineProperty(ReactPlayer, "removeCustomPlayers", function () {
|
|
24809
|
+
customPlayers = [];
|
|
24810
|
+
});
|
|
24811
|
+
|
|
24812
|
+
_defineProperty(ReactPlayer, "displayName", 'ReactPlayer');
|
|
24813
|
+
|
|
24814
|
+
_defineProperty(ReactPlayer, "propTypes", props.propTypes);
|
|
24815
|
+
|
|
24816
|
+
_defineProperty(ReactPlayer, "defaultProps", props.defaultProps);
|
|
24817
|
+
|
|
24818
|
+
_defineProperty(ReactPlayer, "canPlay", function (url) {
|
|
24819
|
+
for (var _i2 = 0, _arr2 = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players["default"])); _i2 < _arr2.length; _i2++) {
|
|
24820
|
+
var _Player2 = _arr2[_i2];
|
|
24821
|
+
|
|
24822
|
+
if (_Player2.canPlay(url)) {
|
|
24823
|
+
return true;
|
|
24824
|
+
}
|
|
24825
|
+
}
|
|
24826
|
+
|
|
24827
|
+
return false;
|
|
24828
|
+
});
|
|
24829
|
+
|
|
24830
|
+
_defineProperty(ReactPlayer, "canEnablePIP", function (url) {
|
|
24831
|
+
for (var _i3 = 0, _arr3 = [].concat(_toConsumableArray(customPlayers), _toConsumableArray(_players["default"])); _i3 < _arr3.length; _i3++) {
|
|
24832
|
+
var _Player3 = _arr3[_i3];
|
|
24833
|
+
|
|
24834
|
+
if (_Player3.canEnablePIP && _Player3.canEnablePIP(url)) {
|
|
24835
|
+
return true;
|
|
24836
|
+
}
|
|
24837
|
+
}
|
|
24838
|
+
|
|
24839
|
+
return false;
|
|
24840
|
+
});
|
|
24841
|
+
});
|
|
24842
|
+
|
|
24843
|
+
var ReactPlayer = unwrapExports(ReactPlayer_1);
|
|
24844
|
+
|
|
20371
24845
|
var Audio = function Audio(_ref) {
|
|
20372
24846
|
var node = _ref.node;
|
|
20373
24847
|
|
|
@@ -20774,9 +25248,289 @@ var Leads = function Leads(_ref) {
|
|
|
20774
25248
|
);
|
|
20775
25249
|
};
|
|
20776
25250
|
|
|
25251
|
+
var html_map = {
|
|
25252
|
+
"'": "'",
|
|
25253
|
+
"<": "<",
|
|
25254
|
+
">": ">",
|
|
25255
|
+
" ": " ",
|
|
25256
|
+
"¡": "¡",
|
|
25257
|
+
"¢": "¢",
|
|
25258
|
+
"£": "£",
|
|
25259
|
+
"¤": "¤",
|
|
25260
|
+
"¥": "¥",
|
|
25261
|
+
"¦": "¦",
|
|
25262
|
+
"§": "§",
|
|
25263
|
+
"¨": "¨",
|
|
25264
|
+
"©": "©",
|
|
25265
|
+
"ª": "ª",
|
|
25266
|
+
"«": "«",
|
|
25267
|
+
"¬": "¬",
|
|
25268
|
+
"®": "®",
|
|
25269
|
+
"¯": "¯",
|
|
25270
|
+
"°": "°",
|
|
25271
|
+
"±": "±",
|
|
25272
|
+
"²": "²",
|
|
25273
|
+
"³": "³",
|
|
25274
|
+
"´": "´",
|
|
25275
|
+
"µ": "µ",
|
|
25276
|
+
"¶": "¶",
|
|
25277
|
+
"·": "·",
|
|
25278
|
+
"¸": "¸",
|
|
25279
|
+
"¹": "¹",
|
|
25280
|
+
"º": "º",
|
|
25281
|
+
"»": "»",
|
|
25282
|
+
"¼": "¼",
|
|
25283
|
+
"½": "½",
|
|
25284
|
+
"¾": "¾",
|
|
25285
|
+
"¿": "¿",
|
|
25286
|
+
"À": "À",
|
|
25287
|
+
"Á": "Á",
|
|
25288
|
+
"Â": "Â",
|
|
25289
|
+
"Ã": "Ã",
|
|
25290
|
+
"Ä": "Ä",
|
|
25291
|
+
"Å": "Å",
|
|
25292
|
+
"Æ": "Æ",
|
|
25293
|
+
"Ç": "Ç",
|
|
25294
|
+
"È": "È",
|
|
25295
|
+
"É": "É",
|
|
25296
|
+
"Ê": "Ê",
|
|
25297
|
+
"Ë": "Ë",
|
|
25298
|
+
"Ì": "Ì",
|
|
25299
|
+
"Í": "Í",
|
|
25300
|
+
"Î": "Î",
|
|
25301
|
+
"Ï": "Ï",
|
|
25302
|
+
"Ð": "Ð",
|
|
25303
|
+
"Ñ": "Ñ",
|
|
25304
|
+
"Ò": "Ò",
|
|
25305
|
+
"Ó": "Ó",
|
|
25306
|
+
"Ô": "Ô",
|
|
25307
|
+
"Õ": "Õ",
|
|
25308
|
+
"Ö": "Ö",
|
|
25309
|
+
"×": "×",
|
|
25310
|
+
"Ø": "Ø",
|
|
25311
|
+
"Ù": "Ù",
|
|
25312
|
+
"Ú": "Ú",
|
|
25313
|
+
"Û": "Û",
|
|
25314
|
+
"Ü": "Ü",
|
|
25315
|
+
"Ý": "Ý",
|
|
25316
|
+
"Þ": "Þ",
|
|
25317
|
+
"ß": "ß",
|
|
25318
|
+
"à": "à",
|
|
25319
|
+
"á": "á",
|
|
25320
|
+
"â": "â",
|
|
25321
|
+
"ã": "ã",
|
|
25322
|
+
"ä": "ä",
|
|
25323
|
+
"å": "å",
|
|
25324
|
+
"æ": "æ",
|
|
25325
|
+
"ç": "ç",
|
|
25326
|
+
"è": "è",
|
|
25327
|
+
"é": "é",
|
|
25328
|
+
"ê": "ê",
|
|
25329
|
+
"ë": "ë",
|
|
25330
|
+
"ì": "ì",
|
|
25331
|
+
"í": "í",
|
|
25332
|
+
"î": "î",
|
|
25333
|
+
"ï": "ï",
|
|
25334
|
+
"ð": "ð",
|
|
25335
|
+
"ñ": "ñ",
|
|
25336
|
+
"ò": "ò",
|
|
25337
|
+
"ó": "ó",
|
|
25338
|
+
"ô": "ô",
|
|
25339
|
+
"õ": "õ",
|
|
25340
|
+
"ö": "ö",
|
|
25341
|
+
"÷": "÷",
|
|
25342
|
+
"ø": "ø",
|
|
25343
|
+
"ù": "ù",
|
|
25344
|
+
"ú": "ú",
|
|
25345
|
+
"û": "û",
|
|
25346
|
+
"ü": "ü",
|
|
25347
|
+
"ý": "ý",
|
|
25348
|
+
"þ": "þ",
|
|
25349
|
+
"ÿ": "ÿ",
|
|
25350
|
+
"Œ": "Œ",
|
|
25351
|
+
"œ": "œ",
|
|
25352
|
+
"Š": "Š",
|
|
25353
|
+
"š": "š",
|
|
25354
|
+
"Ÿ": "Ÿ",
|
|
25355
|
+
"ƒ": "ƒ",
|
|
25356
|
+
"ˆ": "ˆ",
|
|
25357
|
+
"˜": "˜",
|
|
25358
|
+
"Α": "Α",
|
|
25359
|
+
"Β": "Β",
|
|
25360
|
+
"Γ": "Γ",
|
|
25361
|
+
"Δ": "Δ",
|
|
25362
|
+
"Ε": "Ε",
|
|
25363
|
+
"Ζ": "Ζ",
|
|
25364
|
+
"Η": "Η",
|
|
25365
|
+
"Θ": "Θ",
|
|
25366
|
+
"Ι": "Ι",
|
|
25367
|
+
"Κ": "Κ",
|
|
25368
|
+
"Λ": "Λ",
|
|
25369
|
+
"Μ": "Μ",
|
|
25370
|
+
"Ν": "Ν",
|
|
25371
|
+
"Ξ": "Ξ",
|
|
25372
|
+
"Ο": "Ο",
|
|
25373
|
+
"Π": "Π",
|
|
25374
|
+
"Ρ": "Ρ",
|
|
25375
|
+
"Σ": "Σ",
|
|
25376
|
+
"Τ": "Τ",
|
|
25377
|
+
"Υ": "Υ",
|
|
25378
|
+
"Φ": "Φ",
|
|
25379
|
+
"Χ": "Χ",
|
|
25380
|
+
"Ψ": "Ψ",
|
|
25381
|
+
"Ω": "Ω",
|
|
25382
|
+
"α": "α",
|
|
25383
|
+
"β": "β",
|
|
25384
|
+
"γ": "γ",
|
|
25385
|
+
"δ": "δ",
|
|
25386
|
+
"ε": "ε",
|
|
25387
|
+
"ζ": "ζ",
|
|
25388
|
+
"η": "η",
|
|
25389
|
+
"θ": "θ",
|
|
25390
|
+
"ι": "ι",
|
|
25391
|
+
"κ": "κ",
|
|
25392
|
+
"λ": "λ",
|
|
25393
|
+
"μ": "μ",
|
|
25394
|
+
"ν": "ν",
|
|
25395
|
+
"ξ": "ξ",
|
|
25396
|
+
"ο": "ο",
|
|
25397
|
+
"π": "π",
|
|
25398
|
+
"ρ": "ρ",
|
|
25399
|
+
"ς": "ς",
|
|
25400
|
+
"σ": "σ",
|
|
25401
|
+
"τ": "τ",
|
|
25402
|
+
"υ": "υ",
|
|
25403
|
+
"φ": "φ",
|
|
25404
|
+
"χ": "χ",
|
|
25405
|
+
"ψ": "ψ",
|
|
25406
|
+
"ω": "ω",
|
|
25407
|
+
"ϑ": "ϑ",
|
|
25408
|
+
"ϒ": "&Upsih;",
|
|
25409
|
+
"ϖ": "ϖ",
|
|
25410
|
+
"–": "–",
|
|
25411
|
+
"—": "—",
|
|
25412
|
+
"‘": "‘",
|
|
25413
|
+
"’": "’",
|
|
25414
|
+
"‚": "‚",
|
|
25415
|
+
"“": "“",
|
|
25416
|
+
"”": "”",
|
|
25417
|
+
"„": "„",
|
|
25418
|
+
"†": "†",
|
|
25419
|
+
"‡": "‡",
|
|
25420
|
+
"•": "•",
|
|
25421
|
+
"…": "…",
|
|
25422
|
+
"‰": "‰",
|
|
25423
|
+
"′": "′",
|
|
25424
|
+
"″": "″",
|
|
25425
|
+
"‹": "‹",
|
|
25426
|
+
"›": "›",
|
|
25427
|
+
"‾": "‾",
|
|
25428
|
+
"⁄": "⁄",
|
|
25429
|
+
"€": "€",
|
|
25430
|
+
"ℑ": "ℑ",
|
|
25431
|
+
"℘": "℘",
|
|
25432
|
+
"ℜ": "ℜ",
|
|
25433
|
+
"™": "™",
|
|
25434
|
+
"ℵ": "ℵ",
|
|
25435
|
+
"←": "←",
|
|
25436
|
+
"↑": "↑",
|
|
25437
|
+
"→": "→",
|
|
25438
|
+
"↓": "↓",
|
|
25439
|
+
"↔": "↔",
|
|
25440
|
+
"↵": "↵",
|
|
25441
|
+
"⇐": "⇐",
|
|
25442
|
+
"⇑": "&UArr;",
|
|
25443
|
+
"⇒": "⇒",
|
|
25444
|
+
"⇓": "⇓",
|
|
25445
|
+
"⇔": "⇔",
|
|
25446
|
+
"∀": "∀",
|
|
25447
|
+
"∂": "∂",
|
|
25448
|
+
"∃": "∃",
|
|
25449
|
+
"∅": "∅",
|
|
25450
|
+
"∇": "∇",
|
|
25451
|
+
"∈": "∈",
|
|
25452
|
+
"∉": "∉",
|
|
25453
|
+
"∋": "∋",
|
|
25454
|
+
"∏": "∏",
|
|
25455
|
+
"∑": "∑",
|
|
25456
|
+
"−": "−",
|
|
25457
|
+
"∗": "∗",
|
|
25458
|
+
"√": "√",
|
|
25459
|
+
"∝": "∝",
|
|
25460
|
+
"∞": "∞",
|
|
25461
|
+
"∠": "∠",
|
|
25462
|
+
"∧": "∧",
|
|
25463
|
+
"∨": "∨",
|
|
25464
|
+
"∩": "∩",
|
|
25465
|
+
"∪": "∪",
|
|
25466
|
+
"∫": "∫",
|
|
25467
|
+
"∴": "∴",
|
|
25468
|
+
"∼": "∼",
|
|
25469
|
+
"≅": "≅",
|
|
25470
|
+
"≈": "≈",
|
|
25471
|
+
"≠": "≠",
|
|
25472
|
+
"≡": "≡",
|
|
25473
|
+
"≤": "≤",
|
|
25474
|
+
"≥": "≥",
|
|
25475
|
+
"⊂": "⊂",
|
|
25476
|
+
"⊃": "⊃",
|
|
25477
|
+
"⊄": "⊄",
|
|
25478
|
+
"⊆": "⊆",
|
|
25479
|
+
"⊇": "⊇",
|
|
25480
|
+
"⊕": "⊕",
|
|
25481
|
+
"⊗": "⊗",
|
|
25482
|
+
"⊥": "⊥",
|
|
25483
|
+
"⋅": "⋅",
|
|
25484
|
+
"⌈": "⌈",
|
|
25485
|
+
"⌉": "⌉",
|
|
25486
|
+
"⌊": "⌊",
|
|
25487
|
+
"⌋": "⌋",
|
|
25488
|
+
"⟨": "⟨",
|
|
25489
|
+
"⟩": "⟩",
|
|
25490
|
+
"◊": "◊",
|
|
25491
|
+
"♠": "♠",
|
|
25492
|
+
"♣": "♣",
|
|
25493
|
+
"♥": "♥",
|
|
25494
|
+
"♦": "♦"
|
|
25495
|
+
};
|
|
25496
|
+
|
|
25497
|
+
var html_decode = function html_decode(string) {
|
|
25498
|
+
var entityMap = html_map;
|
|
25499
|
+
for (var key in entityMap) {
|
|
25500
|
+
var entity = entityMap[key];
|
|
25501
|
+
var regex = new RegExp(entity, 'g');
|
|
25502
|
+
string = string.replace(regex, key);
|
|
25503
|
+
}
|
|
25504
|
+
string = string.replace(/"/g, '"');
|
|
25505
|
+
string = string.replace(/&/g, '&');
|
|
25506
|
+
return string;
|
|
25507
|
+
};
|
|
25508
|
+
var html_decode_1 = html_decode;
|
|
25509
|
+
|
|
25510
|
+
var convertEntities = function convertEntities(props) {
|
|
25511
|
+
|
|
25512
|
+
if (typeof props === 'string' || props instanceof String) {
|
|
25513
|
+
props = html_decode_1(props);
|
|
25514
|
+
}
|
|
25515
|
+
|
|
25516
|
+
if (props.children) {
|
|
25517
|
+
for (var i = 0; i < props.children.length; i++) {
|
|
25518
|
+
var child = props.children[i];
|
|
25519
|
+
child = convertEntities(child);
|
|
25520
|
+
props.children[i] = child;
|
|
25521
|
+
}
|
|
25522
|
+
}
|
|
25523
|
+
|
|
25524
|
+
return props;
|
|
25525
|
+
};
|
|
25526
|
+
|
|
20777
25527
|
var getSerializers$1 = function getSerializers(client, pageview, videoAccountIDs, onVote, showVotes, drupalLeadSettings) {
|
|
20778
25528
|
return {
|
|
20779
25529
|
types: {
|
|
25530
|
+
block: function block(props) {
|
|
25531
|
+
props = convertEntities(props);
|
|
25532
|
+
return BlockContent.defaultSerializers.types.block(props);
|
|
25533
|
+
},
|
|
20780
25534
|
youtube: function youtube(_ref) {
|
|
20781
25535
|
var node = _ref.node;
|
|
20782
25536
|
var url = node.url;
|