@fonixtree/magic-design 0.0.160 → 0.0.162
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/es/common/ImageModal/index.js +9 -37
- package/es/common/SwiperBan/index.less +1 -1
- package/es/common/Video/index.js +79 -19
- package/es/common/Video/index.less +14 -0
- package/es/composite-comp/bol/components/Banner/defaultJSON.js +2 -6
- package/es/composite-comp/bol/components/Video/components/VideoTag/index.js +3 -1
- package/es/composite-comp/bol/components/Video/components/VideoTag/index.less +4 -0
- package/es/composite-comp/bol/components/Video/defaultJSON.js +4 -8
- package/es/composite-comp/bol/components/Video/mobile/Layout1/index.js +30 -21
- package/es/composite-comp/bol/components/Video/mobile/Layout2/index.js +29 -21
- package/es/composite-comp/bol/components/Video/mobile/Layout2/index.less +1 -1
- package/es/composite-comp/bol/components/Video/mobile/Layout3/index.js +30 -21
- package/es/composite-comp/bol/components/Video/mobile/Layout3/index.less +2 -2
- package/es/composite-comp/bol/components/Video/pc/Layout1/index.js +30 -21
- package/es/composite-comp/bol/components/Video/pc/Layout2/index.js +41 -40
- package/es/composite-comp/bol/components/Video/pc/Layout3/index.js +33 -24
- package/es/composite-comp/bol/components/Video/pc/Layout4/index.js +30 -21
- package/es/composite-comp/bol/components/Video/pc/Layout5/index.js +30 -21
- package/es/core/Designer/PageCompList/index.js +34 -14
- package/es/utils/commonUtil.js +27 -2
- package/lib/common/ImageModal/index.js +9 -37
- package/lib/common/SwiperBan/index.less +1 -1
- package/lib/common/Video/index.js +79 -19
- package/lib/common/Video/index.less +14 -0
- package/lib/composite-comp/bol/components/Banner/defaultJSON.js +2 -6
- package/lib/composite-comp/bol/components/Video/components/VideoTag/index.js +3 -1
- package/lib/composite-comp/bol/components/Video/components/VideoTag/index.less +4 -0
- package/lib/composite-comp/bol/components/Video/defaultJSON.js +4 -8
- package/lib/composite-comp/bol/components/Video/mobile/Layout1/index.js +30 -21
- package/lib/composite-comp/bol/components/Video/mobile/Layout2/index.js +29 -21
- package/lib/composite-comp/bol/components/Video/mobile/Layout2/index.less +1 -1
- package/lib/composite-comp/bol/components/Video/mobile/Layout3/index.js +30 -21
- package/lib/composite-comp/bol/components/Video/mobile/Layout3/index.less +2 -2
- package/lib/composite-comp/bol/components/Video/pc/Layout1/index.js +30 -21
- package/lib/composite-comp/bol/components/Video/pc/Layout2/index.js +41 -40
- package/lib/composite-comp/bol/components/Video/pc/Layout3/index.js +33 -24
- package/lib/composite-comp/bol/components/Video/pc/Layout4/index.js +30 -21
- package/lib/composite-comp/bol/components/Video/pc/Layout5/index.js +30 -21
- package/lib/core/Designer/PageCompList/index.js +34 -14
- package/lib/utils/commonUtil.js +27 -2
- package/package.json +1 -1
|
@@ -427,46 +427,18 @@ function ImageModal(_a) {
|
|
|
427
427
|
}
|
|
428
428
|
});
|
|
429
429
|
});
|
|
430
|
-
};
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
_a.trys.push([0, 2,, 3]);
|
|
439
|
-
|
|
440
|
-
return [4
|
|
441
|
-
/*yield*/
|
|
442
|
-
, (0, _commonUtil.commonFetch)("/designer/v1/" + window.magicDesign.MBaseUrl + "/pages/platforminfo")];
|
|
430
|
+
}; // const getPreConfig = async () => {
|
|
431
|
+
// try {
|
|
432
|
+
// const { wapUrl } = await commonFetch(`/designer/v1/${window.magicDesign.MBaseUrl}/pages/platforminfo`);
|
|
433
|
+
// setWapUrl(wapUrl);
|
|
434
|
+
// } catch (error) {
|
|
435
|
+
// console.error(error);
|
|
436
|
+
// }
|
|
437
|
+
// };
|
|
443
438
|
|
|
444
|
-
case 1:
|
|
445
|
-
wapUrl_1 = _a.sent().wapUrl;
|
|
446
|
-
setWapUrl(wapUrl_1);
|
|
447
|
-
return [3
|
|
448
|
-
/*break*/
|
|
449
|
-
, 3];
|
|
450
|
-
|
|
451
|
-
case 2:
|
|
452
|
-
error_1 = _a.sent();
|
|
453
|
-
console.error(error_1);
|
|
454
|
-
return [3
|
|
455
|
-
/*break*/
|
|
456
|
-
, 3];
|
|
457
|
-
|
|
458
|
-
case 3:
|
|
459
|
-
return [2
|
|
460
|
-
/*return*/
|
|
461
|
-
];
|
|
462
|
-
}
|
|
463
|
-
});
|
|
464
|
-
});
|
|
465
|
-
};
|
|
466
439
|
|
|
467
440
|
(0, _react.useEffect)(function () {
|
|
468
|
-
getContentCatgs();
|
|
469
|
-
getPreConfig();
|
|
441
|
+
getContentCatgs(); // getPreConfig();
|
|
470
442
|
}, []);
|
|
471
443
|
|
|
472
444
|
var selectFolder = function selectFolder(id) {
|
package/es/common/Video/index.js
CHANGED
|
@@ -310,7 +310,32 @@ function (_super) {
|
|
|
310
310
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
311
311
|
|
|
312
312
|
_this.state = {};
|
|
313
|
-
_this.player =
|
|
313
|
+
_this.player = {
|
|
314
|
+
play: function play() {
|
|
315
|
+
if (_this.aliPlayer) {
|
|
316
|
+
_this.aliPlayer.play();
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
if (_this.ytPlayer) {
|
|
320
|
+
_this.ytPlayer.playVideo();
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
pause: function pause() {
|
|
324
|
+
if (_this.aliPlayer) {
|
|
325
|
+
_this.aliPlayer.play();
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
if (_this.ytPlayer) {
|
|
329
|
+
_this.ytPlayer.pauseVideo();
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
/** 阿里播放器 */
|
|
334
|
+
|
|
335
|
+
_this.aliPlayer = null;
|
|
336
|
+
/** YouTube播放器 */
|
|
337
|
+
|
|
338
|
+
_this.ytPlayer = null;
|
|
314
339
|
/** 创建视频弹框显示 */
|
|
315
340
|
|
|
316
341
|
_this.createVideoModal = function (videoId) {
|
|
@@ -352,7 +377,7 @@ function (_super) {
|
|
|
352
377
|
|
|
353
378
|
_this.getInit = function () {
|
|
354
379
|
return __awaiter(_this, void 0, void 0, function () {
|
|
355
|
-
var _a;
|
|
380
|
+
var videoId_1, _a;
|
|
356
381
|
|
|
357
382
|
var _this = this;
|
|
358
383
|
|
|
@@ -372,24 +397,60 @@ function (_super) {
|
|
|
372
397
|
_b.label = 2;
|
|
373
398
|
|
|
374
399
|
case 2:
|
|
375
|
-
if (
|
|
400
|
+
if (!!window.YT) return [3
|
|
376
401
|
/*break*/
|
|
377
402
|
, 4];
|
|
403
|
+
return [4
|
|
404
|
+
/*yield*/
|
|
405
|
+
, Promise.all([(0, _commonUtil.importAsync)('https://www.youtube.com/iframe_api', 'js')])];
|
|
406
|
+
|
|
407
|
+
case 3:
|
|
408
|
+
_b.sent();
|
|
409
|
+
|
|
410
|
+
_b.label = 4;
|
|
411
|
+
|
|
412
|
+
case 4:
|
|
413
|
+
if (!this.props.opts.source) return [3
|
|
414
|
+
/*break*/
|
|
415
|
+
, 7];
|
|
416
|
+
if (!/youtu/.test(this.props.opts.source)) return [3
|
|
417
|
+
/*break*/
|
|
418
|
+
, 5];
|
|
419
|
+
videoId_1 = this.props.opts.source.split('youtu.be/')[1];
|
|
420
|
+
(0, _commonUtil.nextTick)(function () {
|
|
421
|
+
_this.ytPlayer = new YT.Player('video' + _this.props.videoId, {
|
|
422
|
+
height: '100%',
|
|
423
|
+
width: '100%',
|
|
424
|
+
videoId: videoId_1,
|
|
425
|
+
events: {
|
|
426
|
+
onReady: function onReady() {
|
|
427
|
+
console.log('onReady');
|
|
428
|
+
},
|
|
429
|
+
onStateChange: function onStateChange() {
|
|
430
|
+
console.log('onStateChange');
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
});
|
|
434
|
+
}, 500, 10);
|
|
435
|
+
return [3
|
|
436
|
+
/*break*/
|
|
437
|
+
, 7];
|
|
438
|
+
|
|
439
|
+
case 5:
|
|
378
440
|
_a = this;
|
|
379
441
|
return [4
|
|
380
442
|
/*yield*/
|
|
381
443
|
, createVideo(this.props.videoId, this.props.opts)];
|
|
382
444
|
|
|
383
|
-
case
|
|
384
|
-
_a.
|
|
385
|
-
this.
|
|
386
|
-
if (!_this.props.opts.loop) {
|
|
387
|
-
_this.props.onPause();
|
|
445
|
+
case 6:
|
|
446
|
+
_a.aliPlayer = _b.sent();
|
|
447
|
+
this.aliPlayer.on('ended', function () {
|
|
448
|
+
if (!_this.props.opts.loop) {// this.props.onEnd();
|
|
388
449
|
}
|
|
389
450
|
});
|
|
390
|
-
_b.label =
|
|
451
|
+
_b.label = 7;
|
|
391
452
|
|
|
392
|
-
case
|
|
453
|
+
case 7:
|
|
393
454
|
return [2
|
|
394
455
|
/*return*/
|
|
395
456
|
];
|
|
@@ -398,13 +459,8 @@ function (_super) {
|
|
|
398
459
|
});
|
|
399
460
|
};
|
|
400
461
|
|
|
401
|
-
_this.fullPlay = function (
|
|
402
|
-
|
|
403
|
-
// this.player.fullscreenService.requestFullScreen();
|
|
404
|
-
// }
|
|
405
|
-
// if (type == 'pc') {
|
|
406
|
-
_this.createVideoModal(_this.props.videoId); // }
|
|
407
|
-
|
|
462
|
+
_this.fullPlay = function () {
|
|
463
|
+
_this.createVideoModal(_this.props.videoId);
|
|
408
464
|
};
|
|
409
465
|
|
|
410
466
|
return _this;
|
|
@@ -417,12 +473,16 @@ function (_super) {
|
|
|
417
473
|
AComponent.prototype.render = function () {
|
|
418
474
|
var _a = this.props,
|
|
419
475
|
videoId = _a.videoId,
|
|
420
|
-
opts = _a.opts
|
|
476
|
+
opts = _a.opts,
|
|
477
|
+
play = _a.play;
|
|
421
478
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
422
479
|
className: "video-container"
|
|
423
480
|
}, opts.source ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
481
|
+
className: "video-wrap",
|
|
424
482
|
id: 'video' + videoId
|
|
425
|
-
}) : null
|
|
483
|
+
}) : null, !play && /*#__PURE__*/_react["default"].createElement("div", {
|
|
484
|
+
className: "cover-video"
|
|
485
|
+
}));
|
|
426
486
|
};
|
|
427
487
|
|
|
428
488
|
AComponent.defaultProps = {
|
|
@@ -6,6 +6,20 @@
|
|
|
6
6
|
.prism-player .prism-cover {
|
|
7
7
|
z-index: 0;
|
|
8
8
|
}
|
|
9
|
+
|
|
10
|
+
.cover-video {
|
|
11
|
+
position: absolute;
|
|
12
|
+
left: 0;
|
|
13
|
+
right: 0;
|
|
14
|
+
bottom: 0;
|
|
15
|
+
top: 0;
|
|
16
|
+
background-color: rgba(0, 0, 0, 0);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.video-wrap {
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: 100%;
|
|
22
|
+
}
|
|
9
23
|
}
|
|
10
24
|
|
|
11
25
|
.pc-video-modal-wrap {
|
|
@@ -7,10 +7,6 @@ exports.getDefaultJSON = exports.bannerGroupSourceJSON = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _uuid = require("uuid");
|
|
9
9
|
|
|
10
|
-
var _banner = _interopRequireDefault(require("./imgs/banner.png"));
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
10
|
var bannerGroupSourceJSON = function bannerGroupSourceJSON() {
|
|
15
11
|
var groupId = (0, _uuid.v4)();
|
|
16
12
|
return {
|
|
@@ -23,8 +19,8 @@ var bannerGroupSourceJSON = function bannerGroupSourceJSON() {
|
|
|
23
19
|
content: {
|
|
24
20
|
h5Name: 'name2',
|
|
25
21
|
pcName: 'name2',
|
|
26
|
-
h5ImgSrc:
|
|
27
|
-
pcImgSrc:
|
|
22
|
+
h5ImgSrc: '',
|
|
23
|
+
pcImgSrc: '',
|
|
28
24
|
clickUrl: ''
|
|
29
25
|
},
|
|
30
26
|
hover: {
|
|
@@ -63,6 +63,7 @@ function (_super) {
|
|
|
63
63
|
|
|
64
64
|
VideoTag.prototype.render = function () {
|
|
65
65
|
var _a = this.props,
|
|
66
|
+
onPlayClick = _a.onPlayClick,
|
|
66
67
|
data = _a.data,
|
|
67
68
|
_b = _a.position,
|
|
68
69
|
position = _b === void 0 ? 'absolute' : _b,
|
|
@@ -81,7 +82,8 @@ function (_super) {
|
|
|
81
82
|
}, showBtn && /*#__PURE__*/_react["default"].createElement("div", {
|
|
82
83
|
className: "left-wrap"
|
|
83
84
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
84
|
-
className: "play-btn center"
|
|
85
|
+
className: "play-btn center",
|
|
86
|
+
onClick: onPlayClick
|
|
85
87
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
86
88
|
alt: "",
|
|
87
89
|
src: _playCircle["default"]
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
width: 85px;
|
|
13
13
|
height: 100%;
|
|
14
14
|
flex-shrink: 0;
|
|
15
|
+
align-self: end;
|
|
15
16
|
|
|
16
17
|
.play-btn {
|
|
17
18
|
position: absolute;
|
|
@@ -22,6 +23,9 @@
|
|
|
22
23
|
height: 60px;
|
|
23
24
|
z-index: 1;
|
|
24
25
|
cursor: pointer;
|
|
26
|
+
transform: translateX(-50%) !important;
|
|
27
|
+
bottom: 0;
|
|
28
|
+
top: unset !important;
|
|
25
29
|
|
|
26
30
|
img {
|
|
27
31
|
width: 100%;
|
|
@@ -7,10 +7,6 @@ exports.videoGroupSourceJSON = exports.getDefaultJSON = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _uuid = require("uuid");
|
|
9
9
|
|
|
10
|
-
var _banner = _interopRequireDefault(require("./imgs/banner.png"));
|
|
11
|
-
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
|
-
|
|
14
10
|
var videoGroupSourceJSON = function videoGroupSourceJSON(parentId) {
|
|
15
11
|
var groupId = (0, _uuid.v4)();
|
|
16
12
|
return {
|
|
@@ -24,8 +20,8 @@ var videoGroupSourceJSON = function videoGroupSourceJSON(parentId) {
|
|
|
24
20
|
content: {
|
|
25
21
|
h5Name: 'name2',
|
|
26
22
|
pcName: 'name2',
|
|
27
|
-
h5ImgSrc:
|
|
28
|
-
pcImgSrc:
|
|
23
|
+
h5ImgSrc: '',
|
|
24
|
+
pcImgSrc: '',
|
|
29
25
|
clickUrl: ''
|
|
30
26
|
},
|
|
31
27
|
hover: {
|
|
@@ -141,8 +137,8 @@ var videoGroupSourceJSON = function videoGroupSourceJSON(parentId) {
|
|
|
141
137
|
content: {
|
|
142
138
|
h5Name: 'name2',
|
|
143
139
|
pcName: 'name2',
|
|
144
|
-
h5ImgSrc:
|
|
145
|
-
pcImgSrc:
|
|
140
|
+
h5ImgSrc: '',
|
|
141
|
+
pcImgSrc: '',
|
|
146
142
|
clickUrl: ''
|
|
147
143
|
},
|
|
148
144
|
hover: {}
|
|
@@ -81,6 +81,27 @@ function (_super) {
|
|
|
81
81
|
/** 视频ref映射 */
|
|
82
82
|
|
|
83
83
|
_this.videoRefMap = {};
|
|
84
|
+
|
|
85
|
+
_this.playOrPause = function (group) {
|
|
86
|
+
(0, _commonUtil.ensure)(function () {
|
|
87
|
+
if (_this.videoRefMap[group.id].playing) {
|
|
88
|
+
_this.videoRefMap[group.id].playing = false;
|
|
89
|
+
|
|
90
|
+
_this.videoRefMap[group.id].el.player.pause();
|
|
91
|
+
} else {
|
|
92
|
+
if (group.video.playPosition == 'Popup') {
|
|
93
|
+
_this.videoRefMap[group.id].el.fullPlay('h5');
|
|
94
|
+
} else {
|
|
95
|
+
_this.videoRefMap[group.id].playing = true;
|
|
96
|
+
|
|
97
|
+
_this.videoRefMap[group.id].el.player.play();
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
_this.setState({});
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
|
|
84
105
|
return _this;
|
|
85
106
|
}
|
|
86
107
|
|
|
@@ -91,7 +112,7 @@ function (_super) {
|
|
|
91
112
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
92
113
|
className: "video-layout1-wrap"
|
|
93
114
|
}, data.groupSource.map(function (group) {
|
|
94
|
-
var _a;
|
|
115
|
+
var _a, _b;
|
|
95
116
|
/** 当前是否在播放 */
|
|
96
117
|
|
|
97
118
|
|
|
@@ -99,25 +120,6 @@ function (_super) {
|
|
|
99
120
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
100
121
|
key: group.id,
|
|
101
122
|
className: "video-item-wrap",
|
|
102
|
-
onClick: function onClick() {
|
|
103
|
-
(0, _commonUtil.ensure)(function () {
|
|
104
|
-
if (_this.videoRefMap[group.id].playing) {
|
|
105
|
-
_this.videoRefMap[group.id].playing = false;
|
|
106
|
-
|
|
107
|
-
_this.videoRefMap[group.id].el.player.pause();
|
|
108
|
-
} else {
|
|
109
|
-
if (group.video.playPosition == 'Popup') {
|
|
110
|
-
_this.videoRefMap[group.id].el.fullPlay('h5');
|
|
111
|
-
} else {
|
|
112
|
-
_this.videoRefMap[group.id].playing = true;
|
|
113
|
-
|
|
114
|
-
_this.videoRefMap[group.id].el.player.play();
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
_this.setState({});
|
|
119
|
-
});
|
|
120
|
-
},
|
|
121
123
|
style: {
|
|
122
124
|
height: data.mobileHeight
|
|
123
125
|
}
|
|
@@ -141,9 +143,13 @@ function (_super) {
|
|
|
141
143
|
cover: (0, _coreUtil.getVideoCover)(group),
|
|
142
144
|
source: group.video.sourceUrl
|
|
143
145
|
}),
|
|
146
|
+
play: (_b = _this.videoRefMap[group.id]) === null || _b === void 0 ? void 0 : _b.playing,
|
|
144
147
|
videoId: group.id
|
|
145
148
|
}), !isPlaying && group.video.playButton == 'Middle' && /*#__PURE__*/_react["default"].createElement("div", {
|
|
146
|
-
className: "play-btn center"
|
|
149
|
+
className: "play-btn center",
|
|
150
|
+
onClick: function onClick() {
|
|
151
|
+
_this.playOrPause(group);
|
|
152
|
+
}
|
|
147
153
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
148
154
|
alt: "",
|
|
149
155
|
src: _playCircle["default"]
|
|
@@ -153,6 +159,9 @@ function (_super) {
|
|
|
153
159
|
align: data.customize.align,
|
|
154
160
|
data: group,
|
|
155
161
|
noShare: true,
|
|
162
|
+
onPlayClick: function onPlayClick() {
|
|
163
|
+
return _this.playOrPause(group);
|
|
164
|
+
},
|
|
156
165
|
share: __assign({
|
|
157
166
|
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|
|
158
167
|
scroll: 'node-' + data.id
|
|
@@ -94,6 +94,26 @@ function (_super) {
|
|
|
94
94
|
}, 3000);
|
|
95
95
|
}
|
|
96
96
|
};
|
|
97
|
+
|
|
98
|
+
_this.playOrPause = function (group) {
|
|
99
|
+
(0, _commonUtil.ensure)(function () {
|
|
100
|
+
if (_this.videoRefMap[group.id].playing) {
|
|
101
|
+
_this.videoRefMap[group.id].playing = false;
|
|
102
|
+
|
|
103
|
+
_this.videoRefMap[group.id].el.player.pause();
|
|
104
|
+
} else {
|
|
105
|
+
if (group.video.playPosition == 'Popup') {
|
|
106
|
+
_this.videoRefMap[group.id].el.fullPlay('h5');
|
|
107
|
+
} else {
|
|
108
|
+
_this.videoRefMap[group.id].playing = true;
|
|
109
|
+
|
|
110
|
+
_this.videoRefMap[group.id].el.player.play();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
_this.setState({});
|
|
115
|
+
});
|
|
116
|
+
};
|
|
97
117
|
/** 视频ref映射 */
|
|
98
118
|
|
|
99
119
|
|
|
@@ -124,7 +144,7 @@ function (_super) {
|
|
|
124
144
|
transform: "translateX(-" + sliderIndex * 100 + "%)"
|
|
125
145
|
}
|
|
126
146
|
}, data.groupSource.map(function (group) {
|
|
127
|
-
var _a;
|
|
147
|
+
var _a, _b;
|
|
128
148
|
/** 当前是否在播放 */
|
|
129
149
|
|
|
130
150
|
|
|
@@ -132,25 +152,6 @@ function (_super) {
|
|
|
132
152
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
133
153
|
key: group.id,
|
|
134
154
|
className: "video-item-wrap",
|
|
135
|
-
onClick: function onClick() {
|
|
136
|
-
(0, _commonUtil.ensure)(function () {
|
|
137
|
-
if (_this.videoRefMap[group.id].playing) {
|
|
138
|
-
_this.videoRefMap[group.id].playing = false;
|
|
139
|
-
|
|
140
|
-
_this.videoRefMap[group.id].el.player.pause();
|
|
141
|
-
} else {
|
|
142
|
-
if (group.video.playPosition == 'Popup') {
|
|
143
|
-
_this.videoRefMap[group.id].el.fullPlay('h5');
|
|
144
|
-
} else {
|
|
145
|
-
_this.videoRefMap[group.id].playing = true;
|
|
146
|
-
|
|
147
|
-
_this.videoRefMap[group.id].el.player.play();
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
_this.setState({});
|
|
152
|
-
});
|
|
153
|
-
},
|
|
154
155
|
style: {
|
|
155
156
|
height: data.mobileHeight
|
|
156
157
|
}
|
|
@@ -174,9 +175,13 @@ function (_super) {
|
|
|
174
175
|
cover: (0, _coreUtil.getVideoCover)(group),
|
|
175
176
|
source: group.video.sourceUrl
|
|
176
177
|
}),
|
|
178
|
+
play: (_b = _this.videoRefMap[group.id]) === null || _b === void 0 ? void 0 : _b.playing,
|
|
177
179
|
videoId: group.id
|
|
178
180
|
}), !isPlaying && group.video.playButton == 'Middle' && /*#__PURE__*/_react["default"].createElement("div", {
|
|
179
|
-
className: "play-btn center"
|
|
181
|
+
className: "play-btn center",
|
|
182
|
+
onClick: function onClick() {
|
|
183
|
+
_this.playOrPause(group);
|
|
184
|
+
}
|
|
180
185
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
181
186
|
alt: "",
|
|
182
187
|
src: _playCircle["default"]
|
|
@@ -184,6 +189,9 @@ function (_super) {
|
|
|
184
189
|
align: data.customize.align,
|
|
185
190
|
data: group,
|
|
186
191
|
noShare: true,
|
|
192
|
+
onPlayClick: function onPlayClick() {
|
|
193
|
+
return _this.playOrPause(group);
|
|
194
|
+
},
|
|
187
195
|
share: __assign({
|
|
188
196
|
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|
|
189
197
|
scroll: 'node-' + data.id
|
|
@@ -78,8 +78,29 @@ function (_super) {
|
|
|
78
78
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
79
79
|
|
|
80
80
|
_this.state = {};
|
|
81
|
+
|
|
82
|
+
_this.playOrPause = function (group) {
|
|
83
|
+
(0, _commonUtil.ensure)(function () {
|
|
84
|
+
if (_this.videoRefMap[group.id].playing) {
|
|
85
|
+
_this.videoRefMap[group.id].playing = false;
|
|
86
|
+
|
|
87
|
+
_this.videoRefMap[group.id].el.player.pause();
|
|
88
|
+
} else {
|
|
89
|
+
if (group.video.playPosition == 'Popup') {
|
|
90
|
+
_this.videoRefMap[group.id].el.fullPlay('h5');
|
|
91
|
+
} else {
|
|
92
|
+
_this.videoRefMap[group.id].playing = true;
|
|
93
|
+
|
|
94
|
+
_this.videoRefMap[group.id].el.player.play();
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
_this.setState({});
|
|
99
|
+
});
|
|
100
|
+
};
|
|
81
101
|
/** 视频ref映射 */
|
|
82
102
|
|
|
103
|
+
|
|
83
104
|
_this.videoRefMap = {};
|
|
84
105
|
return _this;
|
|
85
106
|
}
|
|
@@ -91,7 +112,7 @@ function (_super) {
|
|
|
91
112
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
92
113
|
className: "video-layout3-wrap"
|
|
93
114
|
}, data.groupSource.map(function (group) {
|
|
94
|
-
var _a;
|
|
115
|
+
var _a, _b;
|
|
95
116
|
/** 当前是否在播放 */
|
|
96
117
|
|
|
97
118
|
|
|
@@ -101,25 +122,6 @@ function (_super) {
|
|
|
101
122
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
102
123
|
key: group.id,
|
|
103
124
|
className: "video-item-wrap",
|
|
104
|
-
onClick: function onClick() {
|
|
105
|
-
(0, _commonUtil.ensure)(function () {
|
|
106
|
-
if (_this.videoRefMap[group.id].playing) {
|
|
107
|
-
_this.videoRefMap[group.id].playing = false;
|
|
108
|
-
|
|
109
|
-
_this.videoRefMap[group.id].el.player.pause();
|
|
110
|
-
} else {
|
|
111
|
-
if (group.video.playPosition == 'Popup') {
|
|
112
|
-
_this.videoRefMap[group.id].el.fullPlay('h5');
|
|
113
|
-
} else {
|
|
114
|
-
_this.videoRefMap[group.id].playing = true;
|
|
115
|
-
|
|
116
|
-
_this.videoRefMap[group.id].el.player.play();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
_this.setState({});
|
|
121
|
-
});
|
|
122
|
-
},
|
|
123
125
|
style: {
|
|
124
126
|
height: data.mobileHeight
|
|
125
127
|
}
|
|
@@ -138,12 +140,16 @@ function (_super) {
|
|
|
138
140
|
cover: (0, _coreUtil.getVideoCover)(group),
|
|
139
141
|
source: group.video.sourceUrl
|
|
140
142
|
}),
|
|
143
|
+
play: (_b = _this.videoRefMap[group.id]) === null || _b === void 0 ? void 0 : _b.playing,
|
|
141
144
|
videoId: group.id
|
|
142
145
|
}), !isPlaying && /*#__PURE__*/_react["default"].createElement("div", {
|
|
143
146
|
className: (0, _classnames["default"])('play-btn', {
|
|
144
147
|
middle: group.video.playButton == 'Middle',
|
|
145
148
|
bottomLeft: group.video.playButton == 'Bottom Left'
|
|
146
|
-
})
|
|
149
|
+
}),
|
|
150
|
+
onClick: function onClick() {
|
|
151
|
+
_this.playOrPause(group);
|
|
152
|
+
}
|
|
147
153
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
|
148
154
|
alt: "",
|
|
149
155
|
src: _playCircle["default"]
|
|
@@ -154,6 +160,9 @@ function (_super) {
|
|
|
154
160
|
data: group,
|
|
155
161
|
layout: 'h5-' + data.customize.layout.h5Layout,
|
|
156
162
|
noShare: true,
|
|
163
|
+
onPlayClick: function onPlayClick() {
|
|
164
|
+
return _this.playOrPause(group);
|
|
165
|
+
},
|
|
157
166
|
position: "relative",
|
|
158
167
|
share: __assign({
|
|
159
168
|
url: (0, _commonUtil.addUrlQuery)(window.location.href, {
|