@ilo-org/react 0.10.6 → 0.11.0
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/CHANGELOG.md +14 -0
- package/lib/cjs/AccordionCtx-be704051.js +9 -0
- package/lib/cjs/{GlobalCtx-97e4b433.js → GlobalCtx-10114bdd.js} +2 -2
- package/lib/cjs/ListCtx-14aa546f.js +9 -0
- package/lib/cjs/TagCtx-690a1d54.js +7 -0
- package/lib/cjs/components/Accordion/Accordion.js +6 -6
- package/lib/cjs/components/Accordion/AccordionButton.js +5 -5
- package/lib/cjs/components/Accordion/AccordionItem.js +2 -2
- package/lib/cjs/components/Accordion/AccordionPanel.js +8 -8
- package/lib/cjs/components/Accordion/index.js +2 -2
- package/lib/cjs/components/Breadcrumb/Breadcrumb.js +5 -5
- package/lib/cjs/components/Breadcrumb/index.js +1 -1
- package/lib/cjs/components/Button/Button.js +1 -1
- package/lib/cjs/components/Button/index.js +1 -1
- package/lib/cjs/components/Callout/Callout.js +4 -4
- package/lib/cjs/components/Callout/index.js +1 -1
- package/lib/cjs/components/Card/Card.js +2 -2
- package/lib/cjs/components/Card/CardGroup.js +2 -2
- package/lib/cjs/components/Card/index.js +2 -2
- package/lib/cjs/components/Checkbox/Checkbox.js +5 -5
- package/lib/cjs/components/Checkbox/index.js +1 -1
- package/lib/cjs/components/Collapse/Collapse.js +1194 -44
- package/lib/cjs/components/Collapse/index.js +0 -1
- package/lib/cjs/components/ContextMenu/ContextMenu.js +1 -1
- package/lib/cjs/components/ContextMenu/index.js +1 -1
- package/lib/cjs/components/Credit/Credit.js +3 -3
- package/lib/cjs/components/Credit/index.js +1 -1
- package/lib/cjs/components/DatePicker/DatePicker.js +4 -4
- package/lib/cjs/components/DatePicker/index.js +1 -1
- package/lib/cjs/components/Dropdown/Dropdown.js +5 -5
- package/lib/cjs/components/Dropdown/index.js +1 -1
- package/lib/cjs/components/Empty/Empty.js +1 -1
- package/lib/cjs/components/Empty/index.js +1 -1
- package/lib/cjs/components/Fieldset/Fieldset.js +5 -5
- package/lib/cjs/components/Fieldset/index.js +1 -1
- package/lib/cjs/components/FileUpload/FileUpload.js +5 -5
- package/lib/cjs/components/FileUpload/index.js +1 -1
- package/lib/cjs/components/Footer/Footer.js +1 -1
- package/lib/cjs/components/Footer/index.js +1 -1
- package/lib/cjs/components/Form/Form.js +3 -3
- package/lib/cjs/components/Form/index.js +1 -1
- package/lib/cjs/components/FormControl/FormControl.js +7 -7
- package/lib/cjs/components/FormControl/index.js +1 -1
- package/lib/cjs/components/GlobalProvider/GlobalProvider.js +1 -1
- package/lib/cjs/components/GlobalProvider/index.js +1 -1
- package/lib/cjs/components/Heading/Heading.js +1 -1
- package/lib/cjs/components/Heading/index.js +1 -1
- package/lib/cjs/components/Hero/Hero.js +1 -1
- package/lib/cjs/components/Hero/HeroCard.js +1 -1
- package/lib/cjs/components/Hero/index.js +1 -1
- package/lib/cjs/components/Icon/Icon.js +3 -3
- package/lib/cjs/components/Icon/index.js +1 -1
- package/lib/cjs/components/Image/Image.js +1 -1
- package/lib/cjs/components/Image/index.js +1 -1
- package/lib/cjs/components/Input/Input.js +1 -1
- package/lib/cjs/components/Input/index.js +1 -1
- package/lib/cjs/components/Link/Link.js +1 -1
- package/lib/cjs/components/Link/index.js +1 -1
- package/lib/cjs/components/LinkList/LinkList.js +1 -1
- package/lib/cjs/components/LinkList/index.js +1 -1
- package/lib/cjs/components/List/List.js +4 -4
- package/lib/cjs/components/List/ListItem.js +2 -2
- package/lib/cjs/components/List/index.js +2 -2
- package/lib/cjs/components/Loading/Loading.js +1 -1
- package/lib/cjs/components/Loading/index.js +1 -1
- package/lib/cjs/components/LocalNav/LocalNav.js +4 -4
- package/lib/cjs/components/LocalNav/index.js +1 -1
- package/lib/cjs/components/Logo/Logo.js +15 -15
- package/lib/cjs/components/Logo/index.js +1 -1
- package/lib/cjs/components/LogoGrid/LogoGrid.js +1 -1
- package/lib/cjs/components/LogoGrid/index.js +1 -1
- package/lib/cjs/components/Navigation/Navigation.js +6 -6
- package/lib/cjs/components/Navigation/index.js +1 -1
- package/lib/cjs/components/Notification/Notification.js +3 -3
- package/lib/cjs/components/Notification/index.js +1 -1
- package/lib/cjs/components/NumberPicker/NumberPicker.js +4 -4
- package/lib/cjs/components/NumberPicker/index.js +1 -1
- package/lib/cjs/components/Pagination/Pagination.js +1 -1
- package/lib/cjs/components/Pagination/index.js +1 -1
- package/lib/cjs/components/Profile/Profile.js +1 -1
- package/lib/cjs/components/Profile/index.js +1 -1
- package/lib/cjs/components/Radio/Radio.js +5 -5
- package/lib/cjs/components/Radio/index.js +1 -1
- package/lib/cjs/components/ReadMore/ReadMore.js +4 -4
- package/lib/cjs/components/ReadMore/index.js +1 -1
- package/lib/cjs/components/RichText/RichText.js +1 -1
- package/lib/cjs/components/RichText/index.js +1 -1
- package/lib/cjs/components/SearchField/SearchField.js +3 -3
- package/lib/cjs/components/SearchField/index.js +1 -1
- package/lib/cjs/components/SocialMedia/SocialMedia.js +1 -1
- package/lib/cjs/components/SocialMedia/index.js +1 -1
- package/lib/cjs/components/TableOfContents/TableOfContents.js +1 -1
- package/lib/cjs/components/TableOfContents/index.js +1 -1
- package/lib/cjs/components/Tabs/Tabs.args.js +156 -0
- package/lib/cjs/components/Tabs/Tabs.js +24 -0
- package/lib/cjs/components/Tabs/index.js +15 -0
- package/lib/cjs/components/Tag/Tag.js +4 -4
- package/lib/cjs/components/Tag/TagSet.js +6 -6
- package/lib/cjs/components/Tag/index.js +2 -2
- package/lib/cjs/components/TextInput/TextInput.js +4 -4
- package/lib/cjs/components/TextInput/index.js +1 -1
- package/lib/cjs/components/Textarea/Textarea.js +4 -4
- package/lib/cjs/components/Textarea/index.js +1 -1
- package/lib/cjs/components/Toggle/Toggle.js +4 -4
- package/lib/cjs/components/Toggle/index.js +1 -1
- package/lib/cjs/components/Tooltip/Tooltip.js +5 -5
- package/lib/cjs/components/Tooltip/index.js +1 -1
- package/lib/cjs/components/Video/Video.js +11 -12
- package/lib/cjs/components/Video/VideoPlayer.js +55 -13
- package/lib/cjs/components/Video/index.js +6 -8
- package/lib/cjs/components/index.js +9 -8
- package/lib/cjs/hooks/index.js +1 -1
- package/lib/cjs/hooks/useGlobalSettings.js +3 -3
- package/lib/cjs/hooks/usePrevious.js +3 -3
- package/lib/cjs/hooks/useVideoPlayer.js +7 -7
- package/lib/cjs/index.js +9 -8
- package/lib/esm/components/Collapse/Collapse.js +1156 -6
- package/lib/esm/components/Collapse/index.js +0 -1
- package/lib/esm/components/FileUpload/FileUpload.js +3 -3
- package/lib/esm/components/NumberPicker/NumberPicker.js +3 -3
- package/lib/esm/components/Radio/Radio.js +3 -3
- package/lib/esm/components/Tabs/Tabs.args.js +154 -0
- package/lib/esm/components/Tabs/Tabs.js +22 -0
- package/lib/esm/components/Tabs/index.js +9 -0
- package/lib/esm/components/TextInput/TextInput.js +3 -3
- package/lib/esm/components/Textarea/Textarea.js +3 -3
- package/lib/esm/components/Video/Video.js +10 -11
- package/lib/esm/components/Video/VideoPlayer.js +57 -11
- package/lib/esm/components/Video/index.js +5 -7
- package/lib/esm/components/index.js +4 -4
- package/lib/esm/index.js +4 -4
- package/lib/types/react/src/components/Tabs/Tabs.args.d.ts +10 -0
- package/lib/types/react/src/components/Tabs/Tabs.d.ts +4 -0
- package/lib/types/react/src/components/Tabs/Tabs.props.d.ts +12 -0
- package/lib/types/react/src/components/Tabs/index.d.ts +1 -0
- package/lib/types/react/src/components/Video/Video.d.ts +2 -2
- package/lib/types/react/src/components/Video/Video.props.d.ts +5 -43
- package/lib/types/react/src/components/Video/VideoPlayer.d.ts +3 -3
- package/lib/types/react/src/components/Video/VideoPlayer.props.d.ts +6 -31
- package/lib/types/react/src/components/index.d.ts +1 -0
- package/package.json +9 -7
- package/src/components/Tabs/Tabs.args.tsx +201 -0
- package/src/components/Tabs/Tabs.props.ts +13 -0
- package/src/components/Tabs/Tabs.tsx +60 -0
- package/src/components/Tabs/index.ts +1 -0
- package/src/components/Video/Video.args.ts +18 -24
- package/src/components/Video/Video.props.ts +5 -47
- package/src/components/Video/Video.tsx +24 -19
- package/src/components/Video/VideoPlayer.props.ts +7 -38
- package/src/components/Video/VideoPlayer.tsx +67 -322
- package/src/components/index.ts +1 -0
- package/src/declarations.d.ts +22 -0
- package/lib/cjs/AccordionCtx-fe08ff45.js +0 -9
- package/lib/cjs/DailyMotion-17b56ecb.js +0 -259
- package/lib/cjs/Facebook-0c8d86ee.js +0 -239
- package/lib/cjs/FilePlayer-01d6dc08.js +0 -596
- package/lib/cjs/Kaltura-40e8e581.js +0 -235
- package/lib/cjs/ListCtx-7db7fe04.js +0 -9
- package/lib/cjs/Mixcloud-e23f49d6.js +0 -222
- package/lib/cjs/Preview-8e490f54.js +0 -227
- package/lib/cjs/SoundCloud-2500b6cb.js +0 -249
- package/lib/cjs/Streamable-00723065.js +0 -234
- package/lib/cjs/TagCtx-929c7753.js +0 -7
- package/lib/cjs/Twitch-2c5c5733.js +0 -244
- package/lib/cjs/VideoPlayer-5f0a64c6.js +0 -2067
- package/lib/cjs/Vidyard-d36d6c45.js +0 -237
- package/lib/cjs/Vimeo-d311e3b8.js +0 -285
- package/lib/cjs/Wistia-318b4e43.js +0 -288
- package/lib/cjs/YouTube-a3796a55.js +0 -377
- package/lib/cjs/index-0af02e81.js +0 -1154
- package/lib/esm/DailyMotion-989c2db3.js +0 -257
- package/lib/esm/Facebook-04e9cc59.js +0 -237
- package/lib/esm/FilePlayer-0789336d.js +0 -594
- package/lib/esm/Kaltura-a9ed37a9.js +0 -233
- package/lib/esm/Mixcloud-5a3b4353.js +0 -220
- package/lib/esm/Preview-7ca1835e.js +0 -225
- package/lib/esm/SoundCloud-47bccd79.js +0 -247
- package/lib/esm/Streamable-ee762126.js +0 -232
- package/lib/esm/Twitch-3cd4b54b.js +0 -242
- package/lib/esm/VideoPlayer-96c2b20c.js +0 -2062
- package/lib/esm/Vidyard-258ab0ef.js +0 -235
- package/lib/esm/Vimeo-4b29b580.js +0 -283
- package/lib/esm/Wistia-3cbce669.js +0 -286
- package/lib/esm/YouTube-db52da1c.js +0 -375
- package/lib/esm/index-623ce3f5.js +0 -1152
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-96c2b20c.js';
|
|
2
|
-
import require$$0 from 'react';
|
|
3
|
-
|
|
4
|
-
function _mergeNamespaces(n, m) {
|
|
5
|
-
m.forEach(function (e) {
|
|
6
|
-
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
7
|
-
if (k !== 'default' && !(k in n)) {
|
|
8
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
9
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () { return e[k]; }
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
return Object.freeze(n);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
var SoundCloud$2 = {};
|
|
20
|
-
|
|
21
|
-
(function (exports) {
|
|
22
|
-
|
|
23
|
-
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); }
|
|
24
|
-
|
|
25
|
-
Object.defineProperty(exports, "__esModule", {
|
|
26
|
-
value: true
|
|
27
|
-
});
|
|
28
|
-
exports["default"] = void 0;
|
|
29
|
-
|
|
30
|
-
var _react = _interopRequireWildcard(require$$0);
|
|
31
|
-
|
|
32
|
-
var _utils = utils;
|
|
33
|
-
|
|
34
|
-
var _patterns = patterns;
|
|
35
|
-
|
|
36
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
37
|
-
|
|
38
|
-
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; }
|
|
39
|
-
|
|
40
|
-
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; }
|
|
41
|
-
|
|
42
|
-
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; }
|
|
43
|
-
|
|
44
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
45
|
-
|
|
46
|
-
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); } }
|
|
47
|
-
|
|
48
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
49
|
-
|
|
50
|
-
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); }
|
|
51
|
-
|
|
52
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
53
|
-
|
|
54
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
55
|
-
|
|
56
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
57
|
-
|
|
58
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
59
|
-
|
|
60
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
61
|
-
|
|
62
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
63
|
-
|
|
64
|
-
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; }
|
|
65
|
-
|
|
66
|
-
var SDK_URL = 'https://w.soundcloud.com/player/api.js';
|
|
67
|
-
var SDK_GLOBAL = 'SC';
|
|
68
|
-
|
|
69
|
-
var SoundCloud = /*#__PURE__*/function (_Component) {
|
|
70
|
-
_inherits(SoundCloud, _Component);
|
|
71
|
-
|
|
72
|
-
var _super = _createSuper(SoundCloud);
|
|
73
|
-
|
|
74
|
-
function SoundCloud() {
|
|
75
|
-
var _this;
|
|
76
|
-
|
|
77
|
-
_classCallCheck(this, SoundCloud);
|
|
78
|
-
|
|
79
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
80
|
-
args[_key] = arguments[_key];
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
84
|
-
|
|
85
|
-
_defineProperty(_assertThisInitialized(_this), "callPlayer", _utils.callPlayer);
|
|
86
|
-
|
|
87
|
-
_defineProperty(_assertThisInitialized(_this), "duration", null);
|
|
88
|
-
|
|
89
|
-
_defineProperty(_assertThisInitialized(_this), "currentTime", null);
|
|
90
|
-
|
|
91
|
-
_defineProperty(_assertThisInitialized(_this), "fractionLoaded", null);
|
|
92
|
-
|
|
93
|
-
_defineProperty(_assertThisInitialized(_this), "mute", function () {
|
|
94
|
-
_this.setVolume(0);
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
_defineProperty(_assertThisInitialized(_this), "unmute", function () {
|
|
98
|
-
if (_this.props.volume !== null) {
|
|
99
|
-
_this.setVolume(_this.props.volume);
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
_defineProperty(_assertThisInitialized(_this), "ref", function (iframe) {
|
|
104
|
-
_this.iframe = iframe;
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
return _this;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
_createClass(SoundCloud, [{
|
|
111
|
-
key: "componentDidMount",
|
|
112
|
-
value: function componentDidMount() {
|
|
113
|
-
this.props.onMount && this.props.onMount(this);
|
|
114
|
-
}
|
|
115
|
-
}, {
|
|
116
|
-
key: "load",
|
|
117
|
-
value: function load(url, isReady) {
|
|
118
|
-
var _this2 = this;
|
|
119
|
-
|
|
120
|
-
(0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (SC) {
|
|
121
|
-
if (!_this2.iframe) return;
|
|
122
|
-
var _SC$Widget$Events = SC.Widget.Events,
|
|
123
|
-
PLAY = _SC$Widget$Events.PLAY,
|
|
124
|
-
PLAY_PROGRESS = _SC$Widget$Events.PLAY_PROGRESS,
|
|
125
|
-
PAUSE = _SC$Widget$Events.PAUSE,
|
|
126
|
-
FINISH = _SC$Widget$Events.FINISH,
|
|
127
|
-
ERROR = _SC$Widget$Events.ERROR;
|
|
128
|
-
|
|
129
|
-
if (!isReady) {
|
|
130
|
-
_this2.player = SC.Widget(_this2.iframe);
|
|
131
|
-
|
|
132
|
-
_this2.player.bind(PLAY, _this2.props.onPlay);
|
|
133
|
-
|
|
134
|
-
_this2.player.bind(PAUSE, function () {
|
|
135
|
-
var remaining = _this2.duration - _this2.currentTime;
|
|
136
|
-
|
|
137
|
-
if (remaining < 0.05) {
|
|
138
|
-
// Prevent onPause firing right before onEnded
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
_this2.props.onPause();
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
_this2.player.bind(PLAY_PROGRESS, function (e) {
|
|
146
|
-
_this2.currentTime = e.currentPosition / 1000;
|
|
147
|
-
_this2.fractionLoaded = e.loadedProgress;
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
_this2.player.bind(FINISH, function () {
|
|
151
|
-
return _this2.props.onEnded();
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
_this2.player.bind(ERROR, function (e) {
|
|
155
|
-
return _this2.props.onError(e);
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
_this2.player.load(url, _objectSpread(_objectSpread({}, _this2.props.config.options), {}, {
|
|
160
|
-
callback: function callback() {
|
|
161
|
-
_this2.player.getDuration(function (duration) {
|
|
162
|
-
_this2.duration = duration / 1000;
|
|
163
|
-
|
|
164
|
-
_this2.props.onReady();
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
}));
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
}, {
|
|
171
|
-
key: "play",
|
|
172
|
-
value: function play() {
|
|
173
|
-
this.callPlayer('play');
|
|
174
|
-
}
|
|
175
|
-
}, {
|
|
176
|
-
key: "pause",
|
|
177
|
-
value: function pause() {
|
|
178
|
-
this.callPlayer('pause');
|
|
179
|
-
}
|
|
180
|
-
}, {
|
|
181
|
-
key: "stop",
|
|
182
|
-
value: function stop() {// Nothing to do
|
|
183
|
-
}
|
|
184
|
-
}, {
|
|
185
|
-
key: "seekTo",
|
|
186
|
-
value: function seekTo(seconds) {
|
|
187
|
-
this.callPlayer('seekTo', seconds * 1000);
|
|
188
|
-
}
|
|
189
|
-
}, {
|
|
190
|
-
key: "setVolume",
|
|
191
|
-
value: function setVolume(fraction) {
|
|
192
|
-
this.callPlayer('setVolume', fraction * 100);
|
|
193
|
-
}
|
|
194
|
-
}, {
|
|
195
|
-
key: "getDuration",
|
|
196
|
-
value: function getDuration() {
|
|
197
|
-
return this.duration;
|
|
198
|
-
}
|
|
199
|
-
}, {
|
|
200
|
-
key: "getCurrentTime",
|
|
201
|
-
value: function getCurrentTime() {
|
|
202
|
-
return this.currentTime;
|
|
203
|
-
}
|
|
204
|
-
}, {
|
|
205
|
-
key: "getSecondsLoaded",
|
|
206
|
-
value: function getSecondsLoaded() {
|
|
207
|
-
return this.fractionLoaded * this.duration;
|
|
208
|
-
}
|
|
209
|
-
}, {
|
|
210
|
-
key: "render",
|
|
211
|
-
value: function render() {
|
|
212
|
-
var display = this.props.display;
|
|
213
|
-
var style = {
|
|
214
|
-
width: '100%',
|
|
215
|
-
height: '100%',
|
|
216
|
-
display: display
|
|
217
|
-
};
|
|
218
|
-
return /*#__PURE__*/_react["default"].createElement("iframe", {
|
|
219
|
-
ref: this.ref,
|
|
220
|
-
src: "https://w.soundcloud.com/player/?url=".concat(encodeURIComponent(this.props.url)),
|
|
221
|
-
style: style,
|
|
222
|
-
frameBorder: 0,
|
|
223
|
-
allow: "autoplay"
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
}]);
|
|
227
|
-
|
|
228
|
-
return SoundCloud;
|
|
229
|
-
}(_react.Component);
|
|
230
|
-
|
|
231
|
-
exports["default"] = SoundCloud;
|
|
232
|
-
|
|
233
|
-
_defineProperty(SoundCloud, "displayName", 'SoundCloud');
|
|
234
|
-
|
|
235
|
-
_defineProperty(SoundCloud, "canPlay", _patterns.canPlay.soundcloud);
|
|
236
|
-
|
|
237
|
-
_defineProperty(SoundCloud, "loopOnEnded", true);
|
|
238
|
-
} (SoundCloud$2));
|
|
239
|
-
|
|
240
|
-
var SoundCloud = /*@__PURE__*/getDefaultExportFromCjs(SoundCloud$2);
|
|
241
|
-
|
|
242
|
-
var SoundCloud$1 = /*#__PURE__*/_mergeNamespaces({
|
|
243
|
-
__proto__: null,
|
|
244
|
-
default: SoundCloud
|
|
245
|
-
}, [SoundCloud$2]);
|
|
246
|
-
|
|
247
|
-
export { SoundCloud$1 as S };
|
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-96c2b20c.js';
|
|
2
|
-
import require$$0 from 'react';
|
|
3
|
-
|
|
4
|
-
function _mergeNamespaces(n, m) {
|
|
5
|
-
m.forEach(function (e) {
|
|
6
|
-
e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
|
|
7
|
-
if (k !== 'default' && !(k in n)) {
|
|
8
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
9
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () { return e[k]; }
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
return Object.freeze(n);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
var Streamable$2 = {};
|
|
20
|
-
|
|
21
|
-
(function (exports) {
|
|
22
|
-
|
|
23
|
-
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); }
|
|
24
|
-
|
|
25
|
-
Object.defineProperty(exports, "__esModule", {
|
|
26
|
-
value: true
|
|
27
|
-
});
|
|
28
|
-
exports["default"] = void 0;
|
|
29
|
-
|
|
30
|
-
var _react = _interopRequireWildcard(require$$0);
|
|
31
|
-
|
|
32
|
-
var _utils = utils;
|
|
33
|
-
|
|
34
|
-
var _patterns = patterns;
|
|
35
|
-
|
|
36
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
37
|
-
|
|
38
|
-
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; }
|
|
39
|
-
|
|
40
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
41
|
-
|
|
42
|
-
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); } }
|
|
43
|
-
|
|
44
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
45
|
-
|
|
46
|
-
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); }
|
|
47
|
-
|
|
48
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
49
|
-
|
|
50
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
51
|
-
|
|
52
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
53
|
-
|
|
54
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
55
|
-
|
|
56
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
57
|
-
|
|
58
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
59
|
-
|
|
60
|
-
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; }
|
|
61
|
-
|
|
62
|
-
var SDK_URL = 'https://cdn.embed.ly/player-0.1.0.min.js';
|
|
63
|
-
var SDK_GLOBAL = 'playerjs';
|
|
64
|
-
|
|
65
|
-
var Streamable = /*#__PURE__*/function (_Component) {
|
|
66
|
-
_inherits(Streamable, _Component);
|
|
67
|
-
|
|
68
|
-
var _super = _createSuper(Streamable);
|
|
69
|
-
|
|
70
|
-
function Streamable() {
|
|
71
|
-
var _this;
|
|
72
|
-
|
|
73
|
-
_classCallCheck(this, Streamable);
|
|
74
|
-
|
|
75
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
76
|
-
args[_key] = arguments[_key];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
80
|
-
|
|
81
|
-
_defineProperty(_assertThisInitialized(_this), "callPlayer", _utils.callPlayer);
|
|
82
|
-
|
|
83
|
-
_defineProperty(_assertThisInitialized(_this), "duration", null);
|
|
84
|
-
|
|
85
|
-
_defineProperty(_assertThisInitialized(_this), "currentTime", null);
|
|
86
|
-
|
|
87
|
-
_defineProperty(_assertThisInitialized(_this), "secondsLoaded", null);
|
|
88
|
-
|
|
89
|
-
_defineProperty(_assertThisInitialized(_this), "mute", function () {
|
|
90
|
-
_this.callPlayer('mute');
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
_defineProperty(_assertThisInitialized(_this), "unmute", function () {
|
|
94
|
-
_this.callPlayer('unmute');
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
_defineProperty(_assertThisInitialized(_this), "ref", function (iframe) {
|
|
98
|
-
_this.iframe = iframe;
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
return _this;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
_createClass(Streamable, [{
|
|
105
|
-
key: "componentDidMount",
|
|
106
|
-
value: function componentDidMount() {
|
|
107
|
-
this.props.onMount && this.props.onMount(this);
|
|
108
|
-
}
|
|
109
|
-
}, {
|
|
110
|
-
key: "load",
|
|
111
|
-
value: function load(url) {
|
|
112
|
-
var _this2 = this;
|
|
113
|
-
|
|
114
|
-
(0, _utils.getSDK)(SDK_URL, SDK_GLOBAL).then(function (playerjs) {
|
|
115
|
-
if (!_this2.iframe) return;
|
|
116
|
-
_this2.player = new playerjs.Player(_this2.iframe);
|
|
117
|
-
|
|
118
|
-
_this2.player.setLoop(_this2.props.loop);
|
|
119
|
-
|
|
120
|
-
_this2.player.on('ready', _this2.props.onReady);
|
|
121
|
-
|
|
122
|
-
_this2.player.on('play', _this2.props.onPlay);
|
|
123
|
-
|
|
124
|
-
_this2.player.on('pause', _this2.props.onPause);
|
|
125
|
-
|
|
126
|
-
_this2.player.on('seeked', _this2.props.onSeek);
|
|
127
|
-
|
|
128
|
-
_this2.player.on('ended', _this2.props.onEnded);
|
|
129
|
-
|
|
130
|
-
_this2.player.on('error', _this2.props.onError);
|
|
131
|
-
|
|
132
|
-
_this2.player.on('timeupdate', function (_ref) {
|
|
133
|
-
var duration = _ref.duration,
|
|
134
|
-
seconds = _ref.seconds;
|
|
135
|
-
_this2.duration = duration;
|
|
136
|
-
_this2.currentTime = seconds;
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
_this2.player.on('buffered', function (_ref2) {
|
|
140
|
-
var percent = _ref2.percent;
|
|
141
|
-
|
|
142
|
-
if (_this2.duration) {
|
|
143
|
-
_this2.secondsLoaded = _this2.duration * percent;
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
if (_this2.props.muted) {
|
|
148
|
-
_this2.player.mute();
|
|
149
|
-
}
|
|
150
|
-
}, this.props.onError);
|
|
151
|
-
}
|
|
152
|
-
}, {
|
|
153
|
-
key: "play",
|
|
154
|
-
value: function play() {
|
|
155
|
-
this.callPlayer('play');
|
|
156
|
-
}
|
|
157
|
-
}, {
|
|
158
|
-
key: "pause",
|
|
159
|
-
value: function pause() {
|
|
160
|
-
this.callPlayer('pause');
|
|
161
|
-
}
|
|
162
|
-
}, {
|
|
163
|
-
key: "stop",
|
|
164
|
-
value: function stop() {// Nothing to do
|
|
165
|
-
}
|
|
166
|
-
}, {
|
|
167
|
-
key: "seekTo",
|
|
168
|
-
value: function seekTo(seconds) {
|
|
169
|
-
this.callPlayer('setCurrentTime', seconds);
|
|
170
|
-
}
|
|
171
|
-
}, {
|
|
172
|
-
key: "setVolume",
|
|
173
|
-
value: function setVolume(fraction) {
|
|
174
|
-
this.callPlayer('setVolume', fraction * 100);
|
|
175
|
-
}
|
|
176
|
-
}, {
|
|
177
|
-
key: "setLoop",
|
|
178
|
-
value: function setLoop(loop) {
|
|
179
|
-
this.callPlayer('setLoop', loop);
|
|
180
|
-
}
|
|
181
|
-
}, {
|
|
182
|
-
key: "getDuration",
|
|
183
|
-
value: function getDuration() {
|
|
184
|
-
return this.duration;
|
|
185
|
-
}
|
|
186
|
-
}, {
|
|
187
|
-
key: "getCurrentTime",
|
|
188
|
-
value: function getCurrentTime() {
|
|
189
|
-
return this.currentTime;
|
|
190
|
-
}
|
|
191
|
-
}, {
|
|
192
|
-
key: "getSecondsLoaded",
|
|
193
|
-
value: function getSecondsLoaded() {
|
|
194
|
-
return this.secondsLoaded;
|
|
195
|
-
}
|
|
196
|
-
}, {
|
|
197
|
-
key: "render",
|
|
198
|
-
value: function render() {
|
|
199
|
-
var id = this.props.url.match(_patterns.MATCH_URL_STREAMABLE)[1];
|
|
200
|
-
var style = {
|
|
201
|
-
width: '100%',
|
|
202
|
-
height: '100%'
|
|
203
|
-
};
|
|
204
|
-
return /*#__PURE__*/_react["default"].createElement("iframe", {
|
|
205
|
-
ref: this.ref,
|
|
206
|
-
src: "https://streamable.com/o/".concat(id),
|
|
207
|
-
frameBorder: "0",
|
|
208
|
-
scrolling: "no",
|
|
209
|
-
style: style,
|
|
210
|
-
allow: "encrypted-media; autoplay; fullscreen;"
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
}]);
|
|
214
|
-
|
|
215
|
-
return Streamable;
|
|
216
|
-
}(_react.Component);
|
|
217
|
-
|
|
218
|
-
exports["default"] = Streamable;
|
|
219
|
-
|
|
220
|
-
_defineProperty(Streamable, "displayName", 'Streamable');
|
|
221
|
-
|
|
222
|
-
_defineProperty(Streamable, "canPlay", _patterns.canPlay.streamable);
|
|
223
|
-
} (Streamable$2));
|
|
224
|
-
|
|
225
|
-
var Streamable = /*@__PURE__*/getDefaultExportFromCjs(Streamable$2);
|
|
226
|
-
|
|
227
|
-
var Streamable$1 = /*#__PURE__*/_mergeNamespaces({
|
|
228
|
-
__proto__: null,
|
|
229
|
-
default: Streamable
|
|
230
|
-
}, [Streamable$2]);
|
|
231
|
-
|
|
232
|
-
export { Streamable$1 as S };
|