@ilo-org/react 0.8.14-next.1 → 0.9.0-next.3
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 +22 -0
- package/lib/cjs/{DailyMotion-2cda261d.js → DailyMotion-e06c9a92.js} +1 -1
- package/lib/cjs/{Facebook-40bd92e7.js → Facebook-d58c4f38.js} +1 -1
- package/lib/cjs/{FilePlayer-b5a2e7b1.js → FilePlayer-fd6ea462.js} +1 -1
- package/lib/cjs/{Kaltura-8544b000.js → Kaltura-60c01a5d.js} +1 -1
- package/lib/cjs/{Mixcloud-2c92778a.js → Mixcloud-124760a9.js} +1 -1
- package/lib/cjs/{Preview-a5f6c0c7.js → Preview-81296819.js} +1 -1
- package/lib/cjs/{SoundCloud-ff297faf.js → SoundCloud-1739c1f1.js} +1 -1
- package/lib/cjs/{Streamable-612542e7.js → Streamable-837b9cf6.js} +1 -1
- package/lib/cjs/{Twitch-246c531e.js → Twitch-bf2a7602.js} +1 -1
- package/lib/cjs/{VideoPlayer-d576de50.js → VideoPlayer-e2de3674.js} +24 -14
- package/lib/cjs/{Vidyard-e1bb2e3d.js → Vidyard-1256273d.js} +1 -1
- package/lib/cjs/{Vimeo-38a72f3d.js → Vimeo-fc878336.js} +1 -1
- package/lib/cjs/{Wistia-1280865c.js → Wistia-7aa618d2.js} +1 -1
- package/lib/cjs/{YouTube-1fbce80b.js → YouTube-588e57ea.js} +1 -1
- package/lib/cjs/components/Video/Video.js +1 -1
- package/lib/cjs/components/Video/VideoPlayer.js +1 -1
- package/lib/cjs/components/Video/index.js +1 -1
- package/lib/cjs/components/index.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/esm/{DailyMotion-89500a59.js → DailyMotion-2e38ef76.js} +1 -1
- package/lib/esm/{Facebook-7abf2b6b.js → Facebook-4a2334f4.js} +1 -1
- package/lib/esm/{FilePlayer-c5879d9f.js → FilePlayer-40e1ae01.js} +1 -1
- package/lib/esm/{Kaltura-424e97bb.js → Kaltura-c80bdfb7.js} +1 -1
- package/lib/esm/{Mixcloud-a9c98513.js → Mixcloud-b0f9376b.js} +1 -1
- package/lib/esm/{Preview-05e5eb47.js → Preview-07219fbc.js} +1 -1
- package/lib/esm/{SoundCloud-0853e0b6.js → SoundCloud-78094ae3.js} +1 -1
- package/lib/esm/{Streamable-da3fc8b6.js → Streamable-44c36485.js} +1 -1
- package/lib/esm/{Twitch-25eb6a7b.js → Twitch-cec3b85d.js} +1 -1
- package/lib/esm/{VideoPlayer-a5fa87ce.js → VideoPlayer-b5d125fd.js} +25 -15
- package/lib/esm/{Vidyard-7284e1ca.js → Vidyard-44d40c02.js} +1 -1
- package/lib/esm/{Vimeo-4dc64c92.js → Vimeo-dd76c909.js} +1 -1
- package/lib/esm/{Wistia-7f9e5ea3.js → Wistia-d98e9e9e.js} +1 -1
- package/lib/esm/{YouTube-9fef7faa.js → YouTube-2e7e24ca.js} +1 -1
- package/lib/esm/components/Video/Video.js +1 -1
- package/lib/esm/components/Video/VideoPlayer.js +1 -1
- package/lib/esm/components/Video/index.js +1 -1
- package/lib/esm/components/index.js +1 -1
- package/lib/esm/index.js +1 -1
- package/package.json +3 -2
- package/src/components/Video/VideoPlayer.tsx +33 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @ilo-org/react
|
|
2
2
|
|
|
3
|
+
## 0.9.0-next.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [6d089ba7f]
|
|
8
|
+
- Updated dependencies [a8ce5d3fc]
|
|
9
|
+
- @ilo-org/styles@0.11.3-next.3
|
|
10
|
+
|
|
11
|
+
## 0.9.0-next.2
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- 55f0c47aa: Added chained hover effect for video play button
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- ca463b9b7: added full width on mobile viewport for affected cards
|
|
20
|
+
- Updated dependencies [55f0c47aa]
|
|
21
|
+
- Updated dependencies [b976f7221]
|
|
22
|
+
- Updated dependencies [ca463b9b7]
|
|
23
|
+
- @ilo-org/styles@0.11.3-next.2
|
|
24
|
+
|
|
3
25
|
## 0.8.14-next.1
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -634,7 +634,7 @@ patterns.canPlay = canPlay;
|
|
|
634
634
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
635
635
|
return Promise.resolve().then(function () { return require(
|
|
636
636
|
/* webpackChunkName: 'reactPlayerYouTube' */
|
|
637
|
-
'./YouTube-
|
|
637
|
+
'./YouTube-588e57ea.js'); }).then(function (n) { return n.YouTube; });
|
|
638
638
|
})
|
|
639
639
|
}, {
|
|
640
640
|
key: 'soundcloud',
|
|
@@ -643,7 +643,7 @@ patterns.canPlay = canPlay;
|
|
|
643
643
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
644
644
|
return Promise.resolve().then(function () { return require(
|
|
645
645
|
/* webpackChunkName: 'reactPlayerSoundCloud' */
|
|
646
|
-
'./SoundCloud-
|
|
646
|
+
'./SoundCloud-1739c1f1.js'); }).then(function (n) { return n.SoundCloud; });
|
|
647
647
|
})
|
|
648
648
|
}, {
|
|
649
649
|
key: 'vimeo',
|
|
@@ -652,7 +652,7 @@ patterns.canPlay = canPlay;
|
|
|
652
652
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
653
653
|
return Promise.resolve().then(function () { return require(
|
|
654
654
|
/* webpackChunkName: 'reactPlayerVimeo' */
|
|
655
|
-
'./Vimeo-
|
|
655
|
+
'./Vimeo-fc878336.js'); }).then(function (n) { return n.Vimeo; });
|
|
656
656
|
})
|
|
657
657
|
}, {
|
|
658
658
|
key: 'facebook',
|
|
@@ -661,7 +661,7 @@ patterns.canPlay = canPlay;
|
|
|
661
661
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
662
662
|
return Promise.resolve().then(function () { return require(
|
|
663
663
|
/* webpackChunkName: 'reactPlayerFacebook' */
|
|
664
|
-
'./Facebook-
|
|
664
|
+
'./Facebook-d58c4f38.js'); }).then(function (n) { return n.Facebook; });
|
|
665
665
|
})
|
|
666
666
|
}, {
|
|
667
667
|
key: 'streamable',
|
|
@@ -670,7 +670,7 @@ patterns.canPlay = canPlay;
|
|
|
670
670
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
671
671
|
return Promise.resolve().then(function () { return require(
|
|
672
672
|
/* webpackChunkName: 'reactPlayerStreamable' */
|
|
673
|
-
'./Streamable-
|
|
673
|
+
'./Streamable-837b9cf6.js'); }).then(function (n) { return n.Streamable; });
|
|
674
674
|
})
|
|
675
675
|
}, {
|
|
676
676
|
key: 'wistia',
|
|
@@ -679,7 +679,7 @@ patterns.canPlay = canPlay;
|
|
|
679
679
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
680
680
|
return Promise.resolve().then(function () { return require(
|
|
681
681
|
/* webpackChunkName: 'reactPlayerWistia' */
|
|
682
|
-
'./Wistia-
|
|
682
|
+
'./Wistia-7aa618d2.js'); }).then(function (n) { return n.Wistia; });
|
|
683
683
|
})
|
|
684
684
|
}, {
|
|
685
685
|
key: 'twitch',
|
|
@@ -688,7 +688,7 @@ patterns.canPlay = canPlay;
|
|
|
688
688
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
689
689
|
return Promise.resolve().then(function () { return require(
|
|
690
690
|
/* webpackChunkName: 'reactPlayerTwitch' */
|
|
691
|
-
'./Twitch-
|
|
691
|
+
'./Twitch-bf2a7602.js'); }).then(function (n) { return n.Twitch; });
|
|
692
692
|
})
|
|
693
693
|
}, {
|
|
694
694
|
key: 'dailymotion',
|
|
@@ -697,7 +697,7 @@ patterns.canPlay = canPlay;
|
|
|
697
697
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
698
698
|
return Promise.resolve().then(function () { return require(
|
|
699
699
|
/* webpackChunkName: 'reactPlayerDailyMotion' */
|
|
700
|
-
'./DailyMotion-
|
|
700
|
+
'./DailyMotion-e06c9a92.js'); }).then(function (n) { return n.DailyMotion; });
|
|
701
701
|
})
|
|
702
702
|
}, {
|
|
703
703
|
key: 'mixcloud',
|
|
@@ -706,7 +706,7 @@ patterns.canPlay = canPlay;
|
|
|
706
706
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
707
707
|
return Promise.resolve().then(function () { return require(
|
|
708
708
|
/* webpackChunkName: 'reactPlayerMixcloud' */
|
|
709
|
-
'./Mixcloud-
|
|
709
|
+
'./Mixcloud-124760a9.js'); }).then(function (n) { return n.Mixcloud; });
|
|
710
710
|
})
|
|
711
711
|
}, {
|
|
712
712
|
key: 'vidyard',
|
|
@@ -715,7 +715,7 @@ patterns.canPlay = canPlay;
|
|
|
715
715
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
716
716
|
return Promise.resolve().then(function () { return require(
|
|
717
717
|
/* webpackChunkName: 'reactPlayerVidyard' */
|
|
718
|
-
'./Vidyard-
|
|
718
|
+
'./Vidyard-1256273d.js'); }).then(function (n) { return n.Vidyard; });
|
|
719
719
|
})
|
|
720
720
|
}, {
|
|
721
721
|
key: 'kaltura',
|
|
@@ -724,7 +724,7 @@ patterns.canPlay = canPlay;
|
|
|
724
724
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
725
725
|
return Promise.resolve().then(function () { return require(
|
|
726
726
|
/* webpackChunkName: 'reactPlayerKaltura' */
|
|
727
|
-
'./Kaltura-
|
|
727
|
+
'./Kaltura-60c01a5d.js'); }).then(function (n) { return n.Kaltura; });
|
|
728
728
|
})
|
|
729
729
|
}, {
|
|
730
730
|
key: 'file',
|
|
@@ -736,7 +736,7 @@ patterns.canPlay = canPlay;
|
|
|
736
736
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
737
737
|
return Promise.resolve().then(function () { return require(
|
|
738
738
|
/* webpackChunkName: 'reactPlayerFilePlayer' */
|
|
739
|
-
'./FilePlayer-
|
|
739
|
+
'./FilePlayer-fd6ea462.js'); }).then(function (n) { return n.FilePlayer; });
|
|
740
740
|
})
|
|
741
741
|
}];
|
|
742
742
|
exports["default"] = _default;
|
|
@@ -1661,7 +1661,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
1661
1661
|
var Preview = /*#__PURE__*/(0, _react.lazy)(function () {
|
|
1662
1662
|
return Promise.resolve().then(function () { return require(
|
|
1663
1663
|
/* webpackChunkName: 'reactPlayerPreview' */
|
|
1664
|
-
'./Preview-
|
|
1664
|
+
'./Preview-81296819.js'); }).then(function (n) { return n.Preview; });
|
|
1665
1665
|
});
|
|
1666
1666
|
var IS_BROWSER = typeof window !== 'undefined' && window.document;
|
|
1667
1667
|
var IS_GLOBAL = typeof commonjsGlobal !== 'undefined' && commonjsGlobal.window && commonjsGlobal.window.document;
|
|
@@ -2043,12 +2043,22 @@ const VideoPlayer = ({ controls, src, poster, youtube, tracks, }) => {
|
|
|
2043
2043
|
setPlaying(false);
|
|
2044
2044
|
setSeeking(false);
|
|
2045
2045
|
};
|
|
2046
|
+
const handlePlayHover = require$$0.useCallback((event, state) => {
|
|
2047
|
+
const element = event.currentTarget;
|
|
2048
|
+
if (!element.classList.contains(`${controlsClasses}--play`)) {
|
|
2049
|
+
return;
|
|
2050
|
+
}
|
|
2051
|
+
const duration = element.previousSibling;
|
|
2052
|
+
if (duration instanceof HTMLLabelElement) {
|
|
2053
|
+
duration.classList.toggle(`${controlsClasses}--duration--hovered`, state);
|
|
2054
|
+
}
|
|
2055
|
+
}, [controlsClasses]);
|
|
2046
2056
|
return (jsxRuntime.jsxs("div", Object.assign({ className: `${baseClass}--container`, ref: videoContainer }, { children: [jsxRuntime.jsx(ReactPlayer, { className: playerClasses, config: playerconfig, loop: false, muted: muted, playing: playing, ref: videoElement, url: src, width: "100%", height: "100%", progressInterval: 30, volume: volume, onProgress: handleProgress, onDuration: handleDuration, onEnded: handleEnded }), jsxRuntime.jsxs("picture", Object.assign({ className: `${baseClass}--poster ${showposter ? "show" : ""}` }, { children: [(poster === null || poster === void 0 ? void 0 : poster.url) &&
|
|
2047
2057
|
poster.url
|
|
2048
2058
|
.sort((a, b) => parseFloat(a.breakpoint) - parseFloat(b.breakpoint))
|
|
2049
2059
|
.slice(1)
|
|
2050
2060
|
.reverse()
|
|
2051
|
-
.map((item, index) => (jsxRuntime.jsx("source", { srcSet: item.src, media: `(min-width: ${item.breakpoint}px)` }, index))), jsxRuntime.jsx("img", { src: (_a = poster === null || poster === void 0 ? void 0 : poster.url[0]) === null || _a === void 0 ? void 0 : _a.src, alt: poster === null || poster === void 0 ? void 0 : poster.alt })] })), jsxRuntime.jsxs("div", Object.assign({ className: `${controlsClasses} ${showposter ? "notplayed" : ""}` }, { children: [jsxRuntime.jsx("label", Object.assign({ className: `${controlsClasses}--duration ${showposter ? "show" : ""}` }, { children: duration })), jsxRuntime.jsx("button", Object.assign({ className: `${controlsClasses}--${!playing ? "play" : "pause"}`, onClick: togglePlay }, { children: jsxRuntime.jsx("span", { children: !playing ? controls && controls.play : controls && controls.pause }) })), jsxRuntime.jsxs("div", Object.assign({ className: `${controlsClasses}--progress ${showposter ? "" : "show"}` }, { children: [jsxRuntime.jsx("input", { type: "range", min: 0, max: 0.999999, step: "any", value: playhead, onMouseDown: handleSeekMouseDown, onChange: handleSeekChange, onMouseUp: handleSeekMouseUp, className: `${controlsClasses}--progress-playhead` }), jsxRuntime.jsx("progress", { className: `${controlsClasses}--progress-current`, max: 1, value: playhead }), jsxRuntime.jsx("progress", { className: `${controlsClasses}--progress-loaded`, max: 1, value: buffer }), jsxRuntime.jsx("div", Object.assign({ className: `${controlsClasses}--progress-played-container` }, { children: jsxRuntime.jsx("label", Object.assign({ className: `${controlsClasses}--progress-played`, style: { ["--playhead"]: `${playhead * 100}%` } }, { children: playedtime })) }))] })), jsxRuntime.jsxs("div", Object.assign({ className: `${controlsClasses}--volume ${showposter ? "" : "show"}`, onMouseEnter: showVolumeSlider, onMouseLeave: hideVolumeSlider }, { children: [jsxRuntime.jsx("button", Object.assign({ className: `${controlsClasses}--showvolume ${muted ? "muted" : ""}`, onClick: toggleMute }, { children: jsxRuntime.jsx("span", { children: controls && controls.volume }) })), jsxRuntime.jsx("div", Object.assign({ className: `${controlsClasses}--setvolume-container` }, { children: jsxRuntime.jsx("input", { className: `${controlsClasses}--setvolume ${showvolume ? "show" : ""}`, type: "range", step: "0.5", defaultValue: volume, min: "1", max: "10", onChange: handleVolumeChange, onMouseLeave: hideVolumeSlider }) }))] })), jsxRuntime.jsx("button", Object.assign({ className: `${controlsClasses}--fullscreen ${showposter ? "" : "show"}`, onClick: toggleFullscreen }, { children: jsxRuntime.jsx("span", { children: controls && controls.fullscreen }) }))] }))] })));
|
|
2061
|
+
.map((item, index) => (jsxRuntime.jsx("source", { srcSet: item.src, media: `(min-width: ${item.breakpoint}px)` }, index))), jsxRuntime.jsx("img", { src: (_a = poster === null || poster === void 0 ? void 0 : poster.url[0]) === null || _a === void 0 ? void 0 : _a.src, alt: poster === null || poster === void 0 ? void 0 : poster.alt })] })), jsxRuntime.jsxs("div", Object.assign({ className: `${controlsClasses} ${showposter ? "notplayed" : ""}` }, { children: [jsxRuntime.jsx("label", Object.assign({ className: `${controlsClasses}--duration ${showposter ? "show" : ""}` }, { children: duration })), jsxRuntime.jsx("button", Object.assign({ className: `${controlsClasses}--${!playing ? "play" : "pause"}`, onClick: togglePlay, onMouseOver: (e) => handlePlayHover(e, true), onFocus: (e) => handlePlayHover(e, true), onMouseOut: (e) => handlePlayHover(e, false), onBlur: (e) => handlePlayHover(e, false) }, { children: jsxRuntime.jsx("span", { children: !playing ? controls && controls.play : controls && controls.pause }) })), jsxRuntime.jsxs("div", Object.assign({ className: `${controlsClasses}--progress ${showposter ? "" : "show"}` }, { children: [jsxRuntime.jsx("input", { type: "range", min: 0, max: 0.999999, step: "any", value: playhead, onMouseDown: handleSeekMouseDown, onChange: handleSeekChange, onMouseUp: handleSeekMouseUp, className: `${controlsClasses}--progress-playhead` }), jsxRuntime.jsx("progress", { className: `${controlsClasses}--progress-current`, max: 1, value: playhead }), jsxRuntime.jsx("progress", { className: `${controlsClasses}--progress-loaded`, max: 1, value: buffer }), jsxRuntime.jsx("div", Object.assign({ className: `${controlsClasses}--progress-played-container` }, { children: jsxRuntime.jsx("label", Object.assign({ className: `${controlsClasses}--progress-played`, style: { ["--playhead"]: `${playhead * 100}%` } }, { children: playedtime })) }))] })), jsxRuntime.jsxs("div", Object.assign({ className: `${controlsClasses}--volume ${showposter ? "" : "show"}`, onMouseEnter: showVolumeSlider, onMouseLeave: hideVolumeSlider }, { children: [jsxRuntime.jsx("button", Object.assign({ className: `${controlsClasses}--showvolume ${muted ? "muted" : ""}`, onClick: toggleMute }, { children: jsxRuntime.jsx("span", { children: controls && controls.volume }) })), jsxRuntime.jsx("div", Object.assign({ className: `${controlsClasses}--setvolume-container` }, { children: jsxRuntime.jsx("input", { className: `${controlsClasses}--setvolume ${showvolume ? "show" : ""}`, type: "range", step: "0.5", defaultValue: volume, min: "1", max: "10", onChange: handleVolumeChange, onMouseLeave: hideVolumeSlider }) }))] })), jsxRuntime.jsx("button", Object.assign({ className: `${controlsClasses}--fullscreen ${showposter ? "" : "show"}`, onClick: toggleFullscreen }, { children: jsxRuntime.jsx("span", { children: controls && controls.fullscreen }) }))] }))] })));
|
|
2052
2062
|
};
|
|
2053
2063
|
|
|
2054
2064
|
exports.VideoPlayer = VideoPlayer;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var classNames = require('classnames');
|
|
5
5
|
var hooks_useGlobalSettings = require('../../hooks/useGlobalSettings.js');
|
|
6
|
-
var components_Video_VideoPlayer = require('../../VideoPlayer-
|
|
6
|
+
var components_Video_VideoPlayer = require('../../VideoPlayer-e2de3674.js');
|
|
7
7
|
require('tslib');
|
|
8
8
|
require('react');
|
|
9
9
|
require('../../GlobalCtx-97e4b433.js');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
require('react/jsx-runtime');
|
|
4
4
|
require('react');
|
|
5
|
-
var components_Video_VideoPlayer = require('../../VideoPlayer-
|
|
5
|
+
var components_Video_VideoPlayer = require('../../VideoPlayer-e2de3674.js');
|
|
6
6
|
require('react-dom');
|
|
7
7
|
require('classnames');
|
|
8
8
|
require('../../hooks/useGlobalSettings.js');
|
|
@@ -7,7 +7,7 @@ require('../../hooks/useGlobalSettings.js');
|
|
|
7
7
|
require('tslib');
|
|
8
8
|
require('react');
|
|
9
9
|
require('../../GlobalCtx-97e4b433.js');
|
|
10
|
-
require('../../VideoPlayer-
|
|
10
|
+
require('../../VideoPlayer-e2de3674.js');
|
|
11
11
|
require('../../index-0af02e81.js');
|
|
12
12
|
require('react-dom');
|
|
13
13
|
require('../../utils/hoursMinutesSeconds.js');
|
|
@@ -73,7 +73,7 @@ require('./Hero/HeroCard.js');
|
|
|
73
73
|
require('./SocialMedia/SocialMedia.js');
|
|
74
74
|
require('./Input/Input.js');
|
|
75
75
|
require('./FormElement/FormElement.js');
|
|
76
|
-
require('../VideoPlayer-
|
|
76
|
+
require('../VideoPlayer-e2de3674.js');
|
|
77
77
|
require('../utils/hoursMinutesSeconds.js');
|
|
78
78
|
require('screenfull');
|
|
79
79
|
require('@ilo-org/icons-react');
|
package/lib/cjs/index.js
CHANGED
|
@@ -74,7 +74,7 @@ require('./components/Hero/HeroCard.js');
|
|
|
74
74
|
require('./components/SocialMedia/SocialMedia.js');
|
|
75
75
|
require('./components/Input/Input.js');
|
|
76
76
|
require('./components/FormElement/FormElement.js');
|
|
77
|
-
require('./VideoPlayer-
|
|
77
|
+
require('./VideoPlayer-e2de3674.js');
|
|
78
78
|
require('./utils/hoursMinutesSeconds.js');
|
|
79
79
|
require('screenfull');
|
|
80
80
|
require('./components/Logo/Logo.js');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-
|
|
1
|
+
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-b5d125fd.js';
|
|
2
2
|
import require$$0 from 'react';
|
|
3
3
|
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-
|
|
1
|
+
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-b5d125fd.js';
|
|
2
2
|
import require$$0 from 'react';
|
|
3
3
|
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-
|
|
1
|
+
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-b5d125fd.js';
|
|
2
2
|
import require$$0 from 'react';
|
|
3
3
|
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-
|
|
1
|
+
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-b5d125fd.js';
|
|
2
2
|
import require$$0 from 'react';
|
|
3
3
|
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-
|
|
1
|
+
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-b5d125fd.js';
|
|
2
2
|
import require$$0 from 'react';
|
|
3
3
|
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-
|
|
1
|
+
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-b5d125fd.js';
|
|
2
2
|
import require$$0 from 'react';
|
|
3
3
|
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-
|
|
1
|
+
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-b5d125fd.js';
|
|
2
2
|
import require$$0 from 'react';
|
|
3
3
|
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-
|
|
1
|
+
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-b5d125fd.js';
|
|
2
2
|
import require$$0 from 'react';
|
|
3
3
|
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import require$$0, { useState, createRef } from 'react';
|
|
2
|
+
import require$$0, { useState, createRef, useCallback } from 'react';
|
|
3
3
|
import { p as propTypes$1 } from './index-623ce3f5.js';
|
|
4
4
|
import { findDOMNode } from 'react-dom';
|
|
5
5
|
import classNames from 'classnames';
|
|
@@ -632,7 +632,7 @@ patterns.canPlay = canPlay;
|
|
|
632
632
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
633
633
|
return import(
|
|
634
634
|
/* webpackChunkName: 'reactPlayerYouTube' */
|
|
635
|
-
'./YouTube-
|
|
635
|
+
'./YouTube-2e7e24ca.js').then(function (n) { return n.Y; });
|
|
636
636
|
})
|
|
637
637
|
}, {
|
|
638
638
|
key: 'soundcloud',
|
|
@@ -641,7 +641,7 @@ patterns.canPlay = canPlay;
|
|
|
641
641
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
642
642
|
return import(
|
|
643
643
|
/* webpackChunkName: 'reactPlayerSoundCloud' */
|
|
644
|
-
'./SoundCloud-
|
|
644
|
+
'./SoundCloud-78094ae3.js').then(function (n) { return n.S; });
|
|
645
645
|
})
|
|
646
646
|
}, {
|
|
647
647
|
key: 'vimeo',
|
|
@@ -650,7 +650,7 @@ patterns.canPlay = canPlay;
|
|
|
650
650
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
651
651
|
return import(
|
|
652
652
|
/* webpackChunkName: 'reactPlayerVimeo' */
|
|
653
|
-
'./Vimeo-
|
|
653
|
+
'./Vimeo-dd76c909.js').then(function (n) { return n.V; });
|
|
654
654
|
})
|
|
655
655
|
}, {
|
|
656
656
|
key: 'facebook',
|
|
@@ -659,7 +659,7 @@ patterns.canPlay = canPlay;
|
|
|
659
659
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
660
660
|
return import(
|
|
661
661
|
/* webpackChunkName: 'reactPlayerFacebook' */
|
|
662
|
-
'./Facebook-
|
|
662
|
+
'./Facebook-4a2334f4.js').then(function (n) { return n.F; });
|
|
663
663
|
})
|
|
664
664
|
}, {
|
|
665
665
|
key: 'streamable',
|
|
@@ -668,7 +668,7 @@ patterns.canPlay = canPlay;
|
|
|
668
668
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
669
669
|
return import(
|
|
670
670
|
/* webpackChunkName: 'reactPlayerStreamable' */
|
|
671
|
-
'./Streamable-
|
|
671
|
+
'./Streamable-44c36485.js').then(function (n) { return n.S; });
|
|
672
672
|
})
|
|
673
673
|
}, {
|
|
674
674
|
key: 'wistia',
|
|
@@ -677,7 +677,7 @@ patterns.canPlay = canPlay;
|
|
|
677
677
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
678
678
|
return import(
|
|
679
679
|
/* webpackChunkName: 'reactPlayerWistia' */
|
|
680
|
-
'./Wistia-
|
|
680
|
+
'./Wistia-d98e9e9e.js').then(function (n) { return n.W; });
|
|
681
681
|
})
|
|
682
682
|
}, {
|
|
683
683
|
key: 'twitch',
|
|
@@ -686,7 +686,7 @@ patterns.canPlay = canPlay;
|
|
|
686
686
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
687
687
|
return import(
|
|
688
688
|
/* webpackChunkName: 'reactPlayerTwitch' */
|
|
689
|
-
'./Twitch-
|
|
689
|
+
'./Twitch-cec3b85d.js').then(function (n) { return n.T; });
|
|
690
690
|
})
|
|
691
691
|
}, {
|
|
692
692
|
key: 'dailymotion',
|
|
@@ -695,7 +695,7 @@ patterns.canPlay = canPlay;
|
|
|
695
695
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
696
696
|
return import(
|
|
697
697
|
/* webpackChunkName: 'reactPlayerDailyMotion' */
|
|
698
|
-
'./DailyMotion-
|
|
698
|
+
'./DailyMotion-2e38ef76.js').then(function (n) { return n.D; });
|
|
699
699
|
})
|
|
700
700
|
}, {
|
|
701
701
|
key: 'mixcloud',
|
|
@@ -704,7 +704,7 @@ patterns.canPlay = canPlay;
|
|
|
704
704
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
705
705
|
return import(
|
|
706
706
|
/* webpackChunkName: 'reactPlayerMixcloud' */
|
|
707
|
-
'./Mixcloud-
|
|
707
|
+
'./Mixcloud-b0f9376b.js').then(function (n) { return n.M; });
|
|
708
708
|
})
|
|
709
709
|
}, {
|
|
710
710
|
key: 'vidyard',
|
|
@@ -713,7 +713,7 @@ patterns.canPlay = canPlay;
|
|
|
713
713
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
714
714
|
return import(
|
|
715
715
|
/* webpackChunkName: 'reactPlayerVidyard' */
|
|
716
|
-
'./Vidyard-
|
|
716
|
+
'./Vidyard-44d40c02.js').then(function (n) { return n.V; });
|
|
717
717
|
})
|
|
718
718
|
}, {
|
|
719
719
|
key: 'kaltura',
|
|
@@ -722,7 +722,7 @@ patterns.canPlay = canPlay;
|
|
|
722
722
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
723
723
|
return import(
|
|
724
724
|
/* webpackChunkName: 'reactPlayerKaltura' */
|
|
725
|
-
'./Kaltura-
|
|
725
|
+
'./Kaltura-c80bdfb7.js').then(function (n) { return n.K; });
|
|
726
726
|
})
|
|
727
727
|
}, {
|
|
728
728
|
key: 'file',
|
|
@@ -734,7 +734,7 @@ patterns.canPlay = canPlay;
|
|
|
734
734
|
lazyPlayer: /*#__PURE__*/(0, _react.lazy)(function () {
|
|
735
735
|
return import(
|
|
736
736
|
/* webpackChunkName: 'reactPlayerFilePlayer' */
|
|
737
|
-
'./FilePlayer-
|
|
737
|
+
'./FilePlayer-40e1ae01.js').then(function (n) { return n.F; });
|
|
738
738
|
})
|
|
739
739
|
}];
|
|
740
740
|
exports["default"] = _default;
|
|
@@ -1659,7 +1659,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
1659
1659
|
var Preview = /*#__PURE__*/(0, _react.lazy)(function () {
|
|
1660
1660
|
return import(
|
|
1661
1661
|
/* webpackChunkName: 'reactPlayerPreview' */
|
|
1662
|
-
'./Preview-
|
|
1662
|
+
'./Preview-07219fbc.js').then(function (n) { return n.P; });
|
|
1663
1663
|
});
|
|
1664
1664
|
var IS_BROWSER = typeof window !== 'undefined' && window.document;
|
|
1665
1665
|
var IS_GLOBAL = typeof commonjsGlobal !== 'undefined' && commonjsGlobal.window && commonjsGlobal.window.document;
|
|
@@ -2041,12 +2041,22 @@ const VideoPlayer = ({ controls, src, poster, youtube, tracks, }) => {
|
|
|
2041
2041
|
setPlaying(false);
|
|
2042
2042
|
setSeeking(false);
|
|
2043
2043
|
};
|
|
2044
|
+
const handlePlayHover = useCallback((event, state) => {
|
|
2045
|
+
const element = event.currentTarget;
|
|
2046
|
+
if (!element.classList.contains(`${controlsClasses}--play`)) {
|
|
2047
|
+
return;
|
|
2048
|
+
}
|
|
2049
|
+
const duration = element.previousSibling;
|
|
2050
|
+
if (duration instanceof HTMLLabelElement) {
|
|
2051
|
+
duration.classList.toggle(`${controlsClasses}--duration--hovered`, state);
|
|
2052
|
+
}
|
|
2053
|
+
}, [controlsClasses]);
|
|
2044
2054
|
return (jsxs("div", Object.assign({ className: `${baseClass}--container`, ref: videoContainer }, { children: [jsx(ReactPlayer, { className: playerClasses, config: playerconfig, loop: false, muted: muted, playing: playing, ref: videoElement, url: src, width: "100%", height: "100%", progressInterval: 30, volume: volume, onProgress: handleProgress, onDuration: handleDuration, onEnded: handleEnded }), jsxs("picture", Object.assign({ className: `${baseClass}--poster ${showposter ? "show" : ""}` }, { children: [(poster === null || poster === void 0 ? void 0 : poster.url) &&
|
|
2045
2055
|
poster.url
|
|
2046
2056
|
.sort((a, b) => parseFloat(a.breakpoint) - parseFloat(b.breakpoint))
|
|
2047
2057
|
.slice(1)
|
|
2048
2058
|
.reverse()
|
|
2049
|
-
.map((item, index) => (jsx("source", { srcSet: item.src, media: `(min-width: ${item.breakpoint}px)` }, index))), jsx("img", { src: (_a = poster === null || poster === void 0 ? void 0 : poster.url[0]) === null || _a === void 0 ? void 0 : _a.src, alt: poster === null || poster === void 0 ? void 0 : poster.alt })] })), jsxs("div", Object.assign({ className: `${controlsClasses} ${showposter ? "notplayed" : ""}` }, { children: [jsx("label", Object.assign({ className: `${controlsClasses}--duration ${showposter ? "show" : ""}` }, { children: duration })), jsx("button", Object.assign({ className: `${controlsClasses}--${!playing ? "play" : "pause"}`, onClick: togglePlay }, { children: jsx("span", { children: !playing ? controls && controls.play : controls && controls.pause }) })), jsxs("div", Object.assign({ className: `${controlsClasses}--progress ${showposter ? "" : "show"}` }, { children: [jsx("input", { type: "range", min: 0, max: 0.999999, step: "any", value: playhead, onMouseDown: handleSeekMouseDown, onChange: handleSeekChange, onMouseUp: handleSeekMouseUp, className: `${controlsClasses}--progress-playhead` }), jsx("progress", { className: `${controlsClasses}--progress-current`, max: 1, value: playhead }), jsx("progress", { className: `${controlsClasses}--progress-loaded`, max: 1, value: buffer }), jsx("div", Object.assign({ className: `${controlsClasses}--progress-played-container` }, { children: jsx("label", Object.assign({ className: `${controlsClasses}--progress-played`, style: { ["--playhead"]: `${playhead * 100}%` } }, { children: playedtime })) }))] })), jsxs("div", Object.assign({ className: `${controlsClasses}--volume ${showposter ? "" : "show"}`, onMouseEnter: showVolumeSlider, onMouseLeave: hideVolumeSlider }, { children: [jsx("button", Object.assign({ className: `${controlsClasses}--showvolume ${muted ? "muted" : ""}`, onClick: toggleMute }, { children: jsx("span", { children: controls && controls.volume }) })), jsx("div", Object.assign({ className: `${controlsClasses}--setvolume-container` }, { children: jsx("input", { className: `${controlsClasses}--setvolume ${showvolume ? "show" : ""}`, type: "range", step: "0.5", defaultValue: volume, min: "1", max: "10", onChange: handleVolumeChange, onMouseLeave: hideVolumeSlider }) }))] })), jsx("button", Object.assign({ className: `${controlsClasses}--fullscreen ${showposter ? "" : "show"}`, onClick: toggleFullscreen }, { children: jsx("span", { children: controls && controls.fullscreen }) }))] }))] })));
|
|
2059
|
+
.map((item, index) => (jsx("source", { srcSet: item.src, media: `(min-width: ${item.breakpoint}px)` }, index))), jsx("img", { src: (_a = poster === null || poster === void 0 ? void 0 : poster.url[0]) === null || _a === void 0 ? void 0 : _a.src, alt: poster === null || poster === void 0 ? void 0 : poster.alt })] })), jsxs("div", Object.assign({ className: `${controlsClasses} ${showposter ? "notplayed" : ""}` }, { children: [jsx("label", Object.assign({ className: `${controlsClasses}--duration ${showposter ? "show" : ""}` }, { children: duration })), jsx("button", Object.assign({ className: `${controlsClasses}--${!playing ? "play" : "pause"}`, onClick: togglePlay, onMouseOver: (e) => handlePlayHover(e, true), onFocus: (e) => handlePlayHover(e, true), onMouseOut: (e) => handlePlayHover(e, false), onBlur: (e) => handlePlayHover(e, false) }, { children: jsx("span", { children: !playing ? controls && controls.play : controls && controls.pause }) })), jsxs("div", Object.assign({ className: `${controlsClasses}--progress ${showposter ? "" : "show"}` }, { children: [jsx("input", { type: "range", min: 0, max: 0.999999, step: "any", value: playhead, onMouseDown: handleSeekMouseDown, onChange: handleSeekChange, onMouseUp: handleSeekMouseUp, className: `${controlsClasses}--progress-playhead` }), jsx("progress", { className: `${controlsClasses}--progress-current`, max: 1, value: playhead }), jsx("progress", { className: `${controlsClasses}--progress-loaded`, max: 1, value: buffer }), jsx("div", Object.assign({ className: `${controlsClasses}--progress-played-container` }, { children: jsx("label", Object.assign({ className: `${controlsClasses}--progress-played`, style: { ["--playhead"]: `${playhead * 100}%` } }, { children: playedtime })) }))] })), jsxs("div", Object.assign({ className: `${controlsClasses}--volume ${showposter ? "" : "show"}`, onMouseEnter: showVolumeSlider, onMouseLeave: hideVolumeSlider }, { children: [jsx("button", Object.assign({ className: `${controlsClasses}--showvolume ${muted ? "muted" : ""}`, onClick: toggleMute }, { children: jsx("span", { children: controls && controls.volume }) })), jsx("div", Object.assign({ className: `${controlsClasses}--setvolume-container` }, { children: jsx("input", { className: `${controlsClasses}--setvolume ${showvolume ? "show" : ""}`, type: "range", step: "0.5", defaultValue: volume, min: "1", max: "10", onChange: handleVolumeChange, onMouseLeave: hideVolumeSlider }) }))] })), jsx("button", Object.assign({ className: `${controlsClasses}--fullscreen ${showposter ? "" : "show"}`, onClick: toggleFullscreen }, { children: jsx("span", { children: controls && controls.fullscreen }) }))] }))] })));
|
|
2050
2060
|
};
|
|
2051
2061
|
|
|
2052
2062
|
export { VideoPlayer as V, getDefaultExportFromCjs as g, patterns as p, utils as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-
|
|
1
|
+
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-b5d125fd.js';
|
|
2
2
|
import require$$0 from 'react';
|
|
3
3
|
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-
|
|
1
|
+
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-b5d125fd.js';
|
|
2
2
|
import require$$0 from 'react';
|
|
3
3
|
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-
|
|
1
|
+
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-b5d125fd.js';
|
|
2
2
|
import require$$0 from 'react';
|
|
3
3
|
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-
|
|
1
|
+
import { g as getDefaultExportFromCjs, p as patterns, u as utils } from './VideoPlayer-b5d125fd.js';
|
|
2
2
|
import require$$0 from 'react';
|
|
3
3
|
|
|
4
4
|
function _mergeNamespaces(n, m) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import useGlobalSettings from '../../hooks/useGlobalSettings.js';
|
|
4
|
-
import { V as VideoPlayer } from '../../VideoPlayer-
|
|
4
|
+
import { V as VideoPlayer } from '../../VideoPlayer-b5d125fd.js';
|
|
5
5
|
import 'tslib';
|
|
6
6
|
import 'react';
|
|
7
7
|
import '../../GlobalCtx-7fb23cfa.js';
|
|
@@ -5,7 +5,7 @@ import '../../hooks/useGlobalSettings.js';
|
|
|
5
5
|
import 'tslib';
|
|
6
6
|
import 'react';
|
|
7
7
|
import '../../GlobalCtx-7fb23cfa.js';
|
|
8
|
-
import '../../VideoPlayer-
|
|
8
|
+
import '../../VideoPlayer-b5d125fd.js';
|
|
9
9
|
import '../../index-623ce3f5.js';
|
|
10
10
|
import 'react-dom';
|
|
11
11
|
import '../../utils/hoursMinutesSeconds.js';
|
|
@@ -71,7 +71,7 @@ import './Hero/HeroCard.js';
|
|
|
71
71
|
import './SocialMedia/SocialMedia.js';
|
|
72
72
|
import './Input/Input.js';
|
|
73
73
|
import './FormElement/FormElement.js';
|
|
74
|
-
import '../VideoPlayer-
|
|
74
|
+
import '../VideoPlayer-b5d125fd.js';
|
|
75
75
|
import '../utils/hoursMinutesSeconds.js';
|
|
76
76
|
import 'screenfull';
|
|
77
77
|
import '@ilo-org/icons-react';
|
package/lib/esm/index.js
CHANGED
|
@@ -72,7 +72,7 @@ import './components/Hero/HeroCard.js';
|
|
|
72
72
|
import './components/SocialMedia/SocialMedia.js';
|
|
73
73
|
import './components/Input/Input.js';
|
|
74
74
|
import './components/FormElement/FormElement.js';
|
|
75
|
-
import './VideoPlayer-
|
|
75
|
+
import './VideoPlayer-b5d125fd.js';
|
|
76
76
|
import './utils/hoursMinutesSeconds.js';
|
|
77
77
|
import 'screenfull';
|
|
78
78
|
import './components/Logo/Logo.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ilo-org/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0-next.3",
|
|
4
4
|
"description": "React components for the ILO's Design System",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui_patterns",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"@ilo-org/brand-assets": "0.2.0",
|
|
77
77
|
"@ilo-org/fonts": "0.1.2",
|
|
78
78
|
"@ilo-org/icons-react": "0.0.21",
|
|
79
|
-
"@ilo-org/styles": "0.11.3-next.
|
|
79
|
+
"@ilo-org/styles": "0.11.3-next.3",
|
|
80
80
|
"@ilo-org/themes": "0.7.0-next.0",
|
|
81
81
|
"@ilo-org/utils": "0.0.11"
|
|
82
82
|
},
|
|
@@ -126,6 +126,7 @@
|
|
|
126
126
|
"screenfull": "^5.2.0",
|
|
127
127
|
"storybook": "7.5.0-alpha.1",
|
|
128
128
|
"storybook-addon-performance": "^0.17.1",
|
|
129
|
+
"storybook-addon-rtl-direction": "^0.0.19",
|
|
129
130
|
"ts-dedent": "^2.2.0",
|
|
130
131
|
"ts-jest": "^29.1.1",
|
|
131
132
|
"tslib": "^2.3.1",
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
FC,
|
|
3
|
+
FocusEvent,
|
|
4
|
+
MouseEvent,
|
|
5
|
+
createRef,
|
|
6
|
+
useCallback,
|
|
7
|
+
useState,
|
|
8
|
+
} from "react";
|
|
2
9
|
/* temporary way of importing ReactPlayer due to a known issue with ReactPlayer.
|
|
3
10
|
* Revert to standard method of importing once RP's dev has fixed.
|
|
4
11
|
*/
|
|
@@ -166,6 +173,27 @@ const VideoPlayer: FC<VideoPlayerProps> = ({
|
|
|
166
173
|
setSeeking(false);
|
|
167
174
|
};
|
|
168
175
|
|
|
176
|
+
const handlePlayHover = useCallback(
|
|
177
|
+
(
|
|
178
|
+
event: MouseEvent<HTMLButtonElement> | FocusEvent<HTMLButtonElement>,
|
|
179
|
+
state: boolean
|
|
180
|
+
) => {
|
|
181
|
+
const element = event.currentTarget;
|
|
182
|
+
if (!element.classList.contains(`${controlsClasses}--play`)) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const duration = element.previousSibling;
|
|
187
|
+
if (duration instanceof HTMLLabelElement) {
|
|
188
|
+
duration.classList.toggle(
|
|
189
|
+
`${controlsClasses}--duration--hovered`,
|
|
190
|
+
state
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
[controlsClasses]
|
|
195
|
+
);
|
|
196
|
+
|
|
169
197
|
return (
|
|
170
198
|
<div
|
|
171
199
|
className={`${baseClass}--container`}
|
|
@@ -214,6 +242,10 @@ const VideoPlayer: FC<VideoPlayerProps> = ({
|
|
|
214
242
|
<button
|
|
215
243
|
className={`${controlsClasses}--${!playing ? "play" : "pause"}`}
|
|
216
244
|
onClick={togglePlay}
|
|
245
|
+
onMouseOver={(e) => handlePlayHover(e, true)}
|
|
246
|
+
onFocus={(e) => handlePlayHover(e, true)}
|
|
247
|
+
onMouseOut={(e) => handlePlayHover(e, false)}
|
|
248
|
+
onBlur={(e) => handlePlayHover(e, false)}
|
|
217
249
|
>
|
|
218
250
|
<span>
|
|
219
251
|
{!playing ? controls && controls.play : controls && controls.pause}
|