pb-sxp-ui 1.0.90 → 1.0.91

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.
@@ -4,7 +4,6 @@ import { useIconLink } from '../useIconLink';
4
4
  import FormatImage from '../FormatImage';
5
5
  import { useSxpDataSource } from '../../../../core/hooks';
6
6
  import SXP_EVENT_BUS, { SXP_EVENT_TYPE } from '../../../../core/utils/event';
7
- import Hls from 'hls.js';
8
7
  const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoRef }) => {
9
8
  const [isPauseVideo, setIsPauseVideo] = useState(false);
10
9
  const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport } = useSxpDataSource();
@@ -175,8 +174,9 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
175
174
  const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
176
175
  if (!videoSrc)
177
176
  return;
177
+ const Hls = window === null || window === void 0 ? void 0 : window.Hls;
178
178
  if (videoSrc.includes('.m3u8')) {
179
- if (Hls.isSupported()) {
179
+ if (Hls && Hls.isSupported()) {
180
180
  const hls = new Hls();
181
181
  hls.loadSource(videoSrc);
182
182
  hls.attachMedia(videoRef);
@@ -7,7 +7,6 @@ const useIconLink_1 = require("../useIconLink");
7
7
  const FormatImage_1 = tslib_1.__importDefault(require("../FormatImage"));
8
8
  const hooks_1 = require("../../../../core/hooks");
9
9
  const event_1 = tslib_1.__importStar(require("../../../../core/utils/event"));
10
- const hls_js_1 = tslib_1.__importDefault(require("hls.js"));
11
10
  const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostConfig, videoRef }) => {
12
11
  const [isPauseVideo, setIsPauseVideo] = (0, react_1.useState)(false);
13
12
  const { bffEventReport, sxpParameter, waterFallData, openHashtag, bffFbReport } = (0, hooks_1.useSxpDataSource)();
@@ -178,9 +177,10 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
178
177
  const videoSrc = rec === null || rec === void 0 ? void 0 : rec.video.url;
179
178
  if (!videoSrc)
180
179
  return;
180
+ const Hls = window === null || window === void 0 ? void 0 : window.Hls;
181
181
  if (videoSrc.includes('.m3u8')) {
182
- if (hls_js_1.default.isSupported()) {
183
- const hls = new hls_js_1.default();
182
+ if (Hls && Hls.isSupported()) {
183
+ const hls = new Hls();
184
184
  hls.loadSource(videoSrc);
185
185
  hls.attachMedia(videoRef);
186
186
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.0.90",
3
+ "version": "1.0.91",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -39,7 +39,6 @@
39
39
  "@emotion/css": "^11.11.2",
40
40
  "eslint": "^8.48.0",
41
41
  "eventemitter3": "^5.0.1",
42
- "hls.js": "^1.5.11",
43
42
  "less": "^4.2.0",
44
43
  "lodash": "^4.17.21",
45
44
  "pako": "^2.1.0",