"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[873],{6873:(e,s,t)=>{t.r(s),t.d(s,{default:()=>i});var r=t(5155),l=t(2115);let n=(0,t(5028).default)(()=>t.e(212).then(t.t.bind(t,2212,23)),{loadableGenerated:{webpack:()=>[2212]},ssr:!1,loading:()=>(0,r.jsx)("div",{className:"pt-[56.25%] w-full bg-gray-800 rounded-lg overflow-hidden relative",children:(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center",children:(0,r.jsxs)("div",{className:"flex flex-col items-center",children:[(0,r.jsxs)("svg",{className:"animate-spin h-8 w-8 text-white mb-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),(0,r.jsx)("span",{className:"text-white text-sm",children:"加载播放器中..."})]})})})});function i(e){let{url:s,title:t,isLoading:i=!1,hasError:o=!1,hasTimeout:a=!1,onLoad:c,onError:x,onOpenInNewTab:d}=e,[m,h]=(0,l.useState)(!1),[w,u]=(0,l.useState)(!1),[p,g]=(0,l.useState)(0);(0,l.useEffect)(()=>{h(!1),u(!1),g(0)},[s]);let v=()=>{d?d():s&&window.open(s,"_blank")},j=()=>{g(e=>e+1),h(!1),c&&c()};return(0,r.jsxs)("div",{className:"pt-[56.25%] w-full bg-gray-800 rounded-lg overflow-hidden relative",children:[i&&(0,r.jsx)("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-gray-800",children:(0,r.jsxs)("div",{className:"flex flex-col items-center",children:[(0,r.jsxs)("svg",{className:"animate-spin h-8 w-8 text-white mb-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),(0,r.jsx)("span",{className:"text-white text-sm",children:"加载中..."}),(0,r.jsx)("p",{className:"text-gray-300 text-xs mt-2 max-w-xs text-center",children:"正在加载解析后的视频,可能需要几秒钟..."})]})}),a&&!o&&!m&&(0,r.jsx)("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-gray-800",children:(0,r.jsxs)("div",{className:"flex flex-col items-center p-4 text-center",children:[(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-10 h-10 text-yellow-500 mb-2",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z"})}),(0,r.jsx)("p",{className:"text-white font-medium mb-2",children:"加载超时"}),(0,r.jsx)("p",{className:"text-gray-300 text-sm mb-3",children:"当前解析接口响应较慢或视频可能不支持内嵌播放"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)("button",{onClick:v,className:"px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 transition-colors flex items-center",children:[(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4 mr-1",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})}),"在新标签页打开"]}),p<2&&(0,r.jsxs)("button",{onClick:j,className:"px-4 py-2 bg-gray-700 text-white rounded-md hover:bg-gray-600 transition-colors flex items-center",children:[(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4 mr-1",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M15.485 4.355a8.25 8.25 0 00-13.803 3.7m0 0l-3.181-3.183m13.803 3.183 3.181 3.182"})}),"重试加载"]})]})]})}),(o||m)&&(0,r.jsx)("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-gray-800",children:(0,r.jsxs)("div",{className:"flex flex-col items-center p-4 text-center",children:[(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-10 h-10 text-red-500 mb-2",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z"})}),(0,r.jsx)("p",{className:"text-white font-medium mb-2",children:"播放器加载失败"}),(0,r.jsx)("p",{className:"text-gray-300 text-sm mb-3",children:"当前视频可能不支持内嵌播放或解析接口无法正常工作"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsxs)("button",{onClick:v,className:"px-4 py-2 bg-blue-500 text-white rounded-md hover:bg-blue-600 transition-colors flex items-center",children:[(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4 mr-1",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})}),"在新标签页打开"]}),p<2&&(0,r.jsxs)("button",{onClick:j,className:"px-4 py-2 bg-gray-700 text-white rounded-md hover:bg-gray-600 transition-colors flex items-center",children:[(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4 mr-1",children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M15.485 4.355a8.25 8.25 0 00-13.803 3.7m0 0l-3.181-3.183m13.803 3.183 3.181 3.182"})}),"重试加载"]})]})]})}),(0,r.jsx)("div",{className:"absolute inset-0",children:(0,r.jsx)(n,{url:s,width:"100%",height:"100%",playing:w,controls:!0,light:!1,pip:!0,stopOnUnmount:!0,playsinline:!0,onReady:()=>{c&&c(),u(!0)},onError:e=>{console.error("播放器错误:",e),h(!0),x&&x()},config:{file:{attributes:{crossOrigin:"anonymous",referrerPolicy:"no-referrer"}},youtube:{playerVars:{autoplay:1,modestbranding:1,rel:0,showinfo:0}}},title:t||"视频播放器"},"".concat(s,"-").concat(p))})]})}}}]);