autoUpdataFile

dev_local_v9_brain_cloud_competitions
eduauto 11 months ago
parent b72fadcc1b
commit d970cfd467

@ -27,7 +27,7 @@
display: block !important;
}
</style><script>if(document.domain !== "www.educoder.net") document.title = '';</script>
<script src="/react/build/umi.dbb73a03.js"></script>
<script src="/react/build/umi.a6f013ce.js"></script>
<script src="/react/build/js/public.js"></script>
</body>
</html>

@ -78,6 +78,8 @@ var fetch = __webpack_require__(1833);
var RenderHtml = __webpack_require__(29792);
// EXTERNAL MODULE: ./src/components/ui-customization/index.tsx + 32 modules
var ui_customization = __webpack_require__(21164);
// EXTERNAL MODULE: ./node_modules/_hls.js@1.6.2@hls.js/dist/hls.mjs
var dist_hls = __webpack_require__(79710);
// EXTERNAL MODULE: ./node_modules/_react@17.0.2@react/jsx-runtime.js
var jsx_runtime = __webpack_require__(37712);
;// CONCATENATED MODULE: ./src/pages/Competitions/Group/index.tsx
@ -106,6 +108,7 @@ var _excluded = ["competitions", "globalSetting", "loading", "dispatch", "user"]
var competitionsPage = function competitionsPage(_ref) {
@ -307,67 +310,58 @@ var competitionsPage = function competitionsPage(_ref) {
_useState8 = slicedToArray_default()(_useState7, 2),
isSuccess = _useState8[0],
setIsSuccess = _useState8[1];
(0,_react_17_0_2_react.useEffect)(function () {
var video = videoRef.current;
var urlHls = "https://p2hs.vzan.com/1005362/994297253641030125/live.m3u8?zbid=1005362&tpid=1141665985";
if (!video) {
setIsSuccess(true);
return;
}
if (dist_hls/* default.isSupported */.ZP.isSupported()) {
var hlsInstance = new dist_hls/* default */.ZP();
setHls(hlsInstance);
// useEffect(() => {
// const video = videoRef.current;
// const urlHls = "https://p2hs.vzan.com/1005362/994297253641030125/live.m3u8?zbid=1005362&tpid=1141665985";
// if (!video) {
// setIsSuccess(true);
// return
// }
// if (Hls.isSupported()) {
// const hlsInstance = new Hls();
// setHls(hlsInstance);
// // 绑定视频元素
// hlsInstance.attachMedia(video);
// // 加载直播流替换为你的HLS流地址
// hlsInstance.loadSource(urlHls);
// hlsInstance.on(Hls.Events.MANIFEST_PARSED, () => {
// video.play().catch(e => {
// console.log("失败");
// // setIsSuccess(false);
// });
// });
// hlsInstance.on(Hls.Events.ERROR, (event, data) => {
// if (data.fatal) {
// switch (data.type) {
// case Hls.ErrorTypes.NETWORK_ERROR:
// setIsSuccess(false);
// hlsInstance.startLoad();
// break;
// case Hls.ErrorTypes.MEDIA_ERROR:
// setIsSuccess(false);
// hlsInstance.recoverMediaError();
// break;
// default:
// setIsSuccess(false);
// hlsInstance.destroy();
// break;
// }
// }
// });
// } else if (video.canPlayType('application/vnd.apple.mpegurl')) {
// // Safari原生支持HLS
// video.src = urlHls;
// video.addEventListener('loadedmetadata', () => {
// video.play();
// });
// } else {
// setIsSuccess(false);
// }
// return () => {
// if (hls) {
// hls.destroy();
// }
// };
// }, [videoRef.current]);
// 绑定视频元素
hlsInstance.attachMedia(video);
// 加载直播流替换为你的HLS流地址
hlsInstance.loadSource(urlHls);
hlsInstance.on(dist_hls/* default.Events */.ZP.Events.MANIFEST_PARSED, function () {
video.play()["catch"](function (e) {
// setIsSuccess(false);
});
});
hlsInstance.on(dist_hls/* default.Events */.ZP.Events.ERROR, function (event, data) {
if (data.fatal) {
setIsSuccess(false);
switch (data.type) {
case dist_hls/* default.ErrorTypes */.ZP.ErrorTypes.NETWORK_ERROR:
hlsInstance.startLoad();
break;
case dist_hls/* default.ErrorTypes */.ZP.ErrorTypes.MEDIA_ERROR:
hlsInstance.recoverMediaError();
break;
default:
hlsInstance.destroy();
break;
}
}
});
} else if (video.canPlayType('application/vnd.apple.mpegurl')) {
// Safari原生支持HLS
video.src = urlHls;
video.addEventListener('loadedmetadata', function () {
video.play();
});
} else {
setIsSuccess(false);
}
return function () {
if (hls) {
hls.destroy();
}
};
}, [videoRef.current]);
var handleFullscreen = function handleFullscreen() {
if (videoRef.current.requestFullscreen) {
videoRef.current.requestFullscreen();
@ -693,19 +687,26 @@ var competitionsPage = function competitionsPage(_ref) {
},
src: xcsp_namespaceObject
})
}),
/*#__PURE__*/
// isSuccess ? <div style={{ width: "1200px", margin: "0 auto" }}>
// <video ref={videoRef} controls style={{ width: '100%', backgroundColor: '#000' }} />
// {/* <div className="controls">
// <button onClick={() => { videoRef.current.play(); }}>播放</button>
// <button onClick={() => { videoRef.current.pause(); }}>暂停</button>
// <button onClick={handleFullscreen}>全屏</button>
// </div> */}
// </div> :
(0,jsx_runtime.jsx)(row/* default */.Z, {
}), /*#__PURE__*/(0,jsx_runtime.jsx)("div", {
style: {
width: "1200px",
margin: "0 auto",
display: isSuccess ? "" : "none"
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("video", {
ref: videoRef,
controls: true,
style: {
width: '100%',
backgroundColor: '#000'
}
})
}), /*#__PURE__*/(0,jsx_runtime.jsx)(row/* default */.Z, {
align: "middle",
justify: "center",
style: {
display: isSuccess ? "none" : ""
},
children: /*#__PURE__*/(0,jsx_runtime.jsx)("video", {
height: 675,
width: 1200,

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save