pb-sxp-ui 1.0.29 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +20 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20 -17
- package/dist/index.js.map +1 -1
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.cjs.map +1 -1
- package/dist/index.min.js +3 -3
- package/dist/index.min.js.map +1 -1
- package/dist/pb-ui.js +23 -21
- package/dist/pb-ui.js.map +1 -1
- package/dist/pb-ui.min.js +3 -3
- package/dist/pb-ui.min.js.map +1 -1
- package/es/core/components/SxpPageRender/VideoWidget/index.js +20 -4
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +20 -4
- package/package.json +2 -1
package/dist/index.js
CHANGED
@@ -6,6 +6,7 @@ import qs from 'qs';
|
|
6
6
|
import { css } from '@emotion/css';
|
7
7
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
8
8
|
import * as ReactDOM from 'react-dom';
|
9
|
+
import Hls from 'hls.js';
|
9
10
|
import EventEmitter from 'eventemitter3';
|
10
11
|
|
11
12
|
/******************************************************************************
|
@@ -12103,20 +12104,22 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
12103
12104
|
setIsPauseVideo(false);
|
12104
12105
|
if (!videoRef.current.src) {
|
12105
12106
|
const videoSrc = rec.video.url;
|
12106
|
-
|
12107
|
-
|
12108
|
-
|
12109
|
-
|
12110
|
-
|
12111
|
-
|
12112
|
-
|
12113
|
-
|
12114
|
-
|
12115
|
-
|
12116
|
-
|
12117
|
-
|
12118
|
-
|
12119
|
-
|
12107
|
+
if (videoSrc.includes('.m3u8')) {
|
12108
|
+
if (Hls.isSupported()) {
|
12109
|
+
const hls = new Hls();
|
12110
|
+
hls.loadSource(videoSrc);
|
12111
|
+
hls.attachMedia(videoRef.current);
|
12112
|
+
}
|
12113
|
+
else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
|
12114
|
+
videoRef.current.src = videoSrc;
|
12115
|
+
}
|
12116
|
+
else {
|
12117
|
+
videoRef.current.src = videoSrc;
|
12118
|
+
}
|
12119
|
+
}
|
12120
|
+
else {
|
12121
|
+
videoRef.current.src = videoSrc;
|
12122
|
+
}
|
12120
12123
|
videoRef.current.setAttribute('x5-playsinline', 'true');
|
12121
12124
|
videoRef.current.setAttribute('webkit-playsinline', 'true');
|
12122
12125
|
}
|
@@ -12210,16 +12213,16 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
12210
12213
|
React.createElement("div", { style: {
|
12211
12214
|
position: 'absolute',
|
12212
12215
|
width: '100%',
|
12213
|
-
height: '
|
12216
|
+
height: '100%',
|
12214
12217
|
top: '50%',
|
12215
12218
|
transform: translateY,
|
12216
12219
|
left: 0,
|
12217
12220
|
right: 0
|
12218
12221
|
} },
|
12219
|
-
React.createElement("div", { style: { position: 'relative' } },
|
12222
|
+
React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
|
12220
12223
|
React.createElement("video", { id: `pb-video-${index}`, className: 'clc-pb-video', ref: videoRef, crossOrigin: 'anonymous', muted: true, controls: false, playsInline: true, preload: 'auto', onPause: onPause, onEnded: handleVideoStart, style: {
|
12221
12224
|
width: '100%',
|
12222
|
-
height: '
|
12225
|
+
height: '100%',
|
12223
12226
|
objectFit: 'contain'
|
12224
12227
|
} }),
|
12225
12228
|
React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),
|