luna-one 3.1.494 → 3.1.496
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.
|
@@ -11,12 +11,19 @@ var _interopRequireWildcard2 = _interopRequireDefault(require("@babel/runtime/he
|
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
13
|
|
|
14
|
-
var _terraOne = _interopRequireDefault(require("terra-one"));
|
|
15
|
-
|
|
16
14
|
var _component = _interopRequireDefault(require("@loadable/component"));
|
|
17
15
|
|
|
18
16
|
var _generateFocusedImageAlt = _interopRequireDefault(require("../../utils/generateFocusedImageAlt"));
|
|
19
17
|
|
|
18
|
+
var Button = (0, _component["default"])(function () {
|
|
19
|
+
return Promise.resolve().then(function () {
|
|
20
|
+
return (0, _interopRequireWildcard2["default"])(require("terra-one"));
|
|
21
|
+
});
|
|
22
|
+
}, {
|
|
23
|
+
resolveComponent: function resolveComponent(components) {
|
|
24
|
+
return components.Button;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
20
27
|
var FocusedImage = (0, _component["default"])(function () {
|
|
21
28
|
return Promise.resolve().then(function () {
|
|
22
29
|
return (0, _interopRequireWildcard2["default"])(require("terra-one"));
|
|
@@ -110,7 +117,7 @@ var renderModal = function renderModal(modalType, imageSizes, modalContent, moda
|
|
|
110
117
|
};
|
|
111
118
|
|
|
112
119
|
var renderButton = function renderButton(buttonContent, Link) {
|
|
113
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
120
|
+
return /*#__PURE__*/_react["default"].createElement(Button, {
|
|
114
121
|
name: (buttonContent === null || buttonContent === void 0 ? void 0 : buttonContent.name) || null,
|
|
115
122
|
text: (buttonContent === null || buttonContent === void 0 ? void 0 : buttonContent.text) || null,
|
|
116
123
|
className: (buttonContent === null || buttonContent === void 0 ? void 0 : buttonContent.type) || "ter-button--primary--1",
|
|
@@ -9,10 +9,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
9
9
|
});
|
|
10
10
|
exports.isVidyardReady = exports.imageSizes = exports.getThumbnailSrc = exports.getThumbnailAlt = exports.getReactPlayerClassName = exports.getModalClassName = exports.deployModalOnEnter = exports["default"] = void 0;
|
|
11
11
|
|
|
12
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
13
|
-
|
|
14
12
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
15
13
|
|
|
14
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/slicedToArray"));
|
|
15
|
+
|
|
16
16
|
var _interopRequireWildcard2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/interopRequireWildcard"));
|
|
17
17
|
|
|
18
18
|
var _react = _interopRequireWildcard3(require("react"));
|
|
@@ -436,8 +436,20 @@ var renderVideo = function renderVideo(video, thumbnail, hovering, modalDeployed
|
|
|
436
436
|
var setOverride = arguments.length > 19 ? arguments[19] : undefined;
|
|
437
437
|
var setVisible = arguments.length > 20 ? arguments[20] : undefined;
|
|
438
438
|
|
|
439
|
+
var _useState = (0, _react.useState)(true),
|
|
440
|
+
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
441
|
+
isPaused = _useState2[0],
|
|
442
|
+
setIsPaused = _useState2[1];
|
|
443
|
+
|
|
444
|
+
var _useState3 = (0, _react.useState)(0),
|
|
445
|
+
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
446
|
+
playedSeconds = _useState4[0],
|
|
447
|
+
setPlayedSeconds = _useState4[1];
|
|
448
|
+
|
|
449
|
+
var player = (0, _react.useRef)(_react["default"].ReactPlayer);
|
|
450
|
+
|
|
439
451
|
if (video && thumbnail && !image && modalDeployed) {
|
|
440
|
-
var _content$video, _content$video$url, _content$video2, _content$video3, _content$video3$url, _content$video4, _content$video5, _content$video6, _content$
|
|
452
|
+
var _content$video, _content$video$url, _content$video2, _content$video3, _content$video3$url, _content$video4, _content$video5, _content$video6, _content$video8;
|
|
441
453
|
|
|
442
454
|
var type;
|
|
443
455
|
|
|
@@ -466,7 +478,20 @@ var renderVideo = function renderVideo(video, thumbnail, hovering, modalDeployed
|
|
|
466
478
|
}
|
|
467
479
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
468
480
|
className: "luna-super-hero__video-close-wrapper",
|
|
469
|
-
onClick: function onClick() {
|
|
481
|
+
onClick: function onClick(event) {
|
|
482
|
+
if (type === "youtube" || type === "vimeo") {
|
|
483
|
+
var _player$current, _content$video7;
|
|
484
|
+
|
|
485
|
+
setVideoProgress({
|
|
486
|
+
type: type,
|
|
487
|
+
eventType: event,
|
|
488
|
+
playedSeconds: playedSeconds,
|
|
489
|
+
video_action: isPaused ? "paused" : "on-going",
|
|
490
|
+
length: player === null || player === void 0 ? void 0 : (_player$current = player.current) === null || _player$current === void 0 ? void 0 : _player$current.getDuration(),
|
|
491
|
+
title: content === null || content === void 0 ? void 0 : (_content$video7 = content.video) === null || _content$video7 === void 0 ? void 0 : _content$video7.videoTitle
|
|
492
|
+
});
|
|
493
|
+
}
|
|
494
|
+
|
|
470
495
|
if (override) {
|
|
471
496
|
setOverride(false);
|
|
472
497
|
|
|
@@ -484,16 +509,20 @@ var renderVideo = function renderVideo(video, thumbnail, hovering, modalDeployed
|
|
|
484
509
|
className: "luna-super-hero__close-button"
|
|
485
510
|
})), /*#__PURE__*/_react["default"].createElement("div", {
|
|
486
511
|
className: getReactPlayerClassName(content === null || content === void 0 ? void 0 : content.vidyard, modalDeployed)
|
|
487
|
-
}, (content === null || content === void 0 ? void 0 : content.video) && !(content !== null && content !== void 0 && (_content$
|
|
512
|
+
}, (content === null || content === void 0 ? void 0 : content.video) && !(content !== null && content !== void 0 && (_content$video8 = content.video) !== null && _content$video8 !== void 0 && _content$video8.vidyard) && modalDeployed && /*#__PURE__*/_react["default"].createElement(ReactPlayer, {
|
|
513
|
+
ref: player,
|
|
488
514
|
url: content.video.url,
|
|
489
515
|
onProgress: function onProgress(videoProgress) {
|
|
490
|
-
var _content$
|
|
516
|
+
var _player$current2, _content$video9;
|
|
491
517
|
|
|
492
518
|
setVideoProgress((0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
493
519
|
type: type
|
|
494
520
|
}, videoProgress), {}, {
|
|
495
|
-
|
|
521
|
+
video_action: isPaused ? "paused" : "on-going",
|
|
522
|
+
length: player === null || player === void 0 ? void 0 : (_player$current2 = player.current) === null || _player$current2 === void 0 ? void 0 : _player$current2.getDuration(),
|
|
523
|
+
title: content === null || content === void 0 ? void 0 : (_content$video9 = content.video) === null || _content$video9 === void 0 ? void 0 : _content$video9.videoTitle
|
|
496
524
|
}));
|
|
525
|
+
setPlayedSeconds(videoProgress === null || videoProgress === void 0 ? void 0 : videoProgress.playedSeconds);
|
|
497
526
|
},
|
|
498
527
|
width: "100%",
|
|
499
528
|
height: "100%",
|
|
@@ -502,10 +531,12 @@ var renderVideo = function renderVideo(video, thumbnail, hovering, modalDeployed
|
|
|
502
531
|
onStart: function onStart() {
|
|
503
532
|
togglePlaying(true);
|
|
504
533
|
},
|
|
505
|
-
onPlay: function onPlay() {
|
|
534
|
+
onPlay: function onPlay(videoProgress) {
|
|
535
|
+
setIsPaused(false);
|
|
506
536
|
togglePlaying(true);
|
|
507
537
|
},
|
|
508
|
-
onPause: function onPause() {
|
|
538
|
+
onPause: function onPause(videoProgress) {
|
|
539
|
+
setIsPaused(true);
|
|
509
540
|
togglePlaying(false);
|
|
510
541
|
},
|
|
511
542
|
onEnded: function onEnded() {
|
|
@@ -521,7 +552,9 @@ var renderVideo = function renderVideo(video, thumbnail, hovering, modalDeployed
|
|
|
521
552
|
video: content === null || content === void 0 ? void 0 : content.video,
|
|
522
553
|
videoProgress: videoProgress,
|
|
523
554
|
setVideoProgress: setVideoProgress,
|
|
524
|
-
type: type
|
|
555
|
+
type: type,
|
|
556
|
+
setIsPaused: setIsPaused,
|
|
557
|
+
isPaused: isPaused
|
|
525
558
|
})), transcript && transcriptText && /*#__PURE__*/_react["default"].createElement("div", {
|
|
526
559
|
className: "luna-super-hero__transcript-wrapper luna-super-hero__transcript-wrapper--".concat(isVidyardReady(video, modalDeployed))
|
|
527
560
|
}, transcript && !transcriptVisable && /*#__PURE__*/_react["default"].createElement("p", {
|
|
@@ -628,10 +661,10 @@ var VideoComponent = function VideoComponent(_ref) {
|
|
|
628
661
|
deployModal();
|
|
629
662
|
}
|
|
630
663
|
|
|
631
|
-
var
|
|
632
|
-
|
|
633
|
-
transcriptVisable =
|
|
634
|
-
setTranscriptVisable =
|
|
664
|
+
var _useState5 = (0, _react.useState)(false),
|
|
665
|
+
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
666
|
+
transcriptVisable = _useState6[0],
|
|
667
|
+
setTranscriptVisable = _useState6[1];
|
|
635
668
|
|
|
636
669
|
var _useMouse = (0, _useMouse2["default"])(),
|
|
637
670
|
mouse = _useMouse.mouse;
|
|
@@ -58,7 +58,6 @@ var VidyardModal = /*#__PURE__*/function (_Component) {
|
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
_this.state = {};
|
|
62
61
|
return _this;
|
|
63
62
|
}
|
|
64
63
|
|
|
@@ -72,27 +71,51 @@ var VidyardModal = /*#__PURE__*/function (_Component) {
|
|
|
72
71
|
value: function componentWillUnmount() {
|
|
73
72
|
this.removeVideo();
|
|
74
73
|
}
|
|
74
|
+
}, {
|
|
75
|
+
key: "componentWillUpdate",
|
|
76
|
+
value: function componentWillUpdate() {
|
|
77
|
+
this.registerProgressEvents(_embedCode["default"]);
|
|
78
|
+
}
|
|
75
79
|
}, {
|
|
76
80
|
key: "registerProgressEvents",
|
|
77
81
|
value: function registerProgressEvents(VidyardEmbed) {
|
|
78
82
|
var _this2 = this;
|
|
79
83
|
|
|
84
|
+
var paused = true;
|
|
80
85
|
VidyardEmbed.api.progressEvents(function (_ref) {
|
|
81
|
-
var _this2$
|
|
86
|
+
var _this2$props3, _player$metadata2, _this2$props4;
|
|
82
87
|
|
|
83
88
|
var chapter = _ref.chapter,
|
|
84
89
|
event = _ref.event,
|
|
85
90
|
player = _ref.player;
|
|
91
|
+
player === null || player === void 0 ? void 0 : player.on("pause", function () {
|
|
92
|
+
var _this2$props, _player$metadata, _this2$props2;
|
|
93
|
+
|
|
94
|
+
paused = true;
|
|
95
|
+
_this2 === null || _this2 === void 0 ? void 0 : (_this2$props = _this2.props) === null || _this2$props === void 0 ? void 0 : _this2$props.setVideoProgress({
|
|
96
|
+
playedPercentage: event,
|
|
97
|
+
id: player === null || player === void 0 ? void 0 : player.uuid,
|
|
98
|
+
name: player === null || player === void 0 ? void 0 : (_player$metadata = player.metadata) === null || _player$metadata === void 0 ? void 0 : _player$metadata.name,
|
|
99
|
+
video_action: "paused",
|
|
100
|
+
videoProvider: "vidyard",
|
|
101
|
+
type: (_this2$props2 = _this2.props) === null || _this2$props2 === void 0 ? void 0 : _this2$props2.type,
|
|
102
|
+
title: _this2.props.video.videoTitle
|
|
103
|
+
});
|
|
104
|
+
});
|
|
105
|
+
player === null || player === void 0 ? void 0 : player.on("play", function () {
|
|
106
|
+
paused = false;
|
|
107
|
+
});
|
|
86
108
|
var name = player.metadata.chapters_attributes[chapter].video_attributes.name;
|
|
87
|
-
_this2 === null || _this2 === void 0 ? void 0 : (_this2$
|
|
109
|
+
_this2 === null || _this2 === void 0 ? void 0 : (_this2$props3 = _this2.props) === null || _this2$props3 === void 0 ? void 0 : _this2$props3.setVideoProgress({
|
|
88
110
|
playedPercentage: event,
|
|
89
111
|
id: player === null || player === void 0 ? void 0 : player.uuid,
|
|
90
|
-
name: player === null || player === void 0 ? void 0 : (_player$
|
|
112
|
+
name: player === null || player === void 0 ? void 0 : (_player$metadata2 = player.metadata) === null || _player$metadata2 === void 0 ? void 0 : _player$metadata2.name,
|
|
113
|
+
video_action: "on-going",
|
|
91
114
|
videoProvider: "vidyard",
|
|
92
|
-
type: (_this2$
|
|
115
|
+
type: (_this2$props4 = _this2.props) === null || _this2$props4 === void 0 ? void 0 : _this2$props4.type,
|
|
93
116
|
title: _this2.props.video.videoTitle
|
|
94
117
|
});
|
|
95
|
-
});
|
|
118
|
+
}, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100]);
|
|
96
119
|
}
|
|
97
120
|
}, {
|
|
98
121
|
key: "render",
|