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 CHANGED
@@ -10,6 +10,7 @@ var qs = require('qs');
10
10
  var css = require('@emotion/css');
11
11
  var proComponents = require('@ant-design/pro-components');
12
12
  var ReactDOM = require('react-dom');
13
+ var Hls = require('hls.js');
13
14
  var EventEmitter = require('eventemitter3');
14
15
 
15
16
  function _interopNamespaceDefault(e) {
@@ -12126,20 +12127,22 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12126
12127
  setIsPauseVideo(false);
12127
12128
  if (!videoRef.current.src) {
12128
12129
  const videoSrc = rec.video.url;
12129
- // if (videoSrc.includes('.m3u8')) {
12130
- // if (Hls.isSupported()) {
12131
- // const hls = new Hls();
12132
- // hls.loadSource(videoSrc);
12133
- // hls.attachMedia(videoRef.current);
12134
- // } else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
12135
- // videoRef.current.src = videoSrc;
12136
- // } else {
12137
- // videoRef.current.src = videoSrc;
12138
- // }
12139
- // } else {
12140
- // videoRef.current.src = videoSrc;
12141
- // }
12142
- videoRef.current.src = videoSrc;
12130
+ if (videoSrc.includes('.m3u8')) {
12131
+ if (Hls.isSupported()) {
12132
+ const hls = new Hls();
12133
+ hls.loadSource(videoSrc);
12134
+ hls.attachMedia(videoRef.current);
12135
+ }
12136
+ else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
12137
+ videoRef.current.src = videoSrc;
12138
+ }
12139
+ else {
12140
+ videoRef.current.src = videoSrc;
12141
+ }
12142
+ }
12143
+ else {
12144
+ videoRef.current.src = videoSrc;
12145
+ }
12143
12146
  videoRef.current.setAttribute('x5-playsinline', 'true');
12144
12147
  videoRef.current.setAttribute('webkit-playsinline', 'true');
12145
12148
  }
@@ -12233,16 +12236,16 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
12233
12236
  React.createElement("div", { style: {
12234
12237
  position: 'absolute',
12235
12238
  width: '100%',
12236
- height: 'auto',
12239
+ height: '100%',
12237
12240
  top: '50%',
12238
12241
  transform: translateY,
12239
12242
  left: 0,
12240
12243
  right: 0
12241
12244
  } },
12242
- React.createElement("div", { style: { position: 'relative' } },
12245
+ React.createElement("div", { style: { position: 'relative', width: '100%', height: '100%' } },
12243
12246
  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: {
12244
12247
  width: '100%',
12245
- height: 'auto',
12248
+ height: '100%',
12246
12249
  objectFit: 'contain'
12247
12250
  } }),
12248
12251
  React.createElement("img", { hidden: !isPauseVideo, className: 'clc-pb-video-pause', src: PAUSE_ICON }))),