pb-sxp-ui 1.0.36 → 1.0.37
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 +17 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -21
- 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 +20 -24
- 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 +1 -21
- package/lib/core/components/SxpPageRender/VideoWidget/index.js +1 -21
- package/package.json +1 -1
@@ -1,6 +1,5 @@
|
|
1
1
|
import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
2
2
|
import { useSwiperSlide } from 'swiper/react';
|
3
|
-
import Hls from 'hls.js';
|
4
3
|
import { useIconLink } from '../useIconLink';
|
5
4
|
import FormatImage from '../FormatImage';
|
6
5
|
import { useSxpDataSource } from '../../../../core/hooks';
|
@@ -141,26 +140,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
141
140
|
setIsPauseVideo(false);
|
142
141
|
if (!videoRef.current.src) {
|
143
142
|
const videoSrc = rec.video.url;
|
144
|
-
|
145
|
-
if (Hls.isSupported()) {
|
146
|
-
const hls = new Hls();
|
147
|
-
hls.loadSource(videoSrc);
|
148
|
-
hls.attachMedia(videoRef.current);
|
149
|
-
hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
150
|
-
var _a;
|
151
|
-
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
152
|
-
});
|
153
|
-
}
|
154
|
-
else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
|
155
|
-
videoRef.current.src = videoSrc;
|
156
|
-
}
|
157
|
-
else {
|
158
|
-
videoRef.current.src = videoSrc;
|
159
|
-
}
|
160
|
-
}
|
161
|
-
else {
|
162
|
-
videoRef.current.src = videoSrc;
|
163
|
-
}
|
143
|
+
videoRef.current.src = videoSrc;
|
164
144
|
videoRef.current.setAttribute('x5-playsinline', 'true');
|
165
145
|
videoRef.current.setAttribute('webkit-playsinline', 'true');
|
166
146
|
}
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
4
4
|
const react_1 = tslib_1.__importStar(require("react"));
|
5
5
|
const react_2 = require("swiper/react");
|
6
|
-
const hls_js_1 = tslib_1.__importDefault(require("hls.js"));
|
7
6
|
const useIconLink_1 = require("../useIconLink");
|
8
7
|
const FormatImage_1 = tslib_1.__importDefault(require("../FormatImage"));
|
9
8
|
const hooks_1 = require("../../../../core/hooks");
|
@@ -144,26 +143,7 @@ const VideoWidget = ({ rec, index, height, data, muted, activeIndex, videoPostCo
|
|
144
143
|
setIsPauseVideo(false);
|
145
144
|
if (!videoRef.current.src) {
|
146
145
|
const videoSrc = rec.video.url;
|
147
|
-
|
148
|
-
if (hls_js_1.default.isSupported()) {
|
149
|
-
const hls = new hls_js_1.default();
|
150
|
-
hls.loadSource(videoSrc);
|
151
|
-
hls.attachMedia(videoRef.current);
|
152
|
-
hls.on(hls_js_1.default.Events.MANIFEST_PARSED, function () {
|
153
|
-
var _a;
|
154
|
-
(_a = videoRef === null || videoRef === void 0 ? void 0 : videoRef.current) === null || _a === void 0 ? void 0 : _a.play();
|
155
|
-
});
|
156
|
-
}
|
157
|
-
else if (videoRef.current.canPlayType('application/vnd.apple.mpegurl')) {
|
158
|
-
videoRef.current.src = videoSrc;
|
159
|
-
}
|
160
|
-
else {
|
161
|
-
videoRef.current.src = videoSrc;
|
162
|
-
}
|
163
|
-
}
|
164
|
-
else {
|
165
|
-
videoRef.current.src = videoSrc;
|
166
|
-
}
|
146
|
+
videoRef.current.src = videoSrc;
|
167
147
|
videoRef.current.setAttribute('x5-playsinline', 'true');
|
168
148
|
videoRef.current.setAttribute('webkit-playsinline', 'true');
|
169
149
|
}
|