pb-sxp-ui 1.0.30 → 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
  }