@funhub/platform 0.2.12 → 0.2.13
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/components/biz/business/detail/shared/video-hero.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-base.mjs +1 -1
- package/dist/components/biz/business/home-recommend/shared/home-recommend-server-data.mjs +1 -1
- package/dist/components/biz/business/image-text-recommend/client.mjs +1 -1
- package/dist/components/biz/business/large-feature-grid/client.mjs +1 -1
- package/dist/components/common/video-player/index.d.mts +2 -0
- package/dist/components/common/video-player/index.mjs +3 -3
- package/dist/components/common/video-player/video-preroll-ad.mjs +2 -0
- package/dist/components/ui/button.d.mts +1 -1
- package/dist/components/ui/empty.d.mts +1 -1
- package/dist/components/ui/item.d.mts +1 -1
- package/dist/types.d.mts +166 -33
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{cn as e}from"../../../../../utils/cn.mjs";import{pxToVw as t}from"../../../../../utils/helper.mjs";import{Image as n}from"../../../../ui/image.mjs";import{Box as r}from"../../../../ui/box.mjs";import{Text as i}from"../../../../ui/text.mjs";import{useBrowseReport as a}from"../../../../../hooks/use-browse-report.mjs";import{MediaPreview as o,useMediaPreview as s}from"../../../../common/media-preview/index.mjs";import c from"../../../../common/video-player/index.mjs";import{UserActivityMediaGrid as l}from"../../../../common/list/user-activity-list/user-activity-list-item.mjs";import{VideoPlayerRefContext as u}from"../../../../common/video-player/video-player-ref-context.mjs";import{VideoBlindAdOverlay as d}from"../../../../common/video-player/video-blind-ad-overlay.mjs";import{memo as f,useCallback as p,useEffect as m,useMemo as h,useRef as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import{useTranslations as y}from"next-intl";const b=f(({mode:t=`renderer`,information:n,isVideo:a,episodeIndex:c=0,resumeProgressSeconds:u=0,className:d=``})=>{let f=t===`editor`,m=h(()=>({id:n.id,name:n.name,preview_images:n.preview_images,img_y:n.img_y,img_x:n.img_x}),[n.id,n.name,n.preview_images,n.img_y,n.img_x]),g=h(()=>{let e=n?.medias,t=Array.isArray(e)?e.filter(Boolean):[];return t.length>0?t:(m.preview_images?.length?m.preview_images:[m.img_y||m.img_x||``].filter(Boolean)).filter(Boolean).map(e=>({media_url:e,is_video:!1,cover_image:``}))},[m.img_x,m.img_y,m.preview_images,n]),y=s(),b=h(()=>g.filter(Boolean).map(e=>{let t=e?.is_video?`video`:`image`,r=String(e?.media_url||``),i=e?.cover_image||n.img_y||n.img_x;return{src:r,type:t,...i?{cover:String(i)}:{}}}).filter(e=>!!e.src),[n.img_x,n.img_y,g]),S=p(e=>{f||!b.length||y.open(b,e)},[f,y,b]);return f?_(`img`,{src:`/static/components-thumb/video_player.png`,alt:`video-preview`,className:`w-full block`}):a?_(x,{information:n,episodeIndex:c,resumeProgressSeconds:u,isEditor:f}):v(`div`,{className:e(`w-full`,d),children:[v(r,{className:`mt-3 px-[12px] space-y-1`,children:[_(i,{as:`p`,className:`break-all`,dangerouslySetInnerHTML:{__html:n.description}}),_(l,{medias:g,onItemClick:S})]}),_(o,{})]})});b.displayName=`DetailHero`;const x=f(({information:e,episodeIndex:t,resumeProgressSeconds:n,isEditor:r})=>{let i=h(()=>({id:e.id,mid:e.mid,img_width:e.img_width,img_height:e.img_height,img_y:e.img_y,img_x:e.img_x,preview_images:e.preview_images}),[e.id,e.mid,e.img_width,e.img_height,e.img_y,e.img_x,e.preview_images]);return _(S,{information:{...e,...i},episodeIndex:t,resumeProgressSeconds:n,isEditor:r})},(e,t)=>{let n=e.information,r=t.information;return n.id===r.id&&n.mid===r.mid&&n.img_width===r.img_width&&n.img_height===r.img_height&&n.img_y===r.img_y&&n.img_x===r.img_x&&e.resumeProgressSeconds===t.resumeProgressSeconds&&e.episodeIndex===t.episodeIndex&&e.isEditor===t.isEditor});x.displayName=`StableDetailPlayerBox`;function S({information:e,episodeIndex:i,resumeProgressSeconds:o,isEditor:s}){let l=g(null);console.log(`[video-hero] 创建 playerRef:`,{ref:l,current:l.current,infoId:e.id});let f=y(`components.biz.business.detail`),b=g(0),x=g(0),S=Math.max(0,Number(i)||0),E=S+1,D=h(()=>e?.id,[e?.id]),O=h(()=>({id:e.id,mid:e.mid,img_width:e.img_width,img_height:e.img_height,img_y:e.img_y,img_x:e.img_x,preview_images:e.preview_images,links:e.links}),[e.id,e.mid,e.img_width,e.img_height,e.img_y,e.img_x,e.preview_images,e.links]),k=h(()=>O.mid||O.id,[O.id,O.mid]),A=h(()=>{let e=O.links?.[S]?.id;return e?String(e):`ep-${S+1}`},[S,O.links]),j=h(()=>`__reportData_detail_page__${O.id}:${A}`,[A,O.id]),M=h(()=>{if(s||typeof window>`u`)return 0;try{let e=sessionStorage.getItem(j);if(!e)return 0;let t=JSON.parse(e),n=Number(t.currentTime||0),r=Number(t.duration||0);if(!Number.isFinite(n)||!Number.isFinite(r))return 0;if(n>0&&r>0)return n}catch(e){console.error(`读取 sessionStorage 数据失败:`,e)}return 0},[s,j]),N=h(()=>{let e=Number(o||0);return Number.isFinite(e)&&e>0?e:0},[o]),P=h(()=>N>0?N:M,[N,M]),F=h(()=>{let t=T(e),n=t[t.length?Math.max(0,Math.min(S,t.length-1)):0]?.url||``,r=!!t.length;if(!r)return{hasVideo:!1,hlsList:[],videoUrl:``,width:1,height:1,resolution:`0x0`,aspectRatio:1,poster:``};let i=Number(O.img_width||0)||1,a=Number(O.img_height||0)||1;return{hasVideo:r,hlsList:t,videoUrl:n,width:i,height:a,resolution:C(i,a),aspectRatio:(i||1)/(a||1),poster:O.img_y||O.img_x||O.preview_images?.[0]||``}},[e.id,e.links,S,O.img_width,O.img_height,O.img_y,O.img_x,O.preview_images]),I=p((e,t)=>{b.current=e,x.current=t},[]),L=h(()=>F.videoUrl.endsWith(`m3u8`)?{startTimeSeconds:P,preload:`none`}:{startTimeSeconds:P},[P,F.videoUrl]);m(()=>{b.current=0,x.current=0},[D,S]);let R=a({contentId:D,browseEpisode:E,contentType:1,enabled:!s&&!!D,intervalMs:60*1e3,getCurrentTimeSeconds:()=>b.current,getDurationSeconds:()=>x.current});if(m(()=>{if(s)return;let e=()=>{if(!(typeof window>`u`)&&!(b.current<=0||x.current<=0))try{sessionStorage.setItem(j,JSON.stringify({episodeId:A,currentTime:b.current,duration:x.current}))}catch(e){console.error(`写入 sessionStorage 失败:`,e)}},t=()=>{e()},n=()=>{document.visibilityState===`hidden`&&e()},r=()=>{e()};return window.addEventListener(`beforeunload`,t),document.addEventListener(`visibilitychange`,n),window.addEventListener(`popstate`,r),()=>{window.removeEventListener(`beforeunload`,t),document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`popstate`,r),e()}},[A,s,j]),!F.hasVideo)return _(`div`,{className:`mt-3 rounded-xl bg-bg1 px-3 py-10 text-center text-text3`,children:f(`videoHero.noVideos`)});let z=w(430,F.aspectRatio,242),B=z.height>0?t(z.height):`auto`,V=z.height>0?`calc(${B} + 0px)`:`auto`,H=t(242);return v(u,{value:l,children:[_(r,{suppressHydrationWarning:!0,className:`w-full`,style:{height:V,maxWidth:`100%`,maxHeight:`calc(${H} + 0px)`}}),v(r,{className:`w-full relative bg-bg2 !fixed !top-[44px] !left-0 z-[10]`,children:[F.poster&&v(`div`,{className:`w-full h-full bg-bg2 absolute top-0 left-0 z-[1] overflow-hidden`,style:{height:B},children:[_(n,{src:F.poster,alt:f(`videoHero.coverAlt`),fill:!0,className:`object-cover`,priority:!0}),_(`div`,{className:`w-full h-full absolute top-0 left-0 z-[1] bg-[rgba(255,255,255,0.2)] backdrop-blur-[4px]`})]}),v(r,{suppressHydrationWarning:!0,"data-aspect-ratio":F.resolution,className:`w-full overflow-hidden flex justify-center relative z-[2]`,style:{height:B,maxWidth:`100%`,maxHeight:H,backdropFilter:`blur(0)`,WebkitBackdropFilter:`blur(0)`},children:[_(c,{ref:l,plyerId:`detail-player-${O.id}-${S}`,parentId:k,resolution:F.resolution||`0x0`,videoUrl:F.videoUrl,poster:F.poster,mergeConfig:L,onProgressUpdate:s?void 0:I,onPlay:s?void 0:R.handlePlay,onPause:s?void 0:R.handlePause,onEnded:s?void 0:R.handleEnded},`stable-player-${O.id}-${S}`),_(d,{videoId:O.id})]})]})]})}function C(e,t){return!e||!t?``:`${e}x${t}`}function w(e,t,n){let r=e/t;return r<=n?{width:e,height:r}:{width:n*t,height:n}}function T(e){let t=e.links||[];return t.length>0?t.map((e,t)=>({text:e.name||String(t+1),url:e.m3u8_url||e.preview_m3u8_url||``,definition:``,isDefault:t===0})).filter(e=>e.url):[]}export{b as DetailHero};
|
|
2
|
+
"use client";import{cn as e}from"../../../../../utils/cn.mjs";import{useUserStore as t}from"../../../../../store/modules/user-store.mjs";import{pContentMatchAds as n}from"../../../../../service/generated/client.mjs";import{pContentMatchAdsKey as r}from"../../../../../service/generated/tanstack.mjs";import{pxToVw as i}from"../../../../../utils/helper.mjs";import{Image as a}from"../../../../ui/image.mjs";import{Box as o}from"../../../../ui/box.mjs";import{Text as s}from"../../../../ui/text.mjs";import{useRequest as c}from"../../../../../hooks/query/use-query.mjs";import{useBrowseReport as l}from"../../../../../hooks/use-browse-report.mjs";import{MediaPreview as u,useMediaPreview as d}from"../../../../common/media-preview/index.mjs";import f from"../../../../common/video-player/index.mjs";import p from"../../../../../assets/icons/detail/video_play.mjs";import{UserActivityMediaGrid as m}from"../../../../common/list/user-activity-list/user-activity-list-item.mjs";import{VideoPlayerRefContext as ee}from"../../../../common/video-player/video-player-ref-context.mjs";import{VideoBlindAdOverlay as h}from"../../../../common/video-player/video-blind-ad-overlay.mjs";import{VideoPrerollAd as g}from"../../../../common/video-player/video-preroll-ad.mjs";import{memo as _,useCallback as v,useEffect as y,useMemo as b,useRef as x,useState as S}from"react";import{jsx as C,jsxs as w}from"react/jsx-runtime";import{useTranslations as te}from"next-intl";function T(e){return C(E,{...e})}const E=_(({mode:i=`renderer`,information:a,isVideo:l,episodeIndex:f=0,resumeProgressSeconds:p=0,className:ee=``})=>{let h=i===`editor`,g=t(e=>e.userId),_=b(()=>({id:a.id,name:a.name,preview_images:a.preview_images,img_y:a.img_y,img_x:a.img_x}),[a.id,a.name,a.preview_images,a.img_y,a.img_x]),y=b(()=>{let e=a?.medias,t=Array.isArray(e)?e.filter(Boolean):[];return t.length>0?t:(_.preview_images?.length?_.preview_images:[_.img_y||_.img_x||``].filter(Boolean)).filter(Boolean).map(e=>({media_url:e,is_video:!1,cover_image:``}))},[_.img_x,_.img_y,_.preview_images,a]),x=d(),S=b(()=>y.filter(Boolean).map(e=>{let t=e?.is_video?`video`:`image`,n=String(e?.media_url||``),r=e?.cover_image||a.img_y||a.img_x;return{src:n,type:t,...r?{cover:String(r)}:{}}}).filter(e=>!!e.src),[a.img_x,a.img_y,y]),te=v(e=>{h||!S.length||x.open(S,e)},[h,x,S]),T=b(()=>({user_id:g,ad_type:`preroll`}),[g]),E=b(()=>{let e=Math.max(0,Number(f)||0),t=a?.links?.[e]?.id;return t?String(t):`ep-${e+1}`},[f,a?.links]),{data:O,isLoading:k,isFetched:A}=c(b(()=>[`detail-preroll-ad`,a.id,E,...r(T)],[a.id,E,T]),()=>n(T),{enabled:!h&&l,staleTime:0,refetchOnMount:`always`,refetchOnWindowFocus:!1}),ne=b(()=>({data:O?.data??null,isLoading:k,isFetched:A}),[A,k,O?.data]);return h?C(`img`,{src:`/static/components-thumb/video_player.png`,alt:`video-preview`,className:`w-full block`}):l?k?C(`div`,{className:`aspect-video w-full bg-background`}):C(D,{information:a,episodeIndex:f,resumeProgressSeconds:p,isEditor:h,prerollState:ne}):w(`div`,{className:e(`w-full`,ee),children:[w(o,{className:`mt-3 px-[12px] space-y-1`,children:[C(s,{as:`p`,className:`break-all`,dangerouslySetInnerHTML:{__html:a.description}}),C(m,{medias:y,onItemClick:te})]}),C(u,{})]})});T.displayName=`DetailHero`;const D=_(({information:e,episodeIndex:t,resumeProgressSeconds:n,isEditor:r,prerollState:i})=>{let a=b(()=>({id:e.id,mid:e.mid,img_width:e.img_width,img_height:e.img_height,img_y:e.img_y,img_x:e.img_x,preview_images:e.preview_images}),[e.id,e.mid,e.img_width,e.img_height,e.img_y,e.img_x,e.preview_images]);return C(O,{information:{...e,...a},episodeIndex:t,resumeProgressSeconds:n,isEditor:r,prerollState:i})},(e,t)=>{let n=e.information,r=t.information;return n.id===r.id&&n.mid===r.mid&&n.img_width===r.img_width&&n.img_height===r.img_height&&n.img_y===r.img_y&&n.img_x===r.img_x&&e.resumeProgressSeconds===t.resumeProgressSeconds&&e.episodeIndex===t.episodeIndex&&e.isEditor===t.isEditor&&e.prerollState.data===t.prerollState.data&&e.prerollState.isLoading===t.prerollState.isLoading&&e.prerollState.isFetched===t.prerollState.isFetched});D.displayName=`StableDetailPlayerBox`;function O({information:e,episodeIndex:t,resumeProgressSeconds:n,isEditor:r,prerollState:s}){let c=x(null),u=x(null),d=x(null),m=te(`components.biz.business.detail`),_=x(0),T=x(0),E=Math.max(0,Number(t)||0),D=E+1,[O,re]=S(!1),[j,M]=S(`main`),[ie,N]=S(`auto`),[P,F]=S(!1),[I,L]=S(!1),[ae,R]=S(!1),[oe,se]=S(0),z=b(()=>e?.id,[e?.id]),B=b(()=>({id:e.id,mid:e.mid,img_width:e.img_width,img_height:e.img_height,img_y:e.img_y,img_x:e.img_x,preview_images:e.preview_images,links:e.links}),[e.id,e.mid,e.img_width,e.img_height,e.img_y,e.img_x,e.preview_images,e.links]),ce=b(()=>B.mid||B.id,[B.id,B.mid]),V=b(()=>{let e=B.links?.[E]?.id;return e?String(e):`ep-${E+1}`},[E,B.links]),H=b(()=>`__reportData_detail_page__${B.id}:${V}`,[V,B.id]),U=s.data,le=s.isLoading,ue=s.isFetched,de=U?.materials?.[0],fe=U?.hit===!0,pe=!!String(de?.advertise_video||``).trim(),W=fe&&!!de&&pe,G=b(()=>{if(r||typeof window>`u`)return 0;try{let e=sessionStorage.getItem(H);if(!e)return 0;let t=JSON.parse(e),n=Number(t.currentTime||0),r=Number(t.duration||0);if(!Number.isFinite(n)||!Number.isFinite(r))return 0;if(n>0&&r>0)return n}catch(e){console.error(`读取 sessionStorage 数据失败:`,e)}return 0},[r,H]),K=b(()=>{let e=Number(n||0);return Number.isFinite(e)&&e>0?e:0},[n]),q=b(()=>K>0?K:G,[K,G]),J=b(()=>{let t=ne(e),n=t[t.length?Math.max(0,Math.min(E,t.length-1)):0]?.url||``,r=!!t.length;if(!r)return{hasVideo:!1,hlsList:[],videoUrl:``,width:1,height:1,resolution:`0x0`,aspectRatio:1,poster:``};let i=Number(B.img_width||0)||1,a=Number(B.img_height||0)||1;return{hasVideo:r,hlsList:t,videoUrl:n,width:i,height:a,resolution:k(i,a),aspectRatio:(i||1)/(a||1),poster:B.img_y||B.img_x||B.preview_images?.[0]||``}},[e.id,e.links,E,B.img_width,B.img_height,B.img_y,B.img_x,B.preview_images]),me=v((e,t)=>{_.current=e,T.current=t},[]),he=b(()=>J.videoUrl.endsWith(`m3u8`)?{startTimeSeconds:q,preload:`none`}:{startTimeSeconds:q},[q,J.videoUrl]);y(()=>{_.current=0,T.current=0},[z,E]),y(()=>{if(re(!1),L(!1),F(!1),R(!1),N(`auto`),se(e=>e+1),r){M(`main`);return}if(W){M(`preroll`);return}M(`main`)},[z,V,r,B.id,W]),y(()=>()=>{d.current&&=(window.clearInterval(d.current),null)},[]),y(()=>{if(j!==`preroll`)return;let e=c.current?.getPlayer?.();if(e)try{e.paused||e.pause?.()}catch(e){console.warn(`贴片展示时暂停正片失败:`,e)}},[j,V,B.id]);let Y=v(e=>{let t=c.current?.getPlayer?.();if(!t)return null;try{`muted`in t&&(t.muted=e),`video`in t&&t.video&&(t.video.muted=e),t.volume=e?0:1}catch(e){console.warn(`同步详情页播放器静音状态失败:`,e)}return t},[]),ge=v(()=>{d.current&&=(window.clearInterval(d.current),null);let e=0;d.current=window.setInterval(()=>{e+=1;let t=c.current?.getPlayer?.();if(!t){e>=8&&d.current&&(window.clearInterval(d.current),d.current=null);return}d.current&&=(window.clearInterval(d.current),null),t.play?.().catch(e=>{let t=typeof e==`object`&&e&&`name`in e?String(e.name||``):``,n=typeof e==`object`&&e&&`message`in e?String(e.message||``):String(e||``);if(t===`NotAllowedError`||/user didn't interact|NotAllowedError/i.test(n)){let e=Y(!0);if(!e){R(!0);return}e.play?.().then(()=>{R(!1)}).catch(e=>{console.warn(`详情页静音自动播放失败:`,e),R(!0)});return}console.warn(`详情页恢复正片播放失败:`,e)})},180)},[Y]),X=!r&&ue&&!le&&!I&&(!W||P);y(()=>{!X||!O||(R(!1),ge())},[ge,O,X]);let Z=l({contentId:z,browseEpisode:D,contentType:1,enabled:!r&&!!z,intervalMs:60*1e3,getCurrentTimeSeconds:()=>_.current,getDurationSeconds:()=>T.current}),_e=v(()=>{if(I){let e=c.current?.getPlayer?.();e&&(e.currentTime=0)}F(!0),R(!1),N(`manual`),L(!1),M(`main`)},[I]),ve=v(()=>{N(`manual`)},[]),ye=v(()=>{re(!0)},[]),be=v(()=>{L(!1),R(!1)},[]),xe=v(()=>{be(),Z.handlePlay()},[Z,be]),Se=v(()=>{Z.handleEnded(),W&&(L(!0),R(!1),F(!1),N(`manual`),se(e=>e+1),M(`main`))},[Z,W]),Ce=W&&j===`main`&&(I||!P&&ie===`manual`),we=j===`main`&&ae,Te=!r&&!ue,Ee=Te,De=X,Oe=!Te&&(!W||P);async function ke(){W&&(L(!1),F(!1),N(`manual`),M(`preroll`),await u.current?.play?.()||M(`main`))}async function Ae(){let e=Y(!1);if(e)try{await e.play?.(),R(!1)}catch(e){console.warn(`用户点击后启动正片播放失败:`,e)}}if(y(()=>{if(r)return;let e=()=>{if(!(typeof window>`u`)&&!(_.current<=0||T.current<=0))try{sessionStorage.setItem(H,JSON.stringify({episodeId:V,currentTime:_.current,duration:T.current}))}catch(e){console.error(`写入 sessionStorage 失败:`,e)}},t=()=>{e()},n=()=>{document.visibilityState===`hidden`&&e()},i=()=>{e()};return window.addEventListener(`beforeunload`,t),document.addEventListener(`visibilitychange`,n),window.addEventListener(`popstate`,i),()=>{window.removeEventListener(`beforeunload`,t),document.removeEventListener(`visibilitychange`,n),window.removeEventListener(`popstate`,i),e()}},[V,r,H]),!J.hasVideo)return C(`div`,{className:`mt-3 rounded-xl bg-bg1 px-3 py-10 text-center text-text3`,children:m(`videoHero.noVideos`)});let Q=A(430,J.aspectRatio,242),$=Q.height>0?i(Q.height):`auto`,je=Q.height>0?`calc(${$} + 0px)`:`auto`,Me=i(242);return w(ee,{value:c,children:[C(o,{suppressHydrationWarning:!0,className:`w-full`,style:{height:je,maxWidth:`100%`,maxHeight:`calc(${Me} + 0px)`}}),w(o,{className:`w-full bg-bg2 !fixed !top-[44px] !left-0 z-[10]`,children:[J.poster&&w(`div`,{className:`w-full h-full bg-bg2 absolute top-0 left-0 z-[1] overflow-hidden`,style:{height:$},children:[C(a,{src:J.poster,alt:m(`videoHero.coverAlt`),fill:!0,className:`object-cover`,priority:!0}),C(`div`,{className:`w-full h-full absolute top-0 left-0 z-[1] bg-[rgba(255,255,255,0.2)] backdrop-blur-[4px]`})]}),w(o,{suppressHydrationWarning:!0,"data-aspect-ratio":J.resolution,className:`w-full overflow-hidden flex justify-center relative z-[2]`,style:{height:$,maxWidth:`100%`,maxHeight:Me,backdropFilter:`blur(0)`,WebkitBackdropFilter:`blur(0)`},children:[Oe&&C(f,{ref:c,plyerId:`detail-player-${B.id}-${E}`,parentId:ce,...De?{autoplay:!0}:{autoplay:!1},resolution:J.resolution||`0x0`,videoUrl:J.videoUrl,poster:J.poster,mergeConfig:he,onProgressUpdate:r?void 0:me,onPlay:r?void 0:xe,onPause:r?void 0:Z.handlePause,onEnded:r?void 0:Se,onPlayerReady:ye},`stable-player-${B.id}-${E}-${De?`default-autoplay`:`manual`}`),!r&&W&&C(g,{ref:u,adData:U,visible:j===`preroll`,autoStart:j===`preroll`&&ie===`auto`,sessionKey:`${B.id}-${V}-${oe}`,onAutoplayBlocked:ve,onFinish:_e,onSkip:_e}),Ce&&!we&&C(`button`,{type:`button`,className:`absolute inset-0 z-[10000] flex items-center justify-center bg-black/35 text-white`,onClick:()=>{ke()},children:C(`span`,{className:`flex items-center justify-center w-14 h-14 rounded-full bg-[rgba(0,0,0,0.55)]`,children:C(p,{className:`w-[18px] h-[24px] text-white translate-x-[1px]`})})}),we&&C(`button`,{type:`button`,className:`absolute inset-0 z-[10001] flex items-center justify-center bg-black/35 text-white`,onClick:()=>{Ae()},children:C(`span`,{className:`flex items-center justify-center w-14 h-14 rounded-full bg-[rgba(0,0,0,0.55)]`,children:C(p,{className:`w-[18px] h-[24px] text-white translate-x-[1px]`})})}),Ee&&C(`div`,{className:`absolute inset-0 z-[9998] flex items-center justify-center bg-black/20 text-white`,children:C(`span`,{className:`rounded-full bg-[rgba(0,0,0,0.45)] px-5 py-2 text-sm`,children:`加载中`})}),C(h,{videoId:B.id})]})]})]})}function k(e,t){return!e||!t?``:`${e}x${t}`}function A(e,t,n){let r=e/t;return r<=n?{width:e,height:r}:{width:n*t,height:n}}function ne(e){let t=e.links||[];return t.length>0?t.map((e,t)=>({text:e.name||String(t+1),url:e.m3u8_url||e.preview_m3u8_url||``,definition:``,isDefault:t===0})).filter(e=>e.url):[]}export{T as DetailHero};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{pContentGetNewstVideoList as e,pContentGetPopularVideoList as t}from"../../../../../service/generated/client.mjs";import{Image as n}from"../../../../ui/image.mjs";import{Box as r}from"../../../../ui/box.mjs";import{Text as i}from"../../../../ui/text.mjs";import a from"../../../../ui/loading.mjs";import o from"../../../../ui/link.mjs";import{useGridFirstRowHeight as s,useWaterfallFirstRowHeight as c}from"../../../../../hooks/use-first-row-height.mjs";import{useMinDurationLoading as l}from"../../../../../hooks/use-min-duration-loading.mjs";import u from"../../../../../assets/icons/common/right_arrow.mjs";import d from"../../../../../assets/icons/common/right_arrow_thin.mjs";import f from"../../../../../assets/icons/detail/video_flag.mjs";import{RECOMMEND_BADGE_IMAGE_CLASS_NAME as p,RECOMMEND_TOP_LEFT_BADGE_WRAPPER_CLASS_NAME as ee,normalizeRecommendBadgeUrl as m}from"../../../../common/list/waterfall-recommend/recommend-badge-style.mjs";import{WATERFALL_SHORT_CARD_ASPECT_RATIO as h,WATERFALL_TALL_CARD_ASPECT_RATIO as te,buildWaterfallRecommendLegacyDisplay as g}from"../../../../common/list/waterfall-recommend/waterfall-recommend-display.mjs";import{WaterfallRecommend as ne}from"../../../../common/list/waterfall-recommend/waterfall-recommend.mjs";import{HOME_RECOMMEND_DEFAULT_GRID_COLUMNS as re,HOME_RECOMMEND_DEFAULT_GRID_ROWS as ie,HOME_RECOMMEND_DEFAULT_PLAY_COUNT_DELTA as ae,HOME_RECOMMEND_DEFAULT_SHOW_EPISODE as _,HOME_RECOMMEND_DEFAULT_SHOW_PLAY_COUNT as v,HOME_RECOMMEND_DEFAULT_TITLE as oe,HOME_RECOMMEND_MAX_GRID_COLUMNS as se,HOME_RECOMMEND_MAX_GRID_ROWS as ce}from"./home-recommend-default-config.mjs";import{buildHomeRecommendHeatText as y,resolveHomeRecommendBrowseCount as b}from"./home-recommend-play-count.mjs";import{HOME_RECOMMEND_CARD_CONFIG_FIELD as le}from"./home-recommend-preview.mjs";import{limitPopularVideoPageItems as ue}from"./home-recommend-smart-tag.mjs";import{enrichHomeRecommendItemsWithVideoDetails as de}from"./home-recommend-video-detail.mjs";import{useCallback as fe,useEffect as x,useLayoutEffect as pe,useMemo as S,useRef as C,useState as w}from"react";import{Fragment as me,jsx as T,jsxs as E}from"react/jsx-runtime";const he={backgroundImage:`var(--gradient-card-mask-medium)`},ge={},_e={list:[]},D=new Map,O=[];function ve(e){if(e)return D.get(e)}function ye(e,t){if(!e||(D.has(e)||O.push(e),D.set(e,{items:[...t.items],cursor:t.cursor}),O.length<=120))return;let n=O.shift();n&&D.delete(n)}function be({variant:n,props:f=ge,data:p=_e,mode:ee=`renderer`}){let m=ee===`editor`,{list:h,title:te,cursor:g}=p,y=S(()=>Array.isArray(h)?h:[],[h]),b=S(()=>Array.isArray(p.icons)?p.icons:[],[p.icons]),{rows:le,columns:he,moreLink:D,title:O,showPlayCount:be,playCountDelta:Se,showEpisode:k,enableInfinite:Ee,items:A,smartLayout:j}=f,M=j?.enabled===!0,N=M&&isHomeRecommendLatestSortRule(j?.sortRule),P=Ee===!0&&M,F=!m&&P&&y.length>=16,I=S(()=>M||!Array.isArray(A)?``:A.map(e=>String(e?.contentId||``).trim()).filter(Boolean).join(`,`),[M,A]),[L,De]=w(0),[R,z]=w(y),[Ae,Me]=w(b),[Ne,B]=w(()=>typeof g==`string`?g:void 0),[V,Pe]=w(!1),Fe=C(null),Ie=C(null),H=C(null),Le=C([]),U=C({left:null,right:null}),W=C(!1),G=C(``),{isLoading:Re,show:ze,hide:Be}=l(600),Ve=we(le,ie,ce),K=we(he,re,se),q=P?16:n===`grid`?Ve*K:16,J=S(()=>[n,(()=>{if(!M||!j)return`manual:${I}`;if(N)return`smart:newest:${j.tagIds.join(`,`)}:${j.catIds.join(`,`)}`;let e=String(j.sortRule??``);return`smart:popular:${j.tagIds.join(`,`)}:${j.catIds.join(`,`)}:sr:${e}`})(),String(q)].join(`|`),[M,I,q,j,N,n]);x(()=>{z(y),Me(b),B(typeof g==`string`?g:void 0)},[g,b,y]);let He=Ve*K,Ue=m&&n===`grid`,Y=Ue?R.slice(0,He):R,We=Ue?Ae.slice(0,He):Ae,Ge=n===`waterfall`?6:4,Ke=Y.length>0?Math.max(0,Y.length-Ge):-1,qe=!!Ne,Je=O&&O.trim()||te||oe,X=be??v,Z=Number(Se??ae),Q=k??_,Ye=`flex-1 min-w-0 text-[18px] leading-[24px] font-medium line-clamp-1 text-text2`,Xe=n===`grid`?d:m?u:d,Ze=Ce(D),Qe=(n===`waterfall`||!P)&&!!Ze,$e=Qe?Ze:``,et=n===`grid`?`flex size-[24px] shrink-0 items-center justify-center ${m?`opacity-100`:`opacity-50`}`:`ml-[8px] flex size-[24px] shrink-0 items-center justify-center ${m?`opacity-100`:`opacity-50`}`,tt=`size-[16px] text-text1`,nt=s({enabled:!m&&n===`grid`,containerRef:Ie,firstRowItemRef:Le,columns:K,itemsCount:Y.length,deps:[n]}),rt=c({enabled:!m&&n===`waterfall`,containerRef:Fe,firstRowRef:U,deps:[n,Y.length]}),it=n===`grid`?nt:rt,at=fe(async()=>{if(m||G.current===J)return;let e=ve(J);if(e){z(e.items),M&&B(e.cursor);return}if(M||I){G.current=J;try{if(ze(),!M){if(!I)return;let e=await de(y);z(e),ye(J,{items:e});return}if(!j)return;let e=await t({page_size:q,tags:j.tagIds.length>0?j.tagIds:void 0,cat_ids:j.catIds.length>0?j.catIds:void 0},{cache:`no-store`}),n=ue(e.data?.videos,q),r=e.data?.cursor;z(n),B(r),ye(J,{items:n,cursor:r})}catch(e){console.error(`推荐位刷新首屏失败(client)`,e)}finally{G.current===J&&(G.current=``),Be()}}},[Be,y,m,M,I,J,q,ze,j,N]);x(()=>{at()},[at]);let ot=fe(async()=>{let n=Ne;if(!(!F||!n||W.current)){W.current=!0,Pe(!0);try{if(!j)return;let r={cursor:n,page_size:q,tags:j.tagIds.length>0?j.tagIds:void 0,cat_ids:j.catIds.length>0?j.catIds:void 0},i=N?await e(r):await t(r),a=Array.isArray(i.data?.videos)?i.data.videos:[],o=i.data?.cursor;a.length>0&&z(e=>e.concat(a)),B(e=>{if(!(!a.length||!o))return o===e?void 0:o})}catch(e){console.error(`推荐位加载下一页失败(client)`,e),B(void 0)}finally{W.current=!1,Pe(!1)}}},[Ne,q,F,j,N]);x(()=>{let e=H.current;if(!e||!F||!qe)return;let t=new IntersectionObserver(e=>{!e[0]?.isIntersecting||V||ot()},{root:null,threshold:0});return t.observe(e),()=>{t.disconnect()}},[ot,qe,V,Y.length,q,F,Ke]),pe(()=>{let e=Fe.current;if(!e||n!==`waterfall`)return;let t=()=>{let t=e.clientWidth||0;De(t>0?(t-15)/2:0)};t();let r=new ResizeObserver(t);return r.observe(e),()=>{r.disconnect()}},[n]);let $=S(()=>n===`waterfall`?ke(Y,We,L):{left:[],right:[]},[L,We,Y,n]),st=S(()=>n===`waterfall`?{left:$.left.map(e=>Oe(e,X,Z,Q)),right:$.right.map(e=>Oe(e,X,Z,Q))}:{left:[],right:[]},[Z,Q,X,n,$.left,$.right]);if(x(()=>{n===`waterfall`&&($.left.length||(U.current.left=null),$.right.length||(U.current.right=null))},[n,$.left.length,$.right.length]),!Y.length)return null;let ct=!m&&Re,lt=!m&&V,ut=it>0?it/2:160;return E(r,{className:`w-full mt-[16px]`,children:[n===`grid`&&E(r,{className:`flex items-center justify-between pl-[16px] pr-0 mb-[16px]`,children:[T(i,{className:Ye,children:Je}),Qe&&T(o,{href:$e,"aria-label":`更多`,className:et,children:T(Xe,{className:tt})})]}),n===`grid`&&E(r,{ref:Ie,className:`relative flex w-full flex-wrap items-start gap-[16px] px-[16px]`,children:[Y.map((e,t)=>{let n=We[t],r=Te(e);return T(`div`,{ref:e=>{t===Ke&&(H.current=e),t<K&&(Le.current[t]=e)},className:`w-[calc((100%-16px)/2)]`,children:T(xe,{item:e,icon:n,index:t,showPlayCount:X&&(r?.showPlayCount??!0),playCountDelta:r?.playCountDelta??Z,showEpisode:r?.showEpisode??Q,widthStyle:{width:`100%`}})},je(e,t))}),ct&&T(r,{className:`absolute inset-0 z-10 bg-black/15 backdrop-blur-[1px] dark:bg-white/10`,"aria-hidden":!0}),ct&&T(r,{className:`absolute left-1/2 -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none`,style:{top:ut},"aria-hidden":!0,children:T(a,{size:`large`,showLabel:!1,className:`text-theme5`})})]}),n===`waterfall`&&T(ne,{title:Je,moreHref:$e||void 0,moreIcon:Qe?T(Xe,{className:tt}):void 0,titleClassName:Ye,moreLinkClassName:et,columns:st,containerClassName:`relative flex w-full gap-[15px] px-[16px]`,getItemRef:({item:e,column:t,columnIndex:n})=>r=>{e.sourceIndex===Ke&&(H.current=r),n===0&&(U.current[t]=r)},overlay:ct?E(me,{children:[T(r,{className:`absolute inset-0 z-10 bg-black/15 backdrop-blur-[1px] dark:bg-white/10`,"aria-hidden":!0}),T(r,{className:`absolute left-1/2 -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none`,style:{top:ut},"aria-hidden":!0,children:T(a,{size:`large`,showLabel:!1,className:`text-theme5`})})]}):void 0}),lt&&T(r,{className:`w-full flex justify-center py-[12px]`,children:T(a,{size:`medium`,showLabel:!1,className:`text-theme5`})})]})}function xe({item:e,icon:t,index:n,showPlayCount:r,playCountDelta:i,showEpisode:a,widthStyle:o}){return T(Se,{item:e,icon:t,index:n,showPlayCount:r,playCountDelta:i,showEpisode:a,widthStyle:o})}function Se({item:e,icon:t,index:a,showPlayCount:s,playCountDelta:c,showEpisode:l,widthStyle:u}){let d=j(e),ne=d===`short`?h:te,re=M(e,d),ie=e.name||e?.title||``,ae=e.id?k(e):`#`,_=g({title:ie,badgeImageUrl:z(e,t,a),episodeText:I(e,l),heatText:s?y(b(e),c):``,score:P(e.score)}),v=m(_.topLeftBadgeImageUrl);return T(o,{href:ae,className:`block w-full`,style:u,children:E(me,{children:[E(r,{className:`relative w-full overflow-hidden rounded-[8px] bg-bg3`,style:{aspectRatio:ne},children:[re&&T(n,{src:re,alt:ie||`推荐封面`,fill:!0,objectFit:`cover`,className:`object-cover object-top`}),T(r,{className:`pointer-events-none absolute inset-0 rounded-[8px]`,style:he,"aria-hidden":!0}),v&&T(r,{className:ee,children:T(n,{src:v,alt:`角标`,width:96,height:18,className:p})}),_.topRightScoreText&&T(i,{as:`span`,className:`absolute right-[8px] top-[8px] z-10 shrink-0 text-[14px] leading-[22px] font-semibold text-[#FFC24B]`,children:_.topRightScoreText}),E(r,{className:`absolute left-[8px] right-[8px] bottom-[8px] z-10 flex items-end justify-between gap-[8px]`,children:[T(r,{className:`flex min-w-0 items-center gap-[4px]`,children:_.bottomLeftHeatText&&E(me,{children:[T(f,{className:`h-[16px] w-[16px] shrink-0 text-white`}),T(i,{as:`span`,className:`min-w-0 truncate text-[14px] leading-[20px] text-white`,children:_.bottomLeftHeatText})]})}),_.bottomRightEpisodeText&&T(i,{as:`span`,className:`shrink-0 text-[14px] leading-[20px] text-white`,children:_.bottomRightEpisodeText})]})]}),T(r,{className:`mt-[8px] overflow-hidden`,children:T(i,{as:`h3`,className:`line-clamp-2 text-[16px] leading-[22px] text-[--color-text-white80]`,children:_.title})})]})})}function k(e){let t=encodeURIComponent(e.name||``);return`/video/${e.id||``}/${t}/episode/1`}function Ce(e){return e?e.trim():``}function we(e,t,n){let r=Number(e);return!Number.isFinite(r)||r<=0?t:Math.min(n,Math.floor(r))}function Te(e){return e[le]}function Ee(e){return typeof e==`string`?e:``}function A(e){return typeof e==`string`?e.trim():``}function j(e){return A(e.img_type).toLowerCase()===`long`?`short`:`tall`}function M(e,t){return t===`short`?e.img_x||e.img_y||e?.coverUrl:e.img_y||e.img_x||e?.coverUrl}function N(e,t){return(e.tags?.map(e=>e.name).filter(Boolean).join(` · `)??``)||(t?F(e,!0):``)}function P(e){let t=Number(e);if(!(!Number.isFinite(t)||t<=0))return t>10&&t<=100?t/10:Math.min(t,10)}function F(e,t){return t?L(e)||R(Number(e.duration||0)):``}function I(e,t){return t?L(e):``}function L(e){if(!De(e))return``;let t=e.update_status===`0`,n=Number(e.episode_cnt||e.links?.length||0);return n>0?`${t?`更新至`:`全`}${n}集`:``}function De(e){if(Number(e.type??0)===2)return!0;let t=Number(e.episode_cnt||e.links?.length||0);return Number.isFinite(t)&&t>1}function R(e){if(!Number.isFinite(e)||e<=0)return``;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=e=>String(e).padStart(2,`0`);return n>0?`${a(n)}:${a(r)}:${a(i)}`:`${a(r)}:${a(i)}`}function z(e,t,n){return Ee(e.badge_url)||Ee(t?.material_url)||``}function Oe(e,t,n,r){let i=j(e.item),a=M(e.item,i),o=e.item.name||e.item?.title||``,s=e.item.id?k(e.item):`#`,c=z(e.item,e.icon,e.index),l=F(e.item,r),u=N(e.item,r),d=t?y(b(e.item),n):``,f=P(e.item.score);return{key:je(e.item,e.index),sourceIndex:e.index,href:s,cardKind:i,coverUrl:a,title:o,badgeImageUrl:c,episodeText:l,metaPrimaryText:u,heatText:d,score:f}}function ke(e,t,n){let r=[],i=[],a=n<=0,o=0,s=0;return e.forEach((e,c)=>{let l=t[c];if(a){c%2==0?r.push({item:e,icon:l,index:c}):i.push({item:e,icon:l,index:c});return}let u=Ae(n,e);o<=s?(r.push({item:e,icon:l,index:c}),o+=u):(i.push({item:e,icon:l,index:c}),s+=u)}),{left:r,right:i}}function Ae(e,t){return e?(j(t)===`tall`?216:142)+16:0}function je(e,t){return e.id?`home-recommend-${e.id}-${t}`:`home-recommend-${t}`}export{be as default};
|
|
2
|
+
"use client";import{pContentGetNewstVideoList as e,pContentGetPopularVideoList as t}from"../../../../../service/generated/client.mjs";import{Image as n}from"../../../../ui/image.mjs";import{Box as r}from"../../../../ui/box.mjs";import{Text as i}from"../../../../ui/text.mjs";import a from"../../../../ui/loading.mjs";import o from"../../../../ui/link.mjs";import{useGridFirstRowHeight as s,useWaterfallFirstRowHeight as c}from"../../../../../hooks/use-first-row-height.mjs";import{useMinDurationLoading as l}from"../../../../../hooks/use-min-duration-loading.mjs";import u from"../../../../../assets/icons/common/right_arrow.mjs";import d from"../../../../../assets/icons/common/right_arrow_thin.mjs";import f from"../../../../../assets/icons/detail/video_flag.mjs";import{RECOMMEND_BADGE_IMAGE_CLASS_NAME as p,RECOMMEND_TOP_LEFT_BADGE_WRAPPER_CLASS_NAME as ee,normalizeRecommendBadgeUrl as m}from"../../../../common/list/waterfall-recommend/recommend-badge-style.mjs";import{WATERFALL_SHORT_CARD_ASPECT_RATIO as h,WATERFALL_TALL_CARD_ASPECT_RATIO as te,buildWaterfallRecommendLegacyDisplay as g}from"../../../../common/list/waterfall-recommend/waterfall-recommend-display.mjs";import{WaterfallRecommend as ne}from"../../../../common/list/waterfall-recommend/waterfall-recommend.mjs";import{HOME_RECOMMEND_DEFAULT_GRID_COLUMNS as re,HOME_RECOMMEND_DEFAULT_GRID_ROWS as ie,HOME_RECOMMEND_DEFAULT_PLAY_COUNT_DELTA as ae,HOME_RECOMMEND_DEFAULT_SHOW_EPISODE as _,HOME_RECOMMEND_DEFAULT_SHOW_PLAY_COUNT as v,HOME_RECOMMEND_DEFAULT_TITLE as oe,HOME_RECOMMEND_MAX_GRID_COLUMNS as se,HOME_RECOMMEND_MAX_GRID_ROWS as ce}from"./home-recommend-default-config.mjs";import{buildHomeRecommendHeatText as y,resolveHomeRecommendBrowseCount as b}from"./home-recommend-play-count.mjs";import{HOME_RECOMMEND_CARD_CONFIG_FIELD as le}from"./home-recommend-preview.mjs";import{isHomeRecommendLatestSortRule as ue}from"./home-recommend-smart-layout.mjs";import{limitPopularVideoPageItems as de}from"./home-recommend-smart-tag.mjs";import{enrichHomeRecommendItemsWithVideoDetails as fe}from"./home-recommend-video-detail.mjs";import{useCallback as pe,useEffect as x,useLayoutEffect as me,useMemo as S,useRef as C,useState as w}from"react";import{Fragment as he,jsx as T,jsxs as E}from"react/jsx-runtime";const ge={backgroundImage:`var(--gradient-card-mask-medium)`},_e={},ve={list:[]},D=new Map,O=[];function ye(e){if(e)return D.get(e)}function be(e,t){if(!e||(D.has(e)||O.push(e),D.set(e,{items:[...t.items],cursor:t.cursor}),O.length<=120))return;let n=O.shift();n&&D.delete(n)}function xe({variant:n,props:f=_e,data:p=ve,mode:ee=`renderer`}){let m=ee===`editor`,{list:h,title:te,cursor:g}=p,y=S(()=>Array.isArray(h)?h:[],[h]),b=S(()=>Array.isArray(p.icons)?p.icons:[],[p.icons]),{rows:le,columns:ge,moreLink:D,title:O,showPlayCount:xe,playCountDelta:Ce,showEpisode:k,enableInfinite:De,items:A,smartLayout:j}=f,M=j?.enabled===!0,N=M&&ue(j?.sortRule),P=De===!0&&M,F=!m&&P&&y.length>=16,I=S(()=>M||!Array.isArray(A)?``:A.map(e=>String(e?.contentId||``).trim()).filter(Boolean).join(`,`),[M,A]),[L,Oe]=w(0),[R,z]=w(y),[je,Ne]=w(b),[Pe,B]=w(()=>typeof g==`string`?g:void 0),[V,Fe]=w(!1),Ie=C(null),Le=C(null),H=C(null),Re=C([]),U=C({left:null,right:null}),W=C(!1),G=C(``),{isLoading:ze,show:Be,hide:Ve}=l(600),He=Te(le,ie,ce),K=Te(ge,re,se),q=P?16:n===`grid`?He*K:16,J=S(()=>[n,(()=>{if(!M||!j)return`manual:${I}`;if(N)return`smart:newest:${j.tagIds.join(`,`)}:${j.catIds.join(`,`)}`;let e=String(j.sortRule??``);return`smart:popular:${j.tagIds.join(`,`)}:${j.catIds.join(`,`)}:sr:${e}`})(),String(q)].join(`|`),[M,I,q,j,N,n]);x(()=>{z(y),Ne(b),B(typeof g==`string`?g:void 0)},[g,b,y]);let Ue=He*K,We=m&&n===`grid`,Y=We?R.slice(0,Ue):R,Ge=We?je.slice(0,Ue):je,Ke=n===`waterfall`?6:4,qe=Y.length>0?Math.max(0,Y.length-Ke):-1,Je=!!Pe,Ye=O&&O.trim()||te||oe,X=xe??v,Z=Number(Ce??ae),Q=k??_,Xe=`flex-1 min-w-0 text-[18px] leading-[24px] font-medium line-clamp-1 text-text2`,Ze=n===`grid`?d:m?u:d,Qe=we(D),$e=(n===`waterfall`||!P)&&!!Qe,et=$e?Qe:``,tt=n===`grid`?`flex size-[24px] shrink-0 items-center justify-center ${m?`opacity-100`:`opacity-50`}`:`ml-[8px] flex size-[24px] shrink-0 items-center justify-center ${m?`opacity-100`:`opacity-50`}`,nt=`size-[16px] text-text1`,rt=s({enabled:!m&&n===`grid`,containerRef:Le,firstRowItemRef:Re,columns:K,itemsCount:Y.length,deps:[n]}),it=c({enabled:!m&&n===`waterfall`,containerRef:Ie,firstRowRef:U,deps:[n,Y.length]}),at=n===`grid`?rt:it,ot=pe(async()=>{if(m||G.current===J)return;let e=ye(J);if(e){z(e.items),M&&B(e.cursor);return}if(M||I){G.current=J;try{if(Be(),!M){if(!I)return;let e=await fe(y);z(e),be(J,{items:e});return}if(!j)return;let e=await t({page_size:q,tags:j.tagIds.length>0?j.tagIds:void 0,cat_ids:j.catIds.length>0?j.catIds:void 0},{cache:`no-store`}),n=de(e.data?.videos,q),r=e.data?.cursor;z(n),B(r),be(J,{items:n,cursor:r})}catch(e){console.error(`推荐位刷新首屏失败(client)`,e)}finally{G.current===J&&(G.current=``),Ve()}}},[Ve,y,m,M,I,J,q,Be,j]);x(()=>{ot()},[ot]);let st=pe(async()=>{let n=Pe;if(!(!F||!n||W.current)){W.current=!0,Fe(!0);try{if(!j)return;let r={cursor:n,page_size:q,tags:j.tagIds.length>0?j.tagIds:void 0,cat_ids:j.catIds.length>0?j.catIds:void 0},i=N?await e(r):await t(r),a=Array.isArray(i.data?.videos)?i.data.videos:[],o=i.data?.cursor;a.length>0&&z(e=>e.concat(a)),B(e=>{if(!(!a.length||!o))return o===e?void 0:o})}catch(e){console.error(`推荐位加载下一页失败(client)`,e),B(void 0)}finally{W.current=!1,Fe(!1)}}},[Pe,q,F,j,N]);x(()=>{let e=H.current;if(!e||!F||!Je)return;let t=new IntersectionObserver(e=>{!e[0]?.isIntersecting||V||st()},{root:null,threshold:0});return t.observe(e),()=>{t.disconnect()}},[st,Je,V,Y.length,q,F,qe]),me(()=>{let e=Ie.current;if(!e||n!==`waterfall`)return;let t=()=>{let t=e.clientWidth||0;Oe(t>0?(t-15)/2:0)};t();let r=new ResizeObserver(t);return r.observe(e),()=>{r.disconnect()}},[n]);let $=S(()=>n===`waterfall`?Ae(Y,Ge,L):{left:[],right:[]},[L,Ge,Y,n]),ct=S(()=>n===`waterfall`?{left:$.left.map(e=>ke(e,X,Z,Q)),right:$.right.map(e=>ke(e,X,Z,Q))}:{left:[],right:[]},[Z,Q,X,n,$.left,$.right]);if(x(()=>{n===`waterfall`&&($.left.length||(U.current.left=null),$.right.length||(U.current.right=null))},[n,$.left.length,$.right.length]),!Y.length)return null;let lt=!m&&ze,ut=!m&&V,dt=at>0?at/2:160;return E(r,{className:`w-full mt-[16px]`,children:[n===`grid`&&E(r,{className:`flex items-center justify-between pl-[16px] pr-0 mb-[16px]`,children:[T(i,{className:Xe,children:Ye}),$e&&T(o,{href:et,"aria-label":`更多`,className:tt,children:T(Ze,{className:nt})})]}),n===`grid`&&E(r,{ref:Le,className:`relative flex w-full flex-wrap items-start gap-[16px] px-[16px]`,children:[Y.map((e,t)=>{let n=Ge[t],r=Ee(e);return T(`div`,{ref:e=>{t===qe&&(H.current=e),t<K&&(Re.current[t]=e)},className:`w-[calc((100%-16px)/2)]`,children:T(Se,{item:e,icon:n,index:t,showPlayCount:X&&(r?.showPlayCount??!0),playCountDelta:r?.playCountDelta??Z,showEpisode:r?.showEpisode??Q,widthStyle:{width:`100%`}})},Me(e,t))}),lt&&T(r,{className:`absolute inset-0 z-10 bg-black/15 backdrop-blur-[1px] dark:bg-white/10`,"aria-hidden":!0}),lt&&T(r,{className:`absolute left-1/2 -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none`,style:{top:dt},"aria-hidden":!0,children:T(a,{size:`large`,showLabel:!1,className:`text-theme5`})})]}),n===`waterfall`&&T(ne,{title:Ye,moreHref:et||void 0,moreIcon:$e?T(Ze,{className:nt}):void 0,titleClassName:Xe,moreLinkClassName:tt,columns:ct,containerClassName:`relative flex w-full gap-[15px] px-[16px]`,getItemRef:({item:e,column:t,columnIndex:n})=>r=>{e.sourceIndex===qe&&(H.current=r),n===0&&(U.current[t]=r)},overlay:lt?E(he,{children:[T(r,{className:`absolute inset-0 z-10 bg-black/15 backdrop-blur-[1px] dark:bg-white/10`,"aria-hidden":!0}),T(r,{className:`absolute left-1/2 -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none`,style:{top:dt},"aria-hidden":!0,children:T(a,{size:`large`,showLabel:!1,className:`text-theme5`})})]}):void 0}),ut&&T(r,{className:`w-full flex justify-center py-[12px]`,children:T(a,{size:`medium`,showLabel:!1,className:`text-theme5`})})]})}function Se({item:e,icon:t,index:n,showPlayCount:r,playCountDelta:i,showEpisode:a,widthStyle:o}){return T(Ce,{item:e,icon:t,index:n,showPlayCount:r,playCountDelta:i,showEpisode:a,widthStyle:o})}function Ce({item:e,icon:t,index:a,showPlayCount:s,playCountDelta:c,showEpisode:l,widthStyle:u}){let d=j(e),ne=d===`short`?h:te,re=M(e,d),ie=e.name||e?.title||``,ae=e.id?k(e):`#`,_=g({title:ie,badgeImageUrl:z(e,t,a),episodeText:I(e,l),heatText:s?y(b(e),c):``,score:P(e.score)}),v=m(_.topLeftBadgeImageUrl);return T(o,{href:ae,className:`block w-full`,style:u,children:E(he,{children:[E(r,{className:`relative w-full overflow-hidden rounded-[8px] bg-bg3`,style:{aspectRatio:ne},children:[re&&T(n,{src:re,alt:ie||`推荐封面`,fill:!0,objectFit:`cover`,className:`object-cover object-top`}),T(r,{className:`pointer-events-none absolute inset-0 rounded-[8px]`,style:ge,"aria-hidden":!0}),v&&T(r,{className:ee,children:T(n,{src:v,alt:`角标`,width:96,height:18,className:p})}),_.topRightScoreText&&T(i,{as:`span`,className:`absolute right-[8px] top-[8px] z-10 shrink-0 text-[14px] leading-[22px] font-semibold text-[#FFC24B]`,children:_.topRightScoreText}),E(r,{className:`absolute left-[8px] right-[8px] bottom-[8px] z-10 flex items-end justify-between gap-[8px]`,children:[T(r,{className:`flex min-w-0 items-center gap-[4px]`,children:_.bottomLeftHeatText&&E(he,{children:[T(f,{className:`h-[16px] w-[16px] shrink-0 text-white`}),T(i,{as:`span`,className:`min-w-0 truncate text-[14px] leading-[20px] text-white`,children:_.bottomLeftHeatText})]})}),_.bottomRightEpisodeText&&T(i,{as:`span`,className:`shrink-0 text-[14px] leading-[20px] text-white`,children:_.bottomRightEpisodeText})]})]}),T(r,{className:`mt-[8px] overflow-hidden`,children:T(i,{as:`h3`,className:`line-clamp-2 text-[16px] leading-[22px] text-[--color-text-white80]`,children:_.title})})]})})}function k(e){let t=encodeURIComponent(e.name||``);return`/video/${e.id||``}/${t}/episode/1`}function we(e){return e?e.trim():``}function Te(e,t,n){let r=Number(e);return!Number.isFinite(r)||r<=0?t:Math.min(n,Math.floor(r))}function Ee(e){return e[le]}function De(e){return typeof e==`string`?e:``}function A(e){return typeof e==`string`?e.trim():``}function j(e){return A(e.img_type).toLowerCase()===`long`?`short`:`tall`}function M(e,t){return t===`short`?e.img_x||e.img_y||e?.coverUrl:e.img_y||e.img_x||e?.coverUrl}function N(e,t){return(e.tags?.map(e=>e.name).filter(Boolean).join(` · `)??``)||(t?F(e,!0):``)}function P(e){let t=Number(e);if(!(!Number.isFinite(t)||t<=0))return t>10&&t<=100?t/10:Math.min(t,10)}function F(e,t){return t?L(e)||R(Number(e.duration||0)):``}function I(e,t){return t?L(e):``}function L(e){if(!Oe(e))return``;let t=e.update_status===`0`,n=Number(e.episode_cnt||e.links?.length||0);return n>0?`${t?`更新至`:`全`}${n}集`:``}function Oe(e){if(Number(e.type??0)===2)return!0;let t=Number(e.episode_cnt||e.links?.length||0);return Number.isFinite(t)&&t>1}function R(e){if(!Number.isFinite(e)||e<=0)return``;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=e=>String(e).padStart(2,`0`);return n>0?`${a(n)}:${a(r)}:${a(i)}`:`${a(r)}:${a(i)}`}function z(e,t,n){return De(e.badge_url)||De(t?.material_url)||``}function ke(e,t,n,r){let i=j(e.item),a=M(e.item,i),o=e.item.name||e.item?.title||``,s=e.item.id?k(e.item):`#`,c=z(e.item,e.icon,e.index),l=F(e.item,r),u=N(e.item,r),d=t?y(b(e.item),n):``,f=P(e.item.score);return{key:Me(e.item,e.index),sourceIndex:e.index,href:s,cardKind:i,coverUrl:a,title:o,badgeImageUrl:c,episodeText:l,metaPrimaryText:u,heatText:d,score:f}}function Ae(e,t,n){let r=[],i=[],a=n<=0,o=0,s=0;return e.forEach((e,c)=>{let l=t[c];if(a){c%2==0?r.push({item:e,icon:l,index:c}):i.push({item:e,icon:l,index:c});return}let u=je(n,e);o<=s?(r.push({item:e,icon:l,index:c}),o+=u):(i.push({item:e,icon:l,index:c}),s+=u)}),{left:r,right:i}}function je(e,t){return e?(j(t)===`tall`?216:142)+16:0}function Me(e,t){return e.id?`home-recommend-${e.id}-${t}`:`home-recommend-${t}`}export{xe as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
import{pContentGetNewstVideoList as e,pContentGetPopularVideoList as t}from"../../../../../service/generated/client.mjs";import{resolveHomeRecommendFeedMode as n}from"./home-recommend-default-config.mjs";import{HOME_RECOMMEND_CARD_CONFIG_FIELD as r}from"./home-recommend-preview.mjs";import{limitPopularVideoPageItems as
|
|
2
|
+
import{pContentGetNewstVideoList as e,pContentGetPopularVideoList as t}from"../../../../../service/generated/client.mjs";import{resolveHomeRecommendFeedMode as n}from"./home-recommend-default-config.mjs";import{HOME_RECOMMEND_CARD_CONFIG_FIELD as r}from"./home-recommend-preview.mjs";import{isHomeRecommendLatestSortRule as i}from"./home-recommend-smart-layout.mjs";import{limitPopularVideoPageItems as a,resolvePopularVideoPageSize as o}from"./home-recommend-smart-tag.mjs";import{batchGetHomeRecommendVideoDetailMap as s}from"./home-recommend-video-detail.mjs";function c(e){return typeof e==`string`?e.trim():``}function l(e){return typeof e==`string`?e.trim():``}function u(e){return Array.isArray(e)?e.map(e=>l(e)).filter(Boolean):[]}function d(e){let t=Number(e);if(!(!Number.isFinite(t)||t<0))return t}function f(e,t){let n=e,r=c(n.video_id||e.id||e.mid)||t,i=d(n.play_count)??d(e.browse_count),a=d(n.like_count),o=d(n.collect_count),s=(Array.isArray(n.episodes)?n.episodes.length:0)||(Array.isArray(e.video_episodes)?e.video_episodes.length:0)||(Array.isArray(e.links)?e.links.length:0),l=i!==void 0||a!==void 0||o!==void 0?{browse_cnt:i,like_cnt:a,collect_cnt:o}:void 0;return{id:r,mid:c(e.mid),name:e.name||``,img_x:e.img_x||``,img_y:e.img_y||``,img_type:e.img_type,cat_id:e.cat_id,cat_name:e.cat_name,status:e.status,status_text:e.status_text,show_at:e.show_at,update_status:e.update_status,description:e.description,language:e.language,director:e.director,issue_date:e.issue_date,actor:e.actor,up_user:e.up_user,time:e.time,money:e.money,source_username:e.source_username,task_id:e.task_id,error_msg:e.error_msg,file_status:e.file_status,score:d(e.score)??void 0,duration:d(e.duration)??void 0,episode_cnt:s>0?s:void 0,type:e.is_more_link?2:1,static:l}}function p(e){let t={showPlayCount:e.showPlayCount,playCountDelta:e.playCountDelta,showEpisode:e.showEpisode};if(!(t.showPlayCount===void 0&&t.playCountDelta===void 0&&t.showEpisode===void 0))return t}function m(e,t){let n=l(t.coverUrl),i=t.coverMode===`content`?e.img_y||e.img_x||n||``:n||e.img_y||e.img_x||``,a=l(t.title),o=t.titleMode===`custom`||a&&t.titleMode!==`content`?a:e.name||``,s=l(t.description),c=l(t.badge_url),u=p(t);return{...e,name:o||e.name,img_y:i||e.img_y||e.img_x,img_x:i||e.img_x||e.img_y,description:s||e.description,badge_url:c||e.badge_url,[r]:u}}function h(e){let t=c(e.contentId),n=l(e.coverUrl),r=l(e.title),i=l(e.description);return{id:t,mid:t,name:r||``,img_x:n,img_y:n,description:i,type:1}}async function g(e){let t=(Array.isArray(e)?e:[]).map(e=>({...e,contentId:c(e.contentId)})),n=t.filter(e=>!!e.contentId).map(e=>({id:e.contentId})),r=n.length?await s(n):new Map;return t.map(e=>{let t=e.contentId?r.get(e.contentId):void 0;return m(t?f(t,e.contentId||``):h(e),e)})}async function _(e){let t=(Array.isArray(e)?e:[]).map(e=>({...e,contentId:c(e.contentId)})).filter(e=>!!e.contentId);if(!t.length)return[];let n=await s(t.map(e=>({id:e.contentId})));return t.map(e=>{let t=n.get(e.contentId||``);return m(t?f(t,e.contentId||``):h(e),e)})}async function v(t,n,r){let i=o(t),a=u(n),s=(Array.isArray(r)?r:[]).map(e=>l(e)).filter(Boolean);try{let t=[],n=new Set,r=new Set,o=``;for(;t.length<i;){let l=o||`__first__`;if(r.has(l))break;r.add(l);let u=await e({cursor:o||void 0,page_size:i-t.length,tags:a.length>0?a:void 0,cat_ids:s.length>0?s:void 0}),d=Array.isArray(u.data?.videos)?u.data.videos:[];d.forEach(e=>{let r=c(e?.id||e?.mid);r&&n.has(r)||(r&&n.add(r),t.push(e))});let f=u.data?.cursor??``;if(!f||!d.length){o=``;break}o=f}return{videos:t.slice(0,i),nextCursor:o,loaded:!0}}catch(e){return console.error(`推荐位获取最新视频失败(server)`,e),{videos:[],nextCursor:``,loaded:!1}}}async function y(e,n,r){let i=Math.max(1,Math.floor(Number(e)||16)),o=u(n),s=(Array.isArray(r)?r:[]).map(e=>l(e)).filter(Boolean);try{let e=[],n=new Set,r=new Set,l=``;for(;e.length<i;){let a=l||`__first__`;if(r.has(a))break;r.add(a);let u=await t({cursor:l||void 0,page_size:i-e.length,tags:o.length>0?o:void 0,cat_ids:s.length>0?s:void 0}),d=Array.isArray(u.data?.videos)?u.data.videos:[];d.forEach(t=>{let r=c(t?.id||t?.mid);r&&n.has(r)||(r&&n.add(r),e.push(t))});let f=u.data?.cursor??``;if(!f||!d.length){l=``;break}l=f}return{videos:a(e,i),nextCursor:l,loaded:!0}}catch(e){return console.error(`推荐位获取热门视频失败(server)`,e),{videos:[],nextCursor:``,loaded:!1}}}async function b({enableInfinite:e,pageSize:t=16,items:r=[],smartLayout:a}){let o=a?.enabled===!0,s=n(o),c=Array.isArray(r)&&r.length>0,l={list:[],icons:[],title:``,cursor:``,show_style:void 0};if(!o)return c?{feedMode:s,data:{...l,list:await g(r),cursor:``}}:{feedMode:s,data:{...l,list:[],cursor:``}};if(s===`manual-with-video-detail`&&a){let n=i(a.sortRule)?await v(t,a.tagIds,a.catIds):await y(t,a.tagIds,a.catIds);if(n.loaded){let t=e===!0;return{feedMode:s,data:{...l,list:n.videos,cursor:t?n.nextCursor:``}}}try{let e=await _(r);return{feedMode:s,data:{...l,list:e,cursor:``}}}catch(e){return console.error(`推荐位智能铺设补齐视频详情失败(server)`,e),{feedMode:s,data:{...l,list:[],cursor:``}}}}return{feedMode:s,data:l}}export{b as resolveHomeRecommendServerData};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import e from"../../../../utils/get-res-url.mjs";import{pContentBatchGetVideoDetail as t,pContentGetNewstVideoList as n,pContentGetPopularVideoList as r}from"../../../../service/generated/client.mjs";import{pContentBatchGetVideoDetailKey as i,pContentGetNewstVideoListKey as a,pContentGetPopularVideoListKey as o}from"../../../../service/generated/tanstack.mjs";import{Image as s}from"../../../ui/image.mjs";import{Box as c}from"../../../ui/box.mjs";import{Text as l}from"../../../ui/text.mjs";import{IMAGE_TEXT_RECOMMEND_FIXED_BATCH_SIZE as u,buildImageTextRecommendRemoteMap as d,getImageTextRecommendFixedIds as f,resolveImageTextRecommendVideoId as ee}from"../../../../hooks/image-text-recommend.mjs";import{useRequest as p}from"../../../../hooks/query/use-query.mjs";import{normalizeHomeRecommendSmartLayout as te}from"../home-recommend/shared/home-recommend-smart-layout.mjs";import ne from"../../../../assets/images/frame.mjs";import re from"../../../../assets/images/subscript.mjs";import{buildImageTextSmartListBody as m,resolveImageTextSmartListKind as ie}from"./shared/query.mjs";import{useCallback as h,useEffect as g,useMemo as _,useRef as ae,useState as v}from"react";import{Fragment as oe,jsx as y,jsxs as b}from"react/jsx-runtime";import{useTranslations as se}from"next-intl";import ce from"next/link";const x=[];function S(e){return typeof e==`string`?e:e.src}function le(t,n){if(!t||!t.trim())return S(n);if(t.startsWith(`http`)||t.startsWith(`//`)||t.startsWith(`data:`))return t;let r=e();return r?`${r}${t.startsWith(`/`)?t:`/${t}`}`:t}function C(e){if(e==null)return``;let t=e;return t.img_y||t.media?.img_y||``}function w(e){return e==null?``:e.name||``}function T(e,t=!1){let n=e,r=t?n.type:n.content_type;return typeof r==`number`?r:n.is_more_link===!0||Number(n.episode_cnt||n.episode_count||n.episodes?.length||n.links?.length||0)>1?2:1}function E(e){if(!Number.isFinite(e)||e<=0)return``;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=e=>String(e).padStart(2,`0`);return n>0?`${a(n)}:${a(r)}:${a(i)}`:`${a(r)}:${a(i)}`}function D(e,t){let n=e,r=n?.links?.length??0;if(!Number.isFinite(r)||r<=0)return``;let i=n.update_status;return t(r,i===0||i===`0`)}function ue(e,t,n){return e?T(e,n)===2&&t?D(e,t):E(Number(e.duration??e.detail?.duration??0)):``}function de(e,t){if(!(e??``).trim())return``;let n=encodeURIComponent((t??``).trim()||``);return`/video/${e.trim()}/${n}/episode/1`}function fe(e,t){if(!e)return``;let n=e,r=t?Number(n.static?.browse_count??0):Number(n.browse_count??0);if(!Number.isFinite(r)||r<=0)return``;if(r>=1e6){let e=(r/1e6).toFixed(1);return e.endsWith(`.0`)?`${e.slice(0,-2)}M`:`${e}M`}if(r>=1e3){let e=(r/1e3).toFixed(1);return e.endsWith(`.0`)?`${e.slice(0,-2)}k`:`${e}k`}return Math.floor(r).toString()}function pe(){let e=new Date,t=new Date(e);return t.setHours(24,0,0,0),t.getTime()-e.getTime()}function O(e){let{title:T,items:E=x,commonPlayCount:D,commonEpisodes:O,layout:k,mode:A=`renderer`}=e,j=se(`components.biz.business.imageTextRecommend`),M=A===`renderer`,N=A===`editor`,[P,F]=v({}),[I,L]=v([]),[R,z]=v(0),[B,V]=v(void 0),H=ae(null),U=_(()=>te(k),[k]),W=U?.enabled===!0,G=_(()=>ie(U?.sortRule),[U?.sortRule]),K=E?.length??0,q=_(()=>f(E,W),[W,E]),J=_(()=>q.slice(0,u),[q]),Y=_(()=>{if(U?.enabled)return m(U,{targetCount:K})},[U,K]),{data:X}=p(_(()=>!Y||!W?[`image-text-recommend`,`smart-idle`]:G===`newest`?a(Y):o(Y),[Y,W,G]),async()=>!Y||!W?{data:{videos:[],cursor:``}}:G===`newest`?n(Y):r(Y),{enabled:M&&!N&&W&&E.length>0&&!!Y,staleTime:1/0}),{data:me}=p(i({ids:J}),()=>t({ids:J}),{enabled:M&&!N&&!W&&J.length>0,staleTime:1/0}),Z=_(()=>W&&K>u?Math.ceil(K/u):q.length>0?Math.ceil(q.length/u):0,[W,K,q.length]),Q=h((e,t)=>j(t?`updatedTo`:`allEpisodes`,{count:e}),[j]),he=h(async(e,n)=>{if(e.length===0)return;let r=d((await t({ids:e})).data?.videos??[]);F(e=>n?{...e,...r}:r)},[]);g(()=>{if(N)return;if(W){let e=X?.data?.videos??[];K>u?(L(e.slice(0,u)),V(X?.data?.cursor),z(e.length>0?1:0)):(L(e.slice(0,K)),z(0)),F({});return}if(J.length===0){F({}),L([]),z(0),V(void 0);return}let e=me?.data?.videos??[];F(d(e)),L([]),V(void 0),z(e.length>0?1:0)},[N,W,X,me,J,K]),g(()=>{if(N||Z<1||R<1||R>=Z)return;let e=H.current;if(!e)return;let t=new IntersectionObserver(e=>{let[t]=e;if(!t?.isIntersecting)return;let i=R;if(W&&U){let e=m(U,{targetCount:K,cursor:B,pageSize:u});(G===`newest`?n:r)(e).then(e=>{let t=e.data?.videos??[];L(e=>[...e,...t.slice(0,u)]),V(e.data?.cursor),z(i+1)}).catch(()=>{})}else{let e=i*u,t=q.slice(e,e+u);t.length>0&&(he(t,!0),z(i+1))}},{root:null,rootMargin:`0px`,threshold:0});return t.observe(e),()=>t.disconnect()},[N,W,U,G,q,R,Z,K,B,he]),g(()=>{if(N||!W||!U||K<=0)return;let e=U,t,i=!1;function a(){t=window.setTimeout(()=>{let t=m(e,{targetCount:K,pageSize:Math.max(20,K*10)});(G===`newest`?n:r)(t).then(e=>{i||L((e.data?.videos??[]).slice(0,K))}).catch(()=>{i||L([])}).finally(()=>{i||a()})},pe())}return a(),()=>{i=!0,t!==void 0&&window.clearTimeout(t)}},[N,W,U,G,K]);let $=_(()=>!E||E.length===0?x:N?E:W&&K>u?E.slice(0,I.length):E,[E,N,W,K,I.length]),ge=_(()=>$.length?$.map((e,t)=>{let n=String(e?.contentId??``).trim(),r=W?I[t]:n?P[n]:void 0,i=W?r?w(r):(e?.title??``).trim():(e?.title??``).trim()||(r?w(r):``),a=(e?.cover??``).trim(),o=W?C(r)||a:a||(e?.useVideoPoster?C(r):``),s=W&&String(r?.description??r?.content_description??``).trim()||(e?.contentDescription??``).trim(),c=ue(r,Q,W),l=fe(r,W);return{...e,contentId:n||(r?ee(r):``),title:i,cover:o,contentDescription:s,episodeOrDurationText:c,playCountText:l}}):x,[Q,W,$,P,I]);if(!E||E.length===0)return null;let _e=R>=1&&R<Z?W?I.length-2:R*u-2:-1;return b(c,{className:N?`bg-bg1 px-3 py-3 pointer-events-none`:`bg-bg1 px-3 py-3`,children:[T&&y(c,{className:`mb-3 flex items-center justify-between`,children:y(l,{className:`text-[18px] font-bold text-text1 leading-[26px]`,children:T})}),y(c,{className:`flex overflow-x-auto pb-2 scrollbar-hide space-x-2`,children:ge.map((e,t)=>{let n=
|
|
2
|
+
"use client";import e from"../../../../utils/get-res-url.mjs";import{pContentBatchGetVideoDetail as t,pContentGetNewstVideoList as n,pContentGetPopularVideoList as r}from"../../../../service/generated/client.mjs";import{pContentBatchGetVideoDetailKey as i,pContentGetNewstVideoListKey as a,pContentGetPopularVideoListKey as o}from"../../../../service/generated/tanstack.mjs";import{Image as s}from"../../../ui/image.mjs";import{Box as c}from"../../../ui/box.mjs";import{Text as l}from"../../../ui/text.mjs";import{IMAGE_TEXT_RECOMMEND_FIXED_BATCH_SIZE as u,buildImageTextRecommendRemoteMap as d,getImageTextRecommendFixedIds as f,resolveImageTextRecommendVideoId as ee}from"../../../../hooks/image-text-recommend.mjs";import{useRequest as p}from"../../../../hooks/query/use-query.mjs";import{normalizeHomeRecommendSmartLayout as te}from"../home-recommend/shared/home-recommend-smart-layout.mjs";import ne from"../../../../assets/images/frame.mjs";import re from"../../../../assets/images/subscript.mjs";import{buildImageTextSmartListBody as m,resolveImageTextSmartListKind as ie}from"./shared/query.mjs";import{useCallback as h,useEffect as g,useMemo as _,useRef as ae,useState as v}from"react";import{Fragment as oe,jsx as y,jsxs as b}from"react/jsx-runtime";import{useTranslations as se}from"next-intl";import ce from"next/link";const x=[];function S(e){return typeof e==`string`?e:e.src}function le(t,n){if(!t||!t.trim())return S(n);if(t.startsWith(`http`)||t.startsWith(`//`)||t.startsWith(`data:`))return t;let r=e();return r?`${r}${t.startsWith(`/`)?t:`/${t}`}`:t}function C(e){if(e==null)return``;let t=e;return t.img_y||t.media?.img_y||``}function w(e){return e==null?``:e.name||``}function T(e,t=!1){let n=e,r=t?n.type:n.content_type;return typeof r==`number`?r:n.is_more_link===!0||Number(n.episode_cnt||n.episode_count||n.episodes?.length||n.links?.length||0)>1?2:1}function E(e){if(!Number.isFinite(e)||e<=0)return``;let t=Math.floor(e),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60,a=e=>String(e).padStart(2,`0`);return n>0?`${a(n)}:${a(r)}:${a(i)}`:`${a(r)}:${a(i)}`}function D(e,t){let n=e,r=n?.links?.length??0;if(!Number.isFinite(r)||r<=0)return``;let i=n.update_status;return t(r,i===0||i===`0`)}function ue(e,t,n){return e?T(e,n)===2&&t?D(e,t):E(Number(e.duration??e.detail?.duration??0)):``}function de(e,t){if(!(e??``).trim())return``;let n=encodeURIComponent((t??``).trim()||``);return`/video/${e.trim()}/${n}/episode/1`}function fe(e,t){if(!e)return``;let n=e,r=t?Number(n.static?.browse_count??0):Number(n.browse_count??0);if(!Number.isFinite(r)||r<=0)return``;if(r>=1e6){let e=(r/1e6).toFixed(1);return e.endsWith(`.0`)?`${e.slice(0,-2)}M`:`${e}M`}if(r>=1e3){let e=(r/1e3).toFixed(1);return e.endsWith(`.0`)?`${e.slice(0,-2)}k`:`${e}k`}return Math.floor(r).toString()}function pe(){let e=new Date,t=new Date(e);return t.setHours(24,0,0,0),t.getTime()-e.getTime()}function O(e){let{title:T,items:E=x,commonPlayCount:D,commonEpisodes:O,layout:k,mode:A=`renderer`}=e,j=se(`components.biz.business.imageTextRecommend`),M=A===`renderer`,N=A===`editor`,[P,F]=v({}),[I,L]=v([]),[R,z]=v(0),[B,V]=v(void 0),H=ae(null),U=_(()=>te(k),[k]),W=U?.enabled===!0,G=_(()=>ie(U?.sortRule),[U?.sortRule]),K=E?.length??0,q=_(()=>f(E,W),[W,E]),J=_(()=>q.slice(0,u),[q]),Y=_(()=>{if(U?.enabled)return m(U,{targetCount:K})},[U,K]),{data:X}=p(_(()=>!Y||!W?[`image-text-recommend`,`smart-idle`]:G===`newest`?a(Y):o(Y),[Y,W,G]),async()=>!Y||!W?{data:{videos:[],cursor:``}}:G===`newest`?n(Y):r(Y),{enabled:M&&!N&&W&&E.length>0&&!!Y,staleTime:1/0}),{data:me}=p(i({ids:J}),()=>t({ids:J}),{enabled:M&&!N&&!W&&J.length>0,staleTime:1/0}),Z=_(()=>W&&K>u?Math.ceil(K/u):q.length>0?Math.ceil(q.length/u):0,[W,K,q.length]),Q=h((e,t)=>j(t?`updatedTo`:`allEpisodes`,{count:e}),[j]),he=h(async(e,n)=>{if(e.length===0)return;let r=d((await t({ids:e})).data?.videos??[]);F(e=>n?{...e,...r}:r)},[]);g(()=>{if(N)return;if(W){let e=X?.data?.videos??[];K>u?(L(e.slice(0,u)),V(X?.data?.cursor),z(e.length>0?1:0)):(L(e.slice(0,K)),z(0)),F({});return}if(J.length===0){F({}),L([]),z(0),V(void 0);return}let e=me?.data?.videos??[];F(d(e)),L([]),V(void 0),z(e.length>0?1:0)},[N,W,X,me,J,K]),g(()=>{if(N||Z<1||R<1||R>=Z)return;let e=H.current;if(!e)return;let t=new IntersectionObserver(e=>{let[t]=e;if(!t?.isIntersecting)return;let i=R;if(W&&U){let e=m(U,{targetCount:K,cursor:B,pageSize:u});(G===`newest`?n:r)(e).then(e=>{let t=e.data?.videos??[];L(e=>[...e,...t.slice(0,u)]),V(e.data?.cursor),z(i+1)}).catch(()=>{})}else{let e=i*u,t=q.slice(e,e+u);t.length>0&&(he(t,!0),z(i+1))}},{root:null,rootMargin:`0px`,threshold:0});return t.observe(e),()=>t.disconnect()},[N,W,U,G,q,R,Z,K,B,he]),g(()=>{if(N||!W||!U||K<=0)return;let e=U,t,i=!1;function a(){t=window.setTimeout(()=>{let t=m(e,{targetCount:K,pageSize:Math.max(20,K*10)});(G===`newest`?n:r)(t).then(e=>{i||L((e.data?.videos??[]).slice(0,K))}).catch(()=>{i||L([])}).finally(()=>{i||a()})},pe())}return a(),()=>{i=!0,t!==void 0&&window.clearTimeout(t)}},[N,W,U,G,K]);let $=_(()=>!E||E.length===0?x:N?E:W&&K>u?E.slice(0,I.length):E,[E,N,W,K,I.length]),ge=_(()=>$.length?$.map((e,t)=>{let n=String(e?.contentId??``).trim(),r=W?I[t]:n?P[n]:void 0,i=W?r?w(r):(e?.title??``).trim():(e?.title??``).trim()||(r?w(r):``),a=(e?.cover??``).trim(),o=W?C(r)||a:a||(e?.useVideoPoster?C(r):``),s=W&&String(r?.description??r?.content_description??``).trim()||(e?.contentDescription??``).trim(),c=ue(r,Q,W),l=fe(r,W);return{...e,contentId:n||(r?ee(r):``),title:i,cover:o,contentDescription:s,episodeOrDurationText:c,playCountText:l}}):x,[Q,W,$,P,I]);if(!E||E.length===0)return null;let _e=R>=1&&R<Z?W?I.length-2:R*u-2:-1;return b(c,{className:N?`bg-bg1 px-3 py-3 pointer-events-none`:`bg-bg1 px-3 py-3`,children:[T&&y(c,{className:`mb-3 flex items-center justify-between`,children:y(l,{className:`text-[18px] font-bold text-text1 leading-[26px]`,children:T})}),y(c,{className:`flex overflow-x-auto pb-2 scrollbar-hide space-x-2`,children:ge.map((e,t)=>{let n=D||(e.showPlayCount??!1),r=(e.playCountText??``).trim(),i=r!==``,a=O||(e.showEpisodes??!1),o=(e.episodeOrDurationText??``).trim(),u=a&&o!==``,d=A===`renderer`?de(e.contentId??``,e.title??``):``,f=b(oe,{children:[b(c,{className:`relative rounded-lg overflow-hidden bg-bg2 w-[116px] h-[134px]`,children:[N||e.cover?y(s,{src:le(e.cover,ne),alt:e.title??``,fill:!0,className:`object-cover`}):y(c,{className:`w-full h-full flex items-center justify-center`,children:y(l,{className:`text-text3 text-xs`,children:j(`noCover`)})}),!W&&(e.badge??``).trim()?y(c,{className:`absolute top-0 right-0 w-8 h-8`,children:y(s,{src:(e.badge??``).trim()||S(re),alt:``,fill:!0,sizes:`32px`,className:`object-contain object-right-top`,unoptimized:!0})}):null,b(c,{className:`absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/80 to-transparent pb-1 pt-3 px-1 flex justify-between items-center gap-1`,children:[y(c,{className:`flex items-center min-w-0 shrink`,children:n&&i?b(c,{className:`flex items-center gap-1 rounded bg-overlay px-1 py-0`,children:[y(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`10`,viewBox:`0 0 12 10`,fill:`none`,className:`shrink-0`,"aria-hidden":!0,children:y(`path`,{d:`M7.56 5.18437L5.013 6.56737C4.893 6.63337 4.761 6.66937 4.638 6.66937C4.269 6.66937 4.002 6.38737 4.002 5.99737V3.28237C4.002 2.89237 4.269 2.61037 4.638 2.61037C4.764 2.61037 4.893 2.64637 5.013 2.70937L7.572 4.09237C7.803 4.21837 7.938 4.41637 7.938 4.63237C7.938 4.85137 7.8 5.05537 7.56 5.18437ZM9.807 9.27637L2.133 8.52937C0.954 8.52937 0 7.57537 0 6.39637V2.79937C0 1.62037 0.954 0.666368 2.133 0.666368L9.81 0.000367165C10.989 0.000367165 11.943 0.954367 11.943 2.13337V7.14337C11.9422 7.70935 11.7168 8.25188 11.3163 8.65181C10.9158 9.05174 10.373 9.27637 9.807 9.27637ZM10.875 2.13337C10.875 1.99351 10.8475 1.85502 10.7939 1.72581C10.7404 1.5966 10.662 1.47919 10.5631 1.3803C10.4642 1.2814 10.3468 1.20296 10.2176 1.14944C10.0883 1.09591 9.94986 1.06837 9.81 1.06837L2.133 1.73437C1.99314 1.73437 1.85465 1.76191 1.72544 1.81544C1.59623 1.86896 1.47883 1.9474 1.37993 2.0463C1.28104 2.14519 1.20259 2.2626 1.14907 2.39181C1.09555 2.52102 1.068 2.65951 1.068 2.79937V6.39637C1.068 6.67882 1.1802 6.94971 1.37993 7.14944C1.57966 7.34916 1.85054 7.46137 2.133 7.46137L9.807 8.20837C9.94686 8.20837 10.0853 8.18082 10.2146 8.1273C10.3438 8.07378 10.4612 7.99533 10.5601 7.89644C10.659 7.79754 10.7374 7.68014 10.7909 7.55093C10.8445 7.42171 10.872 7.28323 10.872 7.14337V2.13337H10.875Z`,fill:`white`})}),y(l,{className:`text-white text-[12px] leading-[20px]`,children:r})]}):null}),y(c,{className:`flex items-center shrink-0`,children:u?y(l,{className:`text-white text-[12px] leading-[20px]`,children:o}):null})]})]}),y(c,{className:`mt-2 py-2`,children:y(l,{className:`text-[16px] text-text1 font-bold leading-[24px] line-clamp-1`,children:e.title})})]});return y(c,{ref:t===_e?H:void 0,className:`flex-shrink-0 w-[116px]`,children:d?y(ce,{href:d,className:`block`,children:f}):f},t)})})]})}export{O as ImageTextRecommendClient};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{isClient as e}from"../../../../utils/common.mjs";import{pContentBatchGetVideoDetail as t}from"../../../../service/generated/client.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import i from"../../../ui/loading.mjs";import a from"../../../ui/link.mjs";import{useSingleFirstRowHeight as o}from"../../../../hooks/use-first-row-height.mjs";import{useMinDurationLoading as s}from"../../../../hooks/use-min-duration-loading.mjs";import c from"../../../../assets/icons/common/right_arrow.mjs";import{isFeedAdItem as l}from"../advertisement/feed-ad/index.mjs";import{LargeGridItemClient as u}from"./card-item.mjs";import{largeFeatureGridInspectorDefaultProps as d}from"./schema.mjs";import{useEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";const v=[],y=d.data??[];function b(e){return e==null}function x(e,t){return b(e)?t:e}function S(e){return typeof e==`string`?e.trim():``}function C(e){return S(e)}function w(e){let t=Number(e);if(!(!Number.isFinite(t)||t<0))return t}function T(e){let t=e,n=S(e.update_status)===`0`,r=(Array.isArray(t.episodes)?t.episodes.length:0)||(Array.isArray(e.video_episodes)?e.video_episodes.length:0)||(Array.isArray(e.links)?e.links.length:0)||(w(e.episode_cnt)??0);return!Number.isFinite(r)||r<=0?``:`${n?`更新至`:`全`}${Math.floor(r)}集`}function E(e,t){return t?{...e,...t,id:x(t.id,e.id),cover:x(t.cover,e.cover),title:x(t.title,e.title),desc:x(t.desc,e.desc),play_count:x(t.play_count,e.play_count),showPlayCount:t.showPlayCount??e.showPlayCount,episodeText:x(t.episodeText,e.episodeText),showEpisode:t.showEpisode??e.showEpisode,useContentCover:t.useContentCover??e.useContentCover,tagImageUrl:x(t.tagImageUrl,e.tagImageUrl)}:e}function D(e,t){if(!t)return e;let n=e.items;return{...e,...t,title:x(t.title,e.title),moreUrl:x(t.moreUrl,e.moreUrl),moreLinkType:t.moreLinkType??e.moreLinkType,items:n?E(n,t.items):t.items}}function O({mode:d=`renderer`,data:b=v}){let x=d===`editor`,
|
|
2
|
+
"use client";import{isClient as e}from"../../../../utils/common.mjs";import{pContentBatchGetVideoDetail as t}from"../../../../service/generated/client.mjs";import{Box as n}from"../../../ui/box.mjs";import{Text as r}from"../../../ui/text.mjs";import i from"../../../ui/loading.mjs";import a from"../../../ui/link.mjs";import{useSingleFirstRowHeight as o}from"../../../../hooks/use-first-row-height.mjs";import{useMinDurationLoading as s}from"../../../../hooks/use-min-duration-loading.mjs";import c from"../../../../assets/icons/common/right_arrow.mjs";import{isFeedAdItem as l}from"../advertisement/feed-ad/index.mjs";import{LargeGridItemClient as u}from"./card-item.mjs";import{largeFeatureGridInspectorDefaultProps as d}from"./schema.mjs";import{useEffect as f,useMemo as p,useRef as m,useState as h}from"react";import{jsx as g,jsxs as _}from"react/jsx-runtime";const v=[],y=d.data??[];function b(e){return e==null}function x(e,t){return b(e)?t:e}function S(e){return typeof e==`string`?e.trim():``}function C(e){return S(e)}function w(e){let t=Number(e);if(!(!Number.isFinite(t)||t<0))return t}function T(e){let t=e,n=S(e.update_status)===`0`,r=(Array.isArray(t.episodes)?t.episodes.length:0)||(Array.isArray(e.video_episodes)?e.video_episodes.length:0)||(Array.isArray(e.links)?e.links.length:0)||(w(e.episode_cnt)??0);return!Number.isFinite(r)||r<=0?``:`${n?`更新至`:`全`}${Math.floor(r)}集`}function E(e,t){return t?{...e,...t,id:x(t.id,e.id),cover:x(t.cover,e.cover),title:x(t.title,e.title),desc:x(t.desc,e.desc),play_count:x(t.play_count,e.play_count),showPlayCount:t.showPlayCount??e.showPlayCount,episodeText:x(t.episodeText,e.episodeText),showEpisode:t.showEpisode??e.showEpisode,useContentCover:t.useContentCover??e.useContentCover,tagImageUrl:x(t.tagImageUrl,e.tagImageUrl)}:e}function D(e,t){if(!t)return e;let n=e.items;return{...e,...t,title:x(t.title,e.title),moreUrl:x(t.moreUrl,e.moreUrl),moreLinkType:t.moreLinkType??e.moreLinkType,items:n?E(n,t.items):t.items}}function O({mode:d=`renderer`,data:b=v}){let x=d===`editor`,E=b??v,O=Array.isArray(E)&&E.length>0,k=p(()=>O?[D(y[0],E[0])]:y,[O,E]),[A,j]=h(k),M=m(``),N=m(null),{isLoading:P,show:F,hide:I,cancel:L}=s(500);f(()=>{j(k)},[k]);let R=o({enabled:!x,containerRef:N,itemRef:N,deps:[A.length]}),z=p(()=>{if(x||!O)return``;let e=k.map(e=>C(e?.items?.id)).filter(Boolean);return Array.from(new Set(e)).join(`,`)},[O,x,k]);if(f(()=>{if(x||!e()||!z||M.current===z)return;M.current=z;let n=!1;async function r(){try{F();let e=await t({ids:z.split(`,`).filter(Boolean)},{cache:`no-store`}),r=Array.isArray(e.data?.videos)?e.data.videos:[],i=new Map;if(r.forEach(e=>{let t=C(e.video_id||e.id||e.mid);t&&i.set(t,e)}),n)return;j(e=>e.map(e=>{let t=e.items;if(!t||l(t))return e;let n=C(t.id),r=n?i.get(n):void 0;if(!r)return e;let a=w(r.play_count)??w(r.browse_count)??w(r.view_count),o=T(r),s=S(r.name),c=S(r.description||r.content_description),u=t.useContentCover?S(r.img_x||r.img_y):``;return{...e,items:{...t,title:s||t.title,desc:c||t.desc,...u?{cover:u}:{},play_count:a??t.play_count,episodeText:o||t.episodeText}}}))}catch(e){console.error(`大图推荐刷新首屏失败(client)`,e)}finally{n||I()}}return r(),()=>{n=!0,L()}},[L,z,I,x,F]),!A||A.length===0)return null;let B=A[0],V=B?.title,H=B?.moreUrl,U=R>0?R/2:160,W=!x&&P;return _(n,{className:x?`p-3 pointer-events-none`:`p-3`,children:[_(n,{className:`flex items-center justify-between mb-[10px] h-[24px]`,children:[V&&g(r,{as:`h2`,className:`text-[18px] font-bold text-text1 line-clamp-1 flex-1 min-w-0 mr-[12px]`,children:V}),H&&_(a,{href:H,className:`flex items-center text-[14px] text-text2 ml-auto`,children:[`更多`,g(c,{className:`ml-[2px] h-[12px] w-[12px] text-text2`})]})]}),_(n,{className:`relative`,children:[A.map((e,t)=>{let{items:r}=e;return r?g(n,{ref:t===0?N:void 0,className:t>0?`mt-3`:``,children:g(u,{data:r})},`large-feature-grid-items-${t}`):null}),W&&g(n,{className:`absolute inset-0 z-10 bg-black/15 backdrop-blur-[1px] dark:bg-white/10`,"aria-hidden":!0}),W&&g(n,{className:`absolute left-1/2 -translate-x-1/2 -translate-y-1/2 z-20 pointer-events-none`,style:{top:U},"aria-hidden":!0,children:g(i,{size:`large`,showLabel:!1,className:`text-theme5`})})]})]})}export{O as LargeFeatureGridClient};
|
|
@@ -8,6 +8,7 @@ interface CommonPlayerProps {
|
|
|
8
8
|
parentId?: string;
|
|
9
9
|
plyerId: string;
|
|
10
10
|
resolution: string;
|
|
11
|
+
autoplay?: boolean;
|
|
11
12
|
mergeConfig?: {
|
|
12
13
|
startPercent?: number;
|
|
13
14
|
startTimeSeconds?: number;
|
|
@@ -44,6 +45,7 @@ declare function CommonPlayer({
|
|
|
44
45
|
className,
|
|
45
46
|
parentId,
|
|
46
47
|
plyerId,
|
|
48
|
+
autoplay,
|
|
47
49
|
videoUrl,
|
|
48
50
|
poster,
|
|
49
51
|
resolution,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
"use client";import{generateUUID as e,parseResolution as t}from"../../../utils/common.mjs";import{decryptImageUrl as n}from"../../../utils/decrypt-image-client.mjs";import{buildVideoPlayerSrc as r,isM3u8VideoUrl as i,resolveVideoPlayerSrc as a}from"./process-m3u8-cache.mjs";import{apiCollectCustom as o}from"../../../utils/api-collect.mjs";import{videoConfig as s}from"./create-video.mjs";import{RETRY_RESUME_END_GAP_SECONDS as c,pauseOtherVideos as l,prepareRetryResumeState as u,registerVideo as ee,shouldTriggerFpsStuckRecovery as d,unregisterVideo as f}from"./playing-videos.mjs";import p from"./style.module.mjs";import{useCallback as m,useEffect as h,useImperativeHandle as te,useRef as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import y from"next/image";import{useLocale as ne}from"next-intl";async function re(){await import(`xgplayer/dist/index.min.css`)}const ie=[],ae={},b=10*1e3;function x({className:o=``,parentId:x=``,plyerId:S=``,videoUrl:C=``,poster:
|
|
2
|
+
"use client";import{generateUUID as e,parseResolution as t}from"../../../utils/common.mjs";import{decryptImageUrl as n}from"../../../utils/decrypt-image-client.mjs";import{buildVideoPlayerSrc as r,isM3u8VideoUrl as i,resolveVideoPlayerSrc as a}from"./process-m3u8-cache.mjs";import{apiCollectCustom as o}from"../../../utils/api-collect.mjs";import{videoConfig as s}from"./create-video.mjs";import{RETRY_RESUME_END_GAP_SECONDS as c,pauseOtherVideos as l,prepareRetryResumeState as u,registerVideo as ee,shouldTriggerFpsStuckRecovery as d,unregisterVideo as f}from"./playing-videos.mjs";import p from"./style.module.mjs";import{useCallback as m,useEffect as h,useImperativeHandle as te,useRef as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import y from"next/image";import{useLocale as ne}from"next-intl";async function re(){await import(`xgplayer/dist/index.min.css`)}const ie=[],ae={},b=10*1e3;function x({className:o=``,parentId:x=``,plyerId:S=``,autoplay:oe,videoUrl:C=``,poster:se=``,resolution:w,hlsList:ce=ie,mergeConfig:T=ae,onProgressUpdate:le,onVideoEnded:ue,onPlay:de,onPause:fe,onEnded:pe,onPlayerReady:E,onControlsVisibilityChange:me,ref:he}){let ge=ne()===`en`?`en`:`zh-cn`,D=g(e()).current,O=g(1),k=g(1),A=g(0),_e=g(0),j=g(null),ve=g(null),M=g(!1),N=g(!1),ye=g(1),P=g(null),F=g(null),I=g(!1),L=g(0),R=g(null),z=g(null),B=g(!1),V=g(null),H=g(null),U=g(!1),be=g(!1),W=g(!1),G=g(!1),xe=g(T),K=m(()=>{F.current&&=(window.clearTimeout(F.current),null),P.current&&=(P.current.disconnect(),null)},[]),q=m(()=>{R.current&&=(window.clearTimeout(R.current),null)},[]),J=m(()=>{z.current&&=(window.clearTimeout(z.current),null)},[]),Y=m(e=>{let t=B.current||z.current!==null;if(B.current=!1,J(),!(!t||!e))try{e.removeClass?.(`xgplayer-isloading`),e.getPlugin?.(`loading`)?.hide?.()}catch{}},[J]),X=m(e=>{if(Y(e),e)try{e.addClass?.(`xgplayer-is-error`),e.getPlugin?.(`error`)?.show?.()}catch{}},[Y]),Se=m(e=>{if(e){B.current=!0,J();try{e.removeClass?.(`xgplayer-is-error`),e.addClass?.(`xgplayer-isloading`),e.getPlugin?.(`error`)?.hide?.(),e.getPlugin?.(`loading`)?.show?.()}catch{}z.current=window.setTimeout(()=>{z.current=null,!(U.current||!B.current)&&(q(),L.current=3,X(j.current||e),console.warn(`~ 播放器加载超过 ${b}ms,已回退失败态,请手动刷新 ~`))},b)}},[J,q,X]),Ce=m(()=>{K(),J(),B.current=!1,f(D),W.current=!1,j.current&&=(j.current.offAll(),j.current.destroy(),null)},[K,J,D]);te(he,()=>({enterFullscreen:()=>{j.current.getPlugin(`fullscreen`).handleFullscreen()},isFullscreen:()=>M.current,isPlayerReady:()=>W.current&&!!j.current,getPlayer:()=>j.current}),[]);let Z=g(null),Q=g(null),we=g(null),Te=g(null),Ee=g(null),De=.3,Oe=.7,$=.045,ke=()=>r(C);function Ae(e){return Math.min(4e3,500*2**(e-1))+Math.floor(Math.random()*200)}let je=async(e,o,f)=>{let p=ke();if(!p)return;let m=a(C),h=i(C)||(ce?.length??0)>0;try{await re();let[i,a]=await Promise.all([import(`xgplayer`),h?import(`xgplayer-hls`):Promise.resolve(null),(async()=>{try{se=await n(se)}catch{console.warn(`解码post失败`)}})()]);if(e())return;let te=await m;if(e())return;let g=te||p,_=ve.current;if(!_||!_.isConnected)for(let t=0;t<10;t+=1){if(e())return;if(await new Promise(e=>{window.setTimeout(()=>e(),16)}),_=ve.current,_&&_.isConnected)break}if(!_||!_.isConnected||e())return;let v=i.default??i,y=i.Events,ne=a?a.default??a:null,ie=h&&ne?[...s.plugins,ne]:s.plugins,ae=h?{preloadTime:15,bufferBehind:5,keepStatusAfterSwitch:!0}:void 0;j.current=new v({...s,...typeof oe==`boolean`?{autoplay:oe}:{},lang:ge,el:_,videoFillMode:`contain`,url:g,poster:se,playbackRate:{list:[.75,1,1.25,1.5,1.75,2]},plugins:ie,...ae?{hls:ae}:{},miniprogress:!0,definition:{list:ce?.map(e=>({text:`${e.text}`,url:r(e.url),definition:`${e.definition}`}))},fullscreen:{useScreenOrientation:!0},...T}),j.current.on(y.REPLAY,()=>{be.current=!1}),j.current.on(y.WAITING,()=>{console.log(`~视频缓冲中,可能出现卡顿~`)}),j.current.on(y.STALLED,()=>{console.log(`~播放停滞,网络连接问题~`)}),j.current.on(y.LOADING,()=>{console.log(`~正在加载数据~`)}),j.current.on(y.LOADED_DATA,()=>{Y(j.current)}),j.current.on(y.CANPLAY,()=>{Y(j.current)}),j.current.on(y.PLAYING,()=>{Y(j.current)});let b=t=>{let n=j.current;if(e()||!n||L.current>=3)return!1;if(R.current)return Se(n),!0;let r=u({failureType:t,player:n,renderedMediaTime:0});V.current=r.time,H.current=r.shouldPlay,L.current+=1;let i=L.current,a=Ae(i);Se(n);let o=t===`fps_stuck`?`画面卡顿`:`失败`;return console.warn(`~ 播放${o},${a}ms 后进行第 ${i} 次重试加载 ~`),R.current=window.setTimeout(()=>{R.current=null,!e()&&(Ce(),je(()=>U.current,()=>Ne.current?.(),e=>Pe.current?.(e)))},a),!0};j.current.on(y.FPS_STUCK,e=>{console.log(`~检测到帧率卡顿~`,e),d(e)&&(b(`fps_stuck`)||X(j.current))}),j.current.on(y.BUFFER_CHANGE,e=>{console.log(`~缓冲区状态变化:~`,e)}),j.current.on(y.ERROR,t=>{let n=String(t&&(t.message||t.msg||t.error?.message)||t||``),r=j.current;if(r){if(h&&/SourceBuffer is full|QuotaExceeded/i.test(n)){if(e()||I.current)return;I.current=!0,window.setTimeout(()=>{I.current=!1},2e3);try{let e=Number(r?.currentTime||0);(r?.getPlugin?.(`hls`)?.core)?._bufferService?.removeBuffer?.(0,Math.max(0,e-5)).catch?.(()=>{});let t=r?.config?.url;if(typeof r?.switchURL==`function`&&typeof t==`string`&&t){Se(r),r.switchURL(t,{currentTime:e,seamless:!1}).catch(()=>{b(`error`)||X(r)});return}}catch{}}b(`error`)||X(r)}}),j.current.on(y.PLAY,()=>{q(),Y(j.current),window.sensors?.track(`player_start`,{object_id:x||S||``,play_session_id:x||S,start_type:`播放`,start_position:0,duration:j.current.duration,definition:w,playback_rate:j.current.playbackRate}),l(D,j.current),be.current||=(Me(),!0),de?.()}),j.current.on(y.FULLSCREEN_CHANGE,e=>{window.sensors?.track(`player_fullscreen_toggle`,{object_id:x||S||``,play_session_id:x||S||``,action:e?`全屏`:`退出全屏`}),M.current=e}),j.current.on(y.SEEKING,()=>{N.current=!0}),j.current.on(y.SEEKED,()=>{N.current=!1});let C=()=>{if(!le||!j.current)return;let e=Number(j.current.currentTime||0);if(e<=0)return;let t=Number(j.current.duration||0);le(e,t>0?t:0)};j.current.on(y.PAUSE,()=>{window.sensors?.track(`player_pause`,{object_id:x||S||``,play_session_id:x||S||``,pause_position:j.current.currentTime,cumulative_time:j.current.duration}),C(),fe?.()}),j.current.on(y.ENDED,()=>{window.sensors?.track(`player_end`,{object_id:x||S||``,play_session_id:x||S||``,end_position:j.current.currentTime,cumulative_time:j.current.duration,end_type:`播放结束`,is_finish:j.current.currentTime===j.current.duration}),C(),pe?.(),ue&&ue()}),j.current.on(y.RATE_CHANGE,()=>{window.sensors?.track(`player_rate_change`,{object_id:x||S||``,play_session_id:x||S||``,old_rate:ye.current,new_rate:j.current.playbackRate}),ye.current=j.current.playbackRate}),j.current.on(y.DEFINITION_CHANGE,()=>{window.sensors?.track(`player_definition_change`,{object_id:x||S||``,play_session_id:x||S||``,old_def:w,new_def:j.current.definition})}),j.current.on(y.TIME_UPDATE,()=>{j.current&&C()});let E=()=>{if(!j.current)return;let e=xe.current||{},t=Number(j.current.duration||0);if(t<=0)return;let n=V.current;if(n!==null&&n>0){let e=Math.max(0,t-c),r=Math.min(e>0?e:t,n);j.current.currentTime=r,V.current=null;return}let r=Number(e.startTimeSeconds||0);if(r>0){let e=Math.min(t,r);j.current.currentTime=e;return}if(e.startPercent!==void 0&&e.startPercent>0){let n=e.startPercent/100*t;j.current.currentTime=Math.min(t,n)}};j.current.once(`loadedmetadata`,()=>{E()}),j.current.once(`ready`,()=>{W.current=!0,j.current&&j.current.duration>0&&E();let n=H.current;H.current=null,n===!0?j.current?.play?.().catch(()=>{}):n===!1&&j.current?.pause?.(),ee(D,j.current),o&&o(),f&&(K(),F.current=window.setTimeout(()=>{if(e())return;let t=j.current?.root;if(!t)return;let n=new MutationObserver(e=>{e.forEach(e=>{e.type===`attributes`&&e.attributeName===`class`&&f(!e.target.classList.contains(`xgplayer-inactive`))})});P.current=n,n.observe(t,{attributes:!0,attributeFilter:[`class`]}),f(!t.classList.contains(`xgplayer-inactive`))},33));let r=j.current.root,i=0,a=j.current.root.querySelector(`.xgmask`),{width:s,height:c}=t(w),l=s<c?document.documentElement.clientWidth:document.documentElement.clientHeight,u=Ee.current;u&&j.current?.root&&!j.current.root.contains(u)&&j.current.root.appendChild(u),r.addEventListener(`touchstart`,e=>{if(!M.current)return;let t=e.touches[0];i=t.clientX,A.current=t.clientY,G.current=!1,k.current=j.current.volume;let n=window.getComputedStyle(a).backgroundColor;O.current=1-(Number.parseFloat(n.split(`,`)[3])||0)},{passive:!1}),r.addEventListener(`touchmove`,e=>{if(!M.current)return;e.preventDefault();let t=e.touches[0],n=t.clientX-i,r=t.clientY;if(Math.abs(n)>50||N.current){G.current=!0,d();return}if(G.current){d();return}if(Math.abs(r-A.current)>6){let e=Date.now();if(e-_e.current<16)return;_e.current=e;let n=r<A.current;A.current=r;let a=t.clientX,o=i<l*De,s=i>l*Oe;if(!o&&!s){d();return}let c=a<l*De,u=a>l*Oe;if(o&&!c){G.current=!0,d();return}if(s&&!u){G.current=!0,d();return}o&&c?p(n):s&&u?m(n):d()}},{passive:!1});function d(){Z.current&&(Z.current.style.visibility=`hidden`),Q.current&&(Q.current.style.visibility=`hidden`)}function p(e){let t=e?$:-$;O.current=Math.max(0,Math.min(1,O.current+t)),Z.current&&(Z.current.style.visibility=`visible`),Q.current&&(Q.current.style.visibility=`hidden`),we.current&&(we.current.style.transform=`scaleY(${O.current})`);let n=1-O.current;a.style.cssText=`
|
|
3
3
|
background-color: rgba(0,0,0,${n.toFixed(3)});
|
|
4
4
|
will-change: background-color;
|
|
5
5
|
transform: translateZ(0);
|
|
6
|
-
`}function m(e){let t=e
|
|
7
|
-
absolute left-[18px] top-[50%] translate-y-[-50%] flex flex-col items-center justify-center gap-[12px] z-50`,style:{visibility:`hidden`},children:[_(y,{src:`/svg/icon_jiazai_zhong.svg`,alt:`Icon`,width:20,height:20}),v(`div`,{className:`relative`,children:[_(`div`,{className:`h-[92px] w-[4px] bg-[#000000] rounded-[8px]`}),_(`div`,{ref:we,className:`h-[92px] w-[4px] bg-[#fff] rounded-[8px] absolute bottom-0`,style:{transformOrigin:`bottom`,transform:`scaleY(1)`,willChange:`transform`,backfaceVisibility:`hidden`,transition:`none`}})]})]}),v(`div`,{ref:
|
|
6
|
+
`}function m(e){let t=e?$:-$;k.current=Math.max(0,Math.min(1,k.current+t)),j.current.volume=k.current,Q.current&&(Q.current.style.visibility=`visible`),Z.current&&(Z.current.style.visibility=`hidden`),Te.current&&(Te.current.style.transform=`scaleY(${k.current})`)}r.addEventListener(`touchend`,()=>{M.current&&setTimeout(()=>{d()},800)})})}catch(t){e()||console.error(`初始化播放器失败`,t)}},Me=m(()=>{},[x,S]),Ne=g(E),Pe=g(me);return Ne.current=E,Pe.current=me,xe.current=T,h(()=>(U.current=!1,L.current=0,V.current=null,H.current=null,B.current=!1,q(),J(),je(()=>U.current,()=>Ne.current?.(),e=>Pe.current?.(e)),window.webViewVideoData={resolution:w},()=>{U.current=!0,V.current=null,H.current=null,q(),J(),K(),Ce()}),[oe,ge,S,D,C]),h(()=>{let e=Number(T?.startTimeSeconds||0),t=T?.startPercent;if(!W.current||!j.current)return;let n=Number(j.current.duration||0);if(n<=0)return;let r=0;if(e>0)r=Math.min(n,e);else if(t!==void 0&&t>0)r=Math.min(n,t/100*n);else return;let i=j.current.currentTime;Math.abs(i-r)>1&&(j.current.currentTime=r)},[T?.startPercent,T?.startTimeSeconds]),ke()?v(`div`,{className:`w-full h-full relative ${p.videoBox} ${o}`,children:[_(`div`,{ref:ve,className:`w-full h-full`}),v(`div`,{ref:Ee,children:[v(`div`,{ref:Z,className:`w-[36px] h-[148px] bg-[rgba(51,51,51,0.5)] rounded-[50px] border border-[rgba(0,0,0,0.05)]
|
|
7
|
+
absolute left-[18px] top-[50%] translate-y-[-50%] flex flex-col items-center justify-center gap-[12px] z-50`,style:{visibility:`hidden`},children:[_(y,{src:`/svg/icon_jiazai_zhong.svg`,alt:`Icon`,width:20,height:20}),v(`div`,{className:`relative`,children:[_(`div`,{className:`h-[92px] w-[4px] bg-[#000000] rounded-[8px]`}),_(`div`,{ref:we,className:`h-[92px] w-[4px] bg-[#fff] rounded-[8px] absolute bottom-0`,style:{transformOrigin:`bottom`,transform:`scaleY(1)`,willChange:`transform`,backfaceVisibility:`hidden`,transition:`none`}})]})]}),v(`div`,{ref:Q,className:`w-[36px] h-[148px] bg-[rgba(51,51,51,0.5)] rounded-[50px] border border-[rgba(0,0,0,0.05)]
|
|
8
8
|
absolute right-[18px] top-[50%] translate-y-[-50%] flex flex-col items-center justify-center gap-[12px] z-50`,style:{visibility:`hidden`},children:[_(y,{src:`/svg/icon_shengyin_di.svg`,alt:`Icon`,width:20,height:20}),v(`div`,{className:`relative`,children:[_(`div`,{className:`h-[92px] w-[4px] bg-[#000000] rounded-[8px]`}),_(`div`,{ref:Te,className:`h-[92px] w-[4px] bg-[#fff] rounded-[8px] absolute bottom-0`,style:{transformOrigin:`bottom`,transform:`scaleY(1)`,willChange:`transform`,backfaceVisibility:`hidden`,transition:`none`}})]})]})]})]}):null}export{x as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
|
|
2
|
+
"use client";import e from"../../../utils/get-res-url.mjs";import{useIsClient as t}from"../../../hooks/use-is-client.mjs";import n from"../../../assets/icons/detail/video_play.mjs";import{useEffect as r,useImperativeHandle as i,useMemo as a,useRef as o,useState as s}from"react";import{jsx as c,jsxs as l}from"react/jsx-runtime";function u({ref:u,adData:d=null,visible:f=!1,autoStart:p=!1,sessionKey:m=`default`,onAutoplayBlocked:h,onFinish:g,onSkip:_,onOpenLink:v}){let y=o(null),[b,x]=s(0),[S,C]=s(!1),w=t(),T=o(!1),E=Number(d?.settings?.skip_seconds||0),D=a(()=>d?.materials?.[0],[d?.materials]),O=String(D?.advertise_video||``).trim(),k=a(()=>O?O.startsWith(`/m3f`)?`${e()}/${O}`:`${e()}/m3f${O}`:``,[O]),A=!!O,j=A?S:f,M=b<=0;r(()=>{C(!1),x(E),T.current=!1;let e=y.current;if(e)try{e.pause(),e.currentTime=0,e.load()}catch(e){console.warn(`重置前贴片播放状态失败:`,e)}},[k,m,E]),r(()=>{if(!f||!D)return;if(E<=0){x(0);return}if(!j)return;let e=window.setInterval(()=>{x(t=>t<=1?(window.clearInterval(e),0):t-1)},1e3);return()=>{window.clearInterval(e)}},[D,j,m,E,f]),r(()=>{!f||!p||!A||!y.current||T.current||(T.current=!0,y.current.play().catch(e=>{console.warn(`自动启动前贴片播放失败:`,e),h?.()}))},[p,A,h,m,f]),i(u,()=>({async play(){if(!y.current)return!1;try{return await y.current.play(),!0}catch(e){return console.warn(`手动启动前贴片播放失败:`,e),!1}}}),[]);function N(){M&&_?.()}function P(){if(A&&!S){let e=y.current;if(!e)return;e.play().catch(e=>{console.warn(`手动启动前贴片播放失败:`,e)});return}let e=D?.advertise_url;e&&(v?.(e),window.open(e,`_blank`,`noopener,noreferrer`))}if(!w||typeof window>`u`||!d?.hit||!D||!A)return null;let F=c(`video`,{ref:y,src:k,poster:D?.advertise_icon||``,className:`pointer-events-none w-full h-full object-cover bg-black`,autoPlay:p,muted:!0,playsInline:!0,preload:`none`,onEnded:()=>{g?.()},onPlaying:()=>{C(!0)},onError:e=>{console.warn(`[video-preroll-ad][error]`,{sessionKey:m,error:e.currentTarget?.error})}});return l(`div`,{className:`video-preroll-ad absolute top-0 left-0 w-full h-full z-[9999] ${f?``:`pointer-events-none opacity-0`}`,"aria-hidden":!f,children:[c(`button`,{type:`button`,disabled:!M,onClick:N,className:`absolute z-[10] text-sm top-6 right-6 bg-black/30 text-white rounded-full px-6 py-1.5 flex items-center justify-center disabled:opacity-60 disabled:cursor-not-allowed`,children:M?`跳过`:`跳过 ${b}s`}),l(`div`,{role:`button`,tabIndex:0,onClick:P,className:`relative block w-full h-full`,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),P())},children:[F,A&&!S&&c(`div`,{className:`absolute inset-0 z-[2] flex items-center justify-center bg-black/20 pointer-events-none`,children:c(`div`,{className:`flex items-center justify-center w-12 h-12 rounded-full bg-[rgba(0,0,0,0.45)]`,children:c(n,{className:`w-[16px] h-[22px] text-white`})})})]})]})}export{u as VideoPrerollAd};
|
|
@@ -8,7 +8,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
8
8
|
/** buttonVariants 工具定义。 */
|
|
9
9
|
declare const buttonVariants: (props?: ({
|
|
10
10
|
variant?: "link" | "default" | "destructive" | "secondary" | "outline" | "ghost" | null | undefined;
|
|
11
|
-
size?: "
|
|
11
|
+
size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
12
12
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
13
13
|
/** Button 组件属性。 */
|
|
14
14
|
type ButtonProps = Button.Props & VariantProps<typeof buttonVariants> & {
|
|
@@ -34,7 +34,7 @@ type EmptyStateProps = React.ComponentProps<'div'> & {
|
|
|
34
34
|
};
|
|
35
35
|
/** emptyMediaVariants 工具定义。 */
|
|
36
36
|
declare const emptyMediaVariants: (props?: ({
|
|
37
|
-
variant?: "
|
|
37
|
+
variant?: "default" | "icon" | null | undefined;
|
|
38
38
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
39
39
|
/** EmptyMedia 组件。 */
|
|
40
40
|
declare function EmptyMedia({
|
|
@@ -82,7 +82,7 @@ declare function Item({
|
|
|
82
82
|
}: ItemProps): React.ReactElement;
|
|
83
83
|
/** itemMediaVariants 工具定义。 */
|
|
84
84
|
declare const itemMediaVariants: (props?: ({
|
|
85
|
-
variant?: "
|
|
85
|
+
variant?: "default" | "icon" | "image" | null | undefined;
|
|
86
86
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
87
87
|
/** ItemMedia 组件。 */
|
|
88
88
|
declare function ItemMedia({
|
package/dist/types.d.mts
CHANGED
|
@@ -791,7 +791,7 @@ type ContentFloatingBallInfo = {
|
|
|
791
791
|
* 根据广告Code查询广告详情响应
|
|
792
792
|
*/
|
|
793
793
|
type ContentGetAdvertiseByCodeResponse = {
|
|
794
|
-
advertise?:
|
|
794
|
+
advertise?: ContentAdDetailInfo;
|
|
795
795
|
};
|
|
796
796
|
/**
|
|
797
797
|
* 获取频道推荐位数据响应
|
|
@@ -1434,39 +1434,11 @@ type ContentShowVideoInfo = {
|
|
|
1434
1434
|
* 是否广告组件
|
|
1435
1435
|
*/
|
|
1436
1436
|
is_ad?: boolean;
|
|
1437
|
+
ad?: ContentFeedAdInfo;
|
|
1437
1438
|
/**
|
|
1438
|
-
*
|
|
1439
|
-
*/
|
|
1440
|
-
ad_code?: string;
|
|
1441
|
-
/**
|
|
1442
|
-
* 广告跳转地址
|
|
1443
|
-
*/
|
|
1444
|
-
ad_advertise_url?: string;
|
|
1445
|
-
/**
|
|
1446
|
-
* 广告图片地址
|
|
1447
|
-
*/
|
|
1448
|
-
ad_advertise_icon?: string;
|
|
1449
|
-
/**
|
|
1450
|
-
* 广告类型枚举
|
|
1451
|
-
*/
|
|
1452
|
-
ad_advertise_type?: number;
|
|
1453
|
-
/**
|
|
1454
|
-
* 广告描述
|
|
1455
|
-
*/
|
|
1456
|
-
ad_advertise_desc?: string;
|
|
1457
|
-
/**
|
|
1458
|
-
* 广告开始时间戳(毫秒)
|
|
1459
|
-
*/
|
|
1460
|
-
ad_start_time?: number;
|
|
1461
|
-
/**
|
|
1462
|
-
* 广告结束时间戳(毫秒)
|
|
1463
|
-
*/
|
|
1464
|
-
ad_end_time?: number;
|
|
1465
|
-
/**
|
|
1466
|
-
* 广告扩展数据
|
|
1439
|
+
* 广告资源地址
|
|
1467
1440
|
*/
|
|
1468
|
-
|
|
1469
|
-
ad?: ContentFeedAdInfo;
|
|
1441
|
+
ad_resource_url?: string;
|
|
1470
1442
|
};
|
|
1471
1443
|
/**
|
|
1472
1444
|
* 标签对象
|
|
@@ -1653,6 +1625,14 @@ type ContentVideoDetail = {
|
|
|
1653
1625
|
* 浏览次数
|
|
1654
1626
|
*/
|
|
1655
1627
|
browse_count?: number;
|
|
1628
|
+
/**
|
|
1629
|
+
* 点赞数
|
|
1630
|
+
*/
|
|
1631
|
+
like_count?: number;
|
|
1632
|
+
/**
|
|
1633
|
+
* 收藏数
|
|
1634
|
+
*/
|
|
1635
|
+
collect_count?: number;
|
|
1656
1636
|
};
|
|
1657
1637
|
/**
|
|
1658
1638
|
* 剧集播放介质(对应 c_video_episode 中的 mediums)
|
|
@@ -4124,6 +4104,10 @@ type ContentMatchAdsResponse = {
|
|
|
4124
4104
|
*/
|
|
4125
4105
|
materials?: ContentMatchAdMaterial[];
|
|
4126
4106
|
settings?: ContentMatchAdSettings;
|
|
4107
|
+
/**
|
|
4108
|
+
* 广告资源地址(来自服务配置 common.ad_resource_url)
|
|
4109
|
+
*/
|
|
4110
|
+
ad_resource_url?: string;
|
|
4127
4111
|
};
|
|
4128
4112
|
type CommunityBatchDeleteCollectionResponse = {
|
|
4129
4113
|
/**
|
|
@@ -4179,6 +4163,10 @@ type ContentMatchAdMaterial = {
|
|
|
4179
4163
|
* 扩展展示信息
|
|
4180
4164
|
*/
|
|
4181
4165
|
ad_ext_data?: string;
|
|
4166
|
+
/**
|
|
4167
|
+
* 视频素材地址
|
|
4168
|
+
*/
|
|
4169
|
+
advertise_video?: string;
|
|
4182
4170
|
};
|
|
4183
4171
|
/**
|
|
4184
4172
|
* 信息流广告信息(仅在 ShowVideoInfo.is_ad=true 时返回)
|
|
@@ -4216,6 +4204,10 @@ type ContentFeedAdInfo = {
|
|
|
4216
4204
|
* 广告扩展数据
|
|
4217
4205
|
*/
|
|
4218
4206
|
ad_ext_data?: string;
|
|
4207
|
+
/**
|
|
4208
|
+
* 广告视频地址
|
|
4209
|
+
*/
|
|
4210
|
+
ad_advertise_video?: string;
|
|
4219
4211
|
};
|
|
4220
4212
|
/**
|
|
4221
4213
|
* 最热视频列表响应
|
|
@@ -4308,6 +4300,143 @@ type InternalSyncVideoToESResponse = {
|
|
|
4308
4300
|
*/
|
|
4309
4301
|
data?: unknown;
|
|
4310
4302
|
};
|
|
4303
|
+
/**
|
|
4304
|
+
* 广告详情
|
|
4305
|
+
*/
|
|
4306
|
+
type ContentAdDetailInfo = {
|
|
4307
|
+
/**
|
|
4308
|
+
* 广告基本信息
|
|
4309
|
+
*/
|
|
4310
|
+
advertise_code?: string;
|
|
4311
|
+
/**
|
|
4312
|
+
* 客户code
|
|
4313
|
+
*/
|
|
4314
|
+
customer_code?: string;
|
|
4315
|
+
/**
|
|
4316
|
+
* 广告名称
|
|
4317
|
+
*/
|
|
4318
|
+
advertise_name?: string;
|
|
4319
|
+
/**
|
|
4320
|
+
* 广告链接
|
|
4321
|
+
*/
|
|
4322
|
+
advertise_url?: string;
|
|
4323
|
+
/**
|
|
4324
|
+
* 广告图标
|
|
4325
|
+
*/
|
|
4326
|
+
advertise_icon?: string;
|
|
4327
|
+
/**
|
|
4328
|
+
* 广告类型
|
|
4329
|
+
*/
|
|
4330
|
+
advertise_type?: number;
|
|
4331
|
+
/**
|
|
4332
|
+
* 广告模式(如:CPS)
|
|
4333
|
+
*/
|
|
4334
|
+
ad_mode?: string;
|
|
4335
|
+
/**
|
|
4336
|
+
* 应用code
|
|
4337
|
+
*/
|
|
4338
|
+
app_code?: string;
|
|
4339
|
+
/**
|
|
4340
|
+
* 广告描述
|
|
4341
|
+
*/
|
|
4342
|
+
advertise_desc?: string;
|
|
4343
|
+
/**
|
|
4344
|
+
* PC端广告图标
|
|
4345
|
+
*/
|
|
4346
|
+
pc_advertise_icon?: string;
|
|
4347
|
+
/**
|
|
4348
|
+
* 状态和时间
|
|
4349
|
+
*/
|
|
4350
|
+
status?: number;
|
|
4351
|
+
/**
|
|
4352
|
+
* 开始时间戳(毫秒)
|
|
4353
|
+
*/
|
|
4354
|
+
start_time_stamp?: number;
|
|
4355
|
+
/**
|
|
4356
|
+
* 结束时间戳(毫秒)
|
|
4357
|
+
*/
|
|
4358
|
+
end_time_stamp?: number;
|
|
4359
|
+
/**
|
|
4360
|
+
* 排序
|
|
4361
|
+
*/
|
|
4362
|
+
sort?: number;
|
|
4363
|
+
/**
|
|
4364
|
+
* 扩展字段
|
|
4365
|
+
*/
|
|
4366
|
+
ad_ext_data?: string;
|
|
4367
|
+
/**
|
|
4368
|
+
* 广告扩展原始数据
|
|
4369
|
+
*/
|
|
4370
|
+
ad_ext_raw?: string;
|
|
4371
|
+
/**
|
|
4372
|
+
* 广告扩展预留字段
|
|
4373
|
+
*/
|
|
4374
|
+
ad_ext_reserve?: string;
|
|
4375
|
+
/**
|
|
4376
|
+
* 更新时间(ISO格式)
|
|
4377
|
+
*/
|
|
4378
|
+
update_time?: string;
|
|
4379
|
+
/**
|
|
4380
|
+
* 是否删除:0-未删除, 1-已删除
|
|
4381
|
+
*/
|
|
4382
|
+
is_delete?: number;
|
|
4383
|
+
/**
|
|
4384
|
+
* 更新人
|
|
4385
|
+
*/
|
|
4386
|
+
updater?: string;
|
|
4387
|
+
/**
|
|
4388
|
+
* 广告位信息
|
|
4389
|
+
*/
|
|
4390
|
+
advertise_location_code?: string;
|
|
4391
|
+
/**
|
|
4392
|
+
* 广告位名称
|
|
4393
|
+
*/
|
|
4394
|
+
advertise_location_name?: string;
|
|
4395
|
+
/**
|
|
4396
|
+
* 广告位备注
|
|
4397
|
+
*/
|
|
4398
|
+
advertise_location_remark?: string;
|
|
4399
|
+
/**
|
|
4400
|
+
* 广告位图片
|
|
4401
|
+
*/
|
|
4402
|
+
example_icon?: string;
|
|
4403
|
+
/**
|
|
4404
|
+
* 展示模式:0-多个轮播, 1-单体, 2-三分屏, 3-四分屏, 4-两分屏, 5-小图标, 6-大图标
|
|
4405
|
+
*/
|
|
4406
|
+
display_mode?: number;
|
|
4407
|
+
/**
|
|
4408
|
+
* 高度
|
|
4409
|
+
*/
|
|
4410
|
+
advertise_height?: number;
|
|
4411
|
+
/**
|
|
4412
|
+
* 宽度
|
|
4413
|
+
*/
|
|
4414
|
+
advertise_width?: number;
|
|
4415
|
+
/**
|
|
4416
|
+
* 素材类型:1-视频, 2-图片
|
|
4417
|
+
*/
|
|
4418
|
+
material_type?: number;
|
|
4419
|
+
/**
|
|
4420
|
+
* 广告限制数量
|
|
4421
|
+
*/
|
|
4422
|
+
ad_limit?: number;
|
|
4423
|
+
/**
|
|
4424
|
+
* 广告位状态:1-启用, 0-停用
|
|
4425
|
+
*/
|
|
4426
|
+
slot_status?: number;
|
|
4427
|
+
/**
|
|
4428
|
+
* 商户code
|
|
4429
|
+
*/
|
|
4430
|
+
merchant_code?: string;
|
|
4431
|
+
/**
|
|
4432
|
+
* 部门code
|
|
4433
|
+
*/
|
|
4434
|
+
dept_code?: string;
|
|
4435
|
+
/**
|
|
4436
|
+
* 广告视频地址
|
|
4437
|
+
*/
|
|
4438
|
+
advertise_video?: string;
|
|
4439
|
+
};
|
|
4311
4440
|
type PostApiCommunityPublishContentReqBody = {
|
|
4312
4441
|
/**
|
|
4313
4442
|
* 正文内容
|
|
@@ -5234,6 +5363,10 @@ type PostApiContentMatchAdsReqBody = {
|
|
|
5234
5363
|
*/
|
|
5235
5364
|
component_id?: string;
|
|
5236
5365
|
scene_context?: ContentAdSceneContext;
|
|
5366
|
+
/**
|
|
5367
|
+
* 应用编码(传入时参与广告匹配)
|
|
5368
|
+
*/
|
|
5369
|
+
app_code?: string;
|
|
5237
5370
|
};
|
|
5238
5371
|
type PostApiContentMatchAdsRes = {
|
|
5239
5372
|
code?: ResultCode;
|
|
@@ -7044,4 +7177,4 @@ type PostApiCommerceRefundCallbackRes = {
|
|
|
7044
7177
|
data: CommerceRefundCallbackResponse;
|
|
7045
7178
|
};
|
|
7046
7179
|
//#endregion
|
|
7047
|
-
export { CommerceCreatePaymentResponse, CommerceGetPaymentMethodsResponse, CommerceOrderResult, CommercePaymentCardInfo, CommercePaymentMethod, CommercePaymentMethodGroup, CommercePaymentPlayerInfo, CommercePaymentSuccessCallbackResponse, CommerceQueryOrderResultResponse, CommerceRefundCallbackResponse, CommunityAddContentToCollectionResponse, CommunityBatchDeleteCollectionResponse, CommunityCollectionData, CommunityCollectionDetail, CommunityCollectionInfo, CommunityCommentInfo, CommunityCommentListData, CommunityContentBrief, CommunityContentInfo, CommunityContentInteraction, CommunityContentListData, CommunityCreateCollectionResponse, CommunityCreateCommentResponse, CommunityDeleteCollectionResponse, CommunityDeleteCommentResponse, CommunityDeleteContentResponse, CommunityDislikeCommentResponse, CommunityFollowInfo, CommunityGetCollectionInfoResponse, CommunityGetCommentsResponse, CommunityGetCommentsResponseData, CommunityGetContentInfoResponse, CommunityGetContentListResponse, CommunityGetHotContentListResponse, CommunityGetSubscribedCollectionsResponse, CommunityGetUploadPresignedURLResponse, CommunityGetUserCollectionsResponse, CommunityHotContentInfo, CommunityLikeCommentResponse, CommunityMediaInfo, CommunityMediaTagInfo, CommunityMoveCollectionContentResponse, CommunityPublishContentResponse, CommunitySearchCurAccountFollowingUsersInfoResponse, CommunityShareContentResponse, CommunityShareData, CommunitySubscribeCollectionResponse, CommunityUpdateCollectionResponse, CommunityUpdateContentResponse, CommunityUploadMediaInfo, CommunityUploadMediaResponse, CommunityUserBrief, ContentAdSceneContext, ContentAdvertiseDetail, ContentAppChannel, ContentAppChannelBlock, ContentAppChannelBlockBanner, ContentAppChannelBlockData, ContentAppComponentCommon, ContentBaseUserInfo, ContentBatchGetVideoDetailResponse, ContentBlockIconInfo, ContentContentInfo, ContentFeedAdInfo, ContentFloatingBallInfo, ContentGeoConfig, ContentGeoFaq, ContentGetAdvertiseByCodeResponse, ContentGetAppChannelBlockDataResponse, ContentGetAppChannelBlockResponse, ContentGetAppChannelsResponse, ContentGetAppComponentResponse, ContentGetGuessYouLikeVideosResponse, ContentGetHotVideoListResponse, ContentGetMostPlayedVideoListResponse, ContentGetNewstVideoListResponse, ContentGetPopularVideoListResponse, ContentGetRecommendSearchListResponse, ContentGetRecommendVideoListResponse, ContentGetSeoConfigResponse, ContentGetTopRatedVideoListResponse, ContentGetVideoDetailByApiResponse, ContentGetVideoDetailResponse, ContentHotVideoInfo, ContentListVisibleFloatingBallResponse, ContentMatchAdMaterial, ContentMatchAdSettings, ContentMatchAdsResponse, ContentMediaInfo, ContentProcessM3U8Response, ContentRecommendContentAuthor, ContentRecommendContentInfo, ContentRecommendContentInteraction, ContentRecommendContentList, ContentRecommendContentMedia, ContentRecommendInfo, ContentRecommendUserInfo, ContentRecommendUserList, ContentRecommendVideoInfo, ContentRecommendVideoList, ContentSeoConfig, ContentShowVideoInfo, ContentTag, ContentVideoDetail, ContentVideoEpisodeMedium, ContentVideoEpisodeProto, ContentVideoLink, ContentVideoStatic, GetApiCommerceQueryOrderResultQuery, GetApiCommerceQueryOrderResultRes, GetApiCommunityGetCollectionInfoQuery, GetApiCommunityGetCollectionInfoRes, GetApiCommunityGetCommentsQuery, GetApiCommunityGetCommentsRes, GetApiCommunityGetContentInfoQuery, GetApiCommunityGetContentInfoRes, GetApiCommunityGetContentListQuery, GetApiCommunityGetContentListRes, GetApiCommunityGetHotContentListQuery, GetApiCommunityGetHotContentListRes, GetApiCommunityGetSubscribedCollectionsQuery, GetApiCommunityGetSubscribedCollectionsRes, GetApiCommunityGetUserCollectionsQuery, GetApiCommunityGetUserCollectionsRes, GetApiContentGetAdvertiseByCodeQuery, GetApiContentGetAdvertiseByCodeRes, GetApiContentGetAppChannelBlockDataQuery, GetApiContentGetAppChannelBlockDataRes, GetApiContentGetAppChannelBlockQuery, GetApiContentGetAppChannelBlockRes, GetApiContentGetAppChannelsQuery, GetApiContentGetAppChannelsRes, GetApiContentGetAppComponentRes, GetApiContentGetGuessYouLikeVideosQuery, GetApiContentGetGuessYouLikeVideosRes, GetApiContentGetHotVideoListQuery, GetApiContentGetHotVideoListRes, GetApiContentGetRecommendSearchListQuery, GetApiContentGetRecommendSearchListRes, GetApiContentGetRecommendVideoListQuery, GetApiContentGetRecommendVideoListRes, GetApiContentGetSeoConfigQuery, GetApiContentGetSeoConfigRes, GetApiContentGetVideoDetailByApiQuery, GetApiContentGetVideoDetailByApiRes, GetApiContentGetVideoDetailQuery, GetApiContentGetVideoDetailRes, GetApiContentListVisibleFloatingBallQuery, GetApiContentListVisibleFloatingBallRes, GetApiContentProcessM3u8Query, GetApiContentProcessM3u8Res, GetApiInteractionCheckMutualFollowQuery, GetApiInteractionCheckMutualFollowRes, GetApiInteractionGetBrowseListQuery, GetApiInteractionGetBrowseListRes, GetApiInteractionGetContentDislikeListQuery, GetApiInteractionGetContentDislikeListRes, GetApiInteractionGetContentLikeListQuery, GetApiInteractionGetContentLikeListRes, GetApiInteractionGetDislikeListQuery, GetApiInteractionGetDislikeListRes, GetApiInteractionGetFolderQuery, GetApiInteractionGetFolderRes, GetApiInteractionGetFolderStatsQuery, GetApiInteractionGetFolderStatsRes, GetApiInteractionGetFollowStatsQuery, GetApiInteractionGetFollowStatsRes, GetApiInteractionGetFollowerListQuery, GetApiInteractionGetFollowerListRes, GetApiInteractionGetFollowingContentListQuery, GetApiInteractionGetFollowingContentListRes, GetApiInteractionGetFollowingListQuery, GetApiInteractionGetFollowingListRes, GetApiInteractionGetFollowingUserUpdatesQuery, GetApiInteractionGetFollowingUserUpdatesRes, GetApiInteractionGetLikeListQuery, GetApiInteractionGetLikeListRes, GetApiInteractionListCollectsQuery, GetApiInteractionListCollectsRes, GetApiInteractionListFoldersQuery, GetApiInteractionListFoldersRes, GetApiUserGetGuestIdentityQuery, GetApiUserGetGuestIdentityRes, GetApiUserGetUserEditInfoQuery, GetApiUserGetUserEditInfoRes, GetApiUserGetUserInfoQuery, GetApiUserGetUserInfoRes, GetApiUserGetUserPrivacySettingsQuery, GetApiUserGetUserPrivacySettingsRes, GetApiUserGetVisitorPermissionConfigQuery, GetApiUserGetVisitorPermissionConfigRes, GetApiUserViewUserInfoQuery, GetApiUserViewUserInfoRes, GoogleProtobufAny, InteractionAddCollectResponse, InteractionBatchClearBrowseResponse, InteractionBatchDeleteCollectsResponse, InteractionBatchDeleteFoldersResponse, InteractionBatchGetCommentLikeStatusResponse, InteractionBatchGetFollowStatsResponse, InteractionBatchGetLikeStatusResponse, InteractionBatchQueryContentInteractionsResponse, InteractionBrowseItem, InteractionBrowseRecord, InteractionBrowseResponse, InteractionCancelDislikeResponse, InteractionCancelLikeResponse, InteractionCheckCollectResponse, InteractionCheckFollowResponse, InteractionCheckMutualFollowResponse, InteractionClearBrowseHistoryResponse, InteractionCollectInfo, InteractionCollectItem, InteractionContentInteraction, InteractionContentInteractionStatus, InteractionCreateFolderResponse, InteractionDeleteFolderResponse, InteractionDislikeResponse, InteractionEpisode, InteractionFolderInfo, InteractionFolderStats, InteractionFollowInfoItem, InteractionFollowResponse, InteractionFollowingContentItem, InteractionGetBrowseListResponse, InteractionGetContentDislikeListResponse, InteractionGetContentLikeListResponse, InteractionGetDislikeListResponse, InteractionGetFolderResponse, InteractionGetFolderStatsResponse, InteractionGetFollowStatsResponse, InteractionGetFollowerListResponse, InteractionGetFollowingContentListResponse, InteractionGetFollowingListResponse, InteractionGetFollowingUserUpdatesResponse, InteractionGetLikeListResponse, InteractionLikeInfo, InteractionLikeItem, InteractionLikeResponse, InteractionLikeStatusItem, InteractionListCollectsResponse, InteractionListFoldersResponse, InteractionMediaInfo, InteractionMoveCollectsResponse, InteractionPostInfo, InteractionRemoveCollectResponse, InteractionTrackEvent, InteractionUnfollowResponse, InteractionUnifiedBatchLikeDislikeResponse, InteractionUnifiedBatchLikeDislikeResult, InteractionUserBrief, InteractionVideoDetailNested, InteractionVideoInfo, InteractionVideoMedia, InteractionVideoTag, InternalReplayVideoDetailPrewarmData, InternalReplayVideoDetailPrewarmRequest, InternalReplayVideoDetailPrewarmResponse, InternalSyncVideoToESRequest, InternalSyncVideoToESResponse, PostApiCommerceCreatePaymentReqBody, PostApiCommerceCreatePaymentRes, PostApiCommerceGetPaymentMethodsReqBody, PostApiCommerceGetPaymentMethodsRes, PostApiCommercePaymentSuccessCallbackReqBody, PostApiCommercePaymentSuccessCallbackRes, PostApiCommerceRefundCallbackReqBody, PostApiCommerceRefundCallbackRes, PostApiCommunityAddContentToCollectionReqBody, PostApiCommunityAddContentToCollectionRes, PostApiCommunityBatchDeleteCollectionReqBody, PostApiCommunityBatchDeleteCollectionRes, PostApiCommunityCreateCollectionReqBody, PostApiCommunityCreateCollectionRes, PostApiCommunityCreateCommentReqBody, PostApiCommunityCreateCommentRes, PostApiCommunityDeleteCollectionReqBody, PostApiCommunityDeleteCollectionRes, PostApiCommunityDeleteCommentReqBody, PostApiCommunityDeleteCommentRes, PostApiCommunityDeleteContentReqBody, PostApiCommunityDeleteContentRes, PostApiCommunityDislikeCommentReqBody, PostApiCommunityDislikeCommentRes, PostApiCommunityGetUploadPresignedURLReqBody, PostApiCommunityGetUploadPresignedURLRes, PostApiCommunityLikeCommentReqBody, PostApiCommunityLikeCommentRes, PostApiCommunityMoveCollectionContentReqBody, PostApiCommunityMoveCollectionContentRes, PostApiCommunityPublishContentReqBody, PostApiCommunityPublishContentRes, PostApiCommunityRemoveContentFromCollectionReqBody, PostApiCommunityRemoveContentFromCollectionRes, PostApiCommunitySearchCurAccountFollowingUsersInfoReqBody, PostApiCommunitySearchCurAccountFollowingUsersInfoRes, PostApiCommunityShareContentReqBody, PostApiCommunityShareContentRes, PostApiCommunitySubscribeCollectionReqBody, PostApiCommunitySubscribeCollectionRes, PostApiCommunityUpdateCollectionReqBody, PostApiCommunityUpdateCollectionRes, PostApiCommunityUpdateContentReqBody, PostApiCommunityUpdateContentRes, PostApiCommunityUploadMediaReqBody, PostApiCommunityUploadMediaRes, PostApiContentBatchGetVideoDetailReqBody, PostApiContentBatchGetVideoDetailRes, PostApiContentGetMostPlayedVideoListReqBody, PostApiContentGetMostPlayedVideoListRes, PostApiContentGetNewstVideoListReqBody, PostApiContentGetNewstVideoListRes, PostApiContentGetPopularVideoListReqBody, PostApiContentGetPopularVideoListRes, PostApiContentGetTopRatedVideoListReqBody, PostApiContentGetTopRatedVideoListRes, PostApiContentMatchAdsReqBody, PostApiContentMatchAdsRes, PostApiInteractionAddCollectReqBody, PostApiInteractionAddCollectRes, PostApiInteractionBatchClearBrowseReqBody, PostApiInteractionBatchClearBrowseRes, PostApiInteractionBatchDeleteCollectsReqBody, PostApiInteractionBatchDeleteCollectsRes, PostApiInteractionBatchDeleteFoldersReqBody, PostApiInteractionBatchDeleteFoldersRes, PostApiInteractionBatchGetCommentLikeStatusReqBody, PostApiInteractionBatchGetCommentLikeStatusRes, PostApiInteractionBatchGetFollowStatsReqBody, PostApiInteractionBatchGetFollowStatsRes, PostApiInteractionBatchGetLikeStatusReqBody, PostApiInteractionBatchGetLikeStatusRes, PostApiInteractionBatchQueryContentInteractionsReqBody, PostApiInteractionBatchQueryContentInteractionsRes, PostApiInteractionBrowseReqBody, PostApiInteractionBrowseRes, PostApiInteractionCancelDislikeReqBody, PostApiInteractionCancelDislikeRes, PostApiInteractionCancelLikeReqBody, PostApiInteractionCancelLikeRes, PostApiInteractionCheckCollectReqBody, PostApiInteractionCheckCollectRes, PostApiInteractionCheckFollowReqBody, PostApiInteractionCheckFollowRes, PostApiInteractionClearBrowseHistoryReqBody, PostApiInteractionClearBrowseHistoryRes, PostApiInteractionCreateFolderReqBody, PostApiInteractionCreateFolderRes, PostApiInteractionDeleteBrowseRecordReqBody, PostApiInteractionDeleteBrowseRecordRes, PostApiInteractionDeleteFolderReqBody, PostApiInteractionDeleteFolderRes, PostApiInteractionDislikeCommentReqBody, PostApiInteractionDislikeCommentRes, PostApiInteractionDislikeReqBody, PostApiInteractionDislikeRes, PostApiInteractionFollowReqBody, PostApiInteractionFollowRes, PostApiInteractionLikeCommentReqBody, PostApiInteractionLikeCommentRes, PostApiInteractionLikeReqBody, PostApiInteractionLikeRes, PostApiInteractionMoveCollectsReqBody, PostApiInteractionMoveCollectsRes, PostApiInteractionRemoveCollectReqBody, PostApiInteractionRemoveCollectRes, PostApiInteractionTrackEventsBatchReqBody, PostApiInteractionTrackEventsBatchRes, PostApiInteractionUnfollowReqBody, PostApiInteractionUnfollowRes, PostApiInteractionUnifiedBatchLikeDislikeReqBody, PostApiInteractionUnifiedBatchLikeDislikeRes, PostApiInteractionUpdateFolderReqBody, PostApiInteractionUpdateFolderRes, PostApiInteractionUpdateFollowingContentUpdateTimeReqBody, PostApiInteractionUpdateFollowingContentUpdateTimeRes, PostApiUserEditUserInfoReqBody, PostApiUserEditUserInfoRes, PostApiUserLoginReqBody, PostApiUserLoginRes, PostApiUserRegisterByVerifyEmailCodeReqBody, PostApiUserRegisterByVerifyEmailCodeRes, PostApiUserRegisterReqBody, PostApiUserRegisterRes, PostApiUserResetForgetPasswordReqBody, PostApiUserResetForgetPasswordRes, PostApiUserResetPasswordReqBody, PostApiUserResetPasswordRes, PostApiUserSendEmailCodeReqBody, PostApiUserSendEmailCodeRes, PostApiUserSendForgetEmailCodeReqBody, PostApiUserSendForgetEmailCodeRes, PostApiUserSendResetPasswordEmailCodeReqBody, PostApiUserSendResetPasswordEmailCodeRes, PostApiUserUploadUserBgImageReqBody, PostApiUserUploadUserBgImageRes, PostApiUserUserFeedbackReqBody, PostApiUserUserFeedbackRes, PostApiUserUserPrivacySettingsReqBody, PostApiUserUserPrivacySettingsRes, PostApiUserVerifyEmailCodeReqBody, PostApiUserVerifyEmailCodeRes, PostApiUserVerifyForgetEmailCodeReqBody, PostApiUserVerifyForgetEmailCodeRes, PostApiUserVerifyResetPasswordEmailCodeReqBody, PostApiUserVerifyResetPasswordEmailCodeRes, Result, ResultCode, ResultGrpc, Status, UserGetGuestIdentityResponse, UserGetUserEditInfoResponse, UserGetUserInfoResponse, UserGetUserPrivacySettingsResponse, UserGetVisitorPermissionConfigResponse, UserLoginResponse, UserRegisterByVerifyEmailCodeResponse, UserRegisterResponse, UserViewUserInfoResponse };
|
|
7180
|
+
export { CommerceCreatePaymentResponse, CommerceGetPaymentMethodsResponse, CommerceOrderResult, CommercePaymentCardInfo, CommercePaymentMethod, CommercePaymentMethodGroup, CommercePaymentPlayerInfo, CommercePaymentSuccessCallbackResponse, CommerceQueryOrderResultResponse, CommerceRefundCallbackResponse, CommunityAddContentToCollectionResponse, CommunityBatchDeleteCollectionResponse, CommunityCollectionData, CommunityCollectionDetail, CommunityCollectionInfo, CommunityCommentInfo, CommunityCommentListData, CommunityContentBrief, CommunityContentInfo, CommunityContentInteraction, CommunityContentListData, CommunityCreateCollectionResponse, CommunityCreateCommentResponse, CommunityDeleteCollectionResponse, CommunityDeleteCommentResponse, CommunityDeleteContentResponse, CommunityDislikeCommentResponse, CommunityFollowInfo, CommunityGetCollectionInfoResponse, CommunityGetCommentsResponse, CommunityGetCommentsResponseData, CommunityGetContentInfoResponse, CommunityGetContentListResponse, CommunityGetHotContentListResponse, CommunityGetSubscribedCollectionsResponse, CommunityGetUploadPresignedURLResponse, CommunityGetUserCollectionsResponse, CommunityHotContentInfo, CommunityLikeCommentResponse, CommunityMediaInfo, CommunityMediaTagInfo, CommunityMoveCollectionContentResponse, CommunityPublishContentResponse, CommunitySearchCurAccountFollowingUsersInfoResponse, CommunityShareContentResponse, CommunityShareData, CommunitySubscribeCollectionResponse, CommunityUpdateCollectionResponse, CommunityUpdateContentResponse, CommunityUploadMediaInfo, CommunityUploadMediaResponse, CommunityUserBrief, ContentAdDetailInfo, ContentAdSceneContext, ContentAdvertiseDetail, ContentAppChannel, ContentAppChannelBlock, ContentAppChannelBlockBanner, ContentAppChannelBlockData, ContentAppComponentCommon, ContentBaseUserInfo, ContentBatchGetVideoDetailResponse, ContentBlockIconInfo, ContentContentInfo, ContentFeedAdInfo, ContentFloatingBallInfo, ContentGeoConfig, ContentGeoFaq, ContentGetAdvertiseByCodeResponse, ContentGetAppChannelBlockDataResponse, ContentGetAppChannelBlockResponse, ContentGetAppChannelsResponse, ContentGetAppComponentResponse, ContentGetGuessYouLikeVideosResponse, ContentGetHotVideoListResponse, ContentGetMostPlayedVideoListResponse, ContentGetNewstVideoListResponse, ContentGetPopularVideoListResponse, ContentGetRecommendSearchListResponse, ContentGetRecommendVideoListResponse, ContentGetSeoConfigResponse, ContentGetTopRatedVideoListResponse, ContentGetVideoDetailByApiResponse, ContentGetVideoDetailResponse, ContentHotVideoInfo, ContentListVisibleFloatingBallResponse, ContentMatchAdMaterial, ContentMatchAdSettings, ContentMatchAdsResponse, ContentMediaInfo, ContentProcessM3U8Response, ContentRecommendContentAuthor, ContentRecommendContentInfo, ContentRecommendContentInteraction, ContentRecommendContentList, ContentRecommendContentMedia, ContentRecommendInfo, ContentRecommendUserInfo, ContentRecommendUserList, ContentRecommendVideoInfo, ContentRecommendVideoList, ContentSeoConfig, ContentShowVideoInfo, ContentTag, ContentVideoDetail, ContentVideoEpisodeMedium, ContentVideoEpisodeProto, ContentVideoLink, ContentVideoStatic, GetApiCommerceQueryOrderResultQuery, GetApiCommerceQueryOrderResultRes, GetApiCommunityGetCollectionInfoQuery, GetApiCommunityGetCollectionInfoRes, GetApiCommunityGetCommentsQuery, GetApiCommunityGetCommentsRes, GetApiCommunityGetContentInfoQuery, GetApiCommunityGetContentInfoRes, GetApiCommunityGetContentListQuery, GetApiCommunityGetContentListRes, GetApiCommunityGetHotContentListQuery, GetApiCommunityGetHotContentListRes, GetApiCommunityGetSubscribedCollectionsQuery, GetApiCommunityGetSubscribedCollectionsRes, GetApiCommunityGetUserCollectionsQuery, GetApiCommunityGetUserCollectionsRes, GetApiContentGetAdvertiseByCodeQuery, GetApiContentGetAdvertiseByCodeRes, GetApiContentGetAppChannelBlockDataQuery, GetApiContentGetAppChannelBlockDataRes, GetApiContentGetAppChannelBlockQuery, GetApiContentGetAppChannelBlockRes, GetApiContentGetAppChannelsQuery, GetApiContentGetAppChannelsRes, GetApiContentGetAppComponentRes, GetApiContentGetGuessYouLikeVideosQuery, GetApiContentGetGuessYouLikeVideosRes, GetApiContentGetHotVideoListQuery, GetApiContentGetHotVideoListRes, GetApiContentGetRecommendSearchListQuery, GetApiContentGetRecommendSearchListRes, GetApiContentGetRecommendVideoListQuery, GetApiContentGetRecommendVideoListRes, GetApiContentGetSeoConfigQuery, GetApiContentGetSeoConfigRes, GetApiContentGetVideoDetailByApiQuery, GetApiContentGetVideoDetailByApiRes, GetApiContentGetVideoDetailQuery, GetApiContentGetVideoDetailRes, GetApiContentListVisibleFloatingBallQuery, GetApiContentListVisibleFloatingBallRes, GetApiContentProcessM3u8Query, GetApiContentProcessM3u8Res, GetApiInteractionCheckMutualFollowQuery, GetApiInteractionCheckMutualFollowRes, GetApiInteractionGetBrowseListQuery, GetApiInteractionGetBrowseListRes, GetApiInteractionGetContentDislikeListQuery, GetApiInteractionGetContentDislikeListRes, GetApiInteractionGetContentLikeListQuery, GetApiInteractionGetContentLikeListRes, GetApiInteractionGetDislikeListQuery, GetApiInteractionGetDislikeListRes, GetApiInteractionGetFolderQuery, GetApiInteractionGetFolderRes, GetApiInteractionGetFolderStatsQuery, GetApiInteractionGetFolderStatsRes, GetApiInteractionGetFollowStatsQuery, GetApiInteractionGetFollowStatsRes, GetApiInteractionGetFollowerListQuery, GetApiInteractionGetFollowerListRes, GetApiInteractionGetFollowingContentListQuery, GetApiInteractionGetFollowingContentListRes, GetApiInteractionGetFollowingListQuery, GetApiInteractionGetFollowingListRes, GetApiInteractionGetFollowingUserUpdatesQuery, GetApiInteractionGetFollowingUserUpdatesRes, GetApiInteractionGetLikeListQuery, GetApiInteractionGetLikeListRes, GetApiInteractionListCollectsQuery, GetApiInteractionListCollectsRes, GetApiInteractionListFoldersQuery, GetApiInteractionListFoldersRes, GetApiUserGetGuestIdentityQuery, GetApiUserGetGuestIdentityRes, GetApiUserGetUserEditInfoQuery, GetApiUserGetUserEditInfoRes, GetApiUserGetUserInfoQuery, GetApiUserGetUserInfoRes, GetApiUserGetUserPrivacySettingsQuery, GetApiUserGetUserPrivacySettingsRes, GetApiUserGetVisitorPermissionConfigQuery, GetApiUserGetVisitorPermissionConfigRes, GetApiUserViewUserInfoQuery, GetApiUserViewUserInfoRes, GoogleProtobufAny, InteractionAddCollectResponse, InteractionBatchClearBrowseResponse, InteractionBatchDeleteCollectsResponse, InteractionBatchDeleteFoldersResponse, InteractionBatchGetCommentLikeStatusResponse, InteractionBatchGetFollowStatsResponse, InteractionBatchGetLikeStatusResponse, InteractionBatchQueryContentInteractionsResponse, InteractionBrowseItem, InteractionBrowseRecord, InteractionBrowseResponse, InteractionCancelDislikeResponse, InteractionCancelLikeResponse, InteractionCheckCollectResponse, InteractionCheckFollowResponse, InteractionCheckMutualFollowResponse, InteractionClearBrowseHistoryResponse, InteractionCollectInfo, InteractionCollectItem, InteractionContentInteraction, InteractionContentInteractionStatus, InteractionCreateFolderResponse, InteractionDeleteFolderResponse, InteractionDislikeResponse, InteractionEpisode, InteractionFolderInfo, InteractionFolderStats, InteractionFollowInfoItem, InteractionFollowResponse, InteractionFollowingContentItem, InteractionGetBrowseListResponse, InteractionGetContentDislikeListResponse, InteractionGetContentLikeListResponse, InteractionGetDislikeListResponse, InteractionGetFolderResponse, InteractionGetFolderStatsResponse, InteractionGetFollowStatsResponse, InteractionGetFollowerListResponse, InteractionGetFollowingContentListResponse, InteractionGetFollowingListResponse, InteractionGetFollowingUserUpdatesResponse, InteractionGetLikeListResponse, InteractionLikeInfo, InteractionLikeItem, InteractionLikeResponse, InteractionLikeStatusItem, InteractionListCollectsResponse, InteractionListFoldersResponse, InteractionMediaInfo, InteractionMoveCollectsResponse, InteractionPostInfo, InteractionRemoveCollectResponse, InteractionTrackEvent, InteractionUnfollowResponse, InteractionUnifiedBatchLikeDislikeResponse, InteractionUnifiedBatchLikeDislikeResult, InteractionUserBrief, InteractionVideoDetailNested, InteractionVideoInfo, InteractionVideoMedia, InteractionVideoTag, InternalReplayVideoDetailPrewarmData, InternalReplayVideoDetailPrewarmRequest, InternalReplayVideoDetailPrewarmResponse, InternalSyncVideoToESRequest, InternalSyncVideoToESResponse, PostApiCommerceCreatePaymentReqBody, PostApiCommerceCreatePaymentRes, PostApiCommerceGetPaymentMethodsReqBody, PostApiCommerceGetPaymentMethodsRes, PostApiCommercePaymentSuccessCallbackReqBody, PostApiCommercePaymentSuccessCallbackRes, PostApiCommerceRefundCallbackReqBody, PostApiCommerceRefundCallbackRes, PostApiCommunityAddContentToCollectionReqBody, PostApiCommunityAddContentToCollectionRes, PostApiCommunityBatchDeleteCollectionReqBody, PostApiCommunityBatchDeleteCollectionRes, PostApiCommunityCreateCollectionReqBody, PostApiCommunityCreateCollectionRes, PostApiCommunityCreateCommentReqBody, PostApiCommunityCreateCommentRes, PostApiCommunityDeleteCollectionReqBody, PostApiCommunityDeleteCollectionRes, PostApiCommunityDeleteCommentReqBody, PostApiCommunityDeleteCommentRes, PostApiCommunityDeleteContentReqBody, PostApiCommunityDeleteContentRes, PostApiCommunityDislikeCommentReqBody, PostApiCommunityDislikeCommentRes, PostApiCommunityGetUploadPresignedURLReqBody, PostApiCommunityGetUploadPresignedURLRes, PostApiCommunityLikeCommentReqBody, PostApiCommunityLikeCommentRes, PostApiCommunityMoveCollectionContentReqBody, PostApiCommunityMoveCollectionContentRes, PostApiCommunityPublishContentReqBody, PostApiCommunityPublishContentRes, PostApiCommunityRemoveContentFromCollectionReqBody, PostApiCommunityRemoveContentFromCollectionRes, PostApiCommunitySearchCurAccountFollowingUsersInfoReqBody, PostApiCommunitySearchCurAccountFollowingUsersInfoRes, PostApiCommunityShareContentReqBody, PostApiCommunityShareContentRes, PostApiCommunitySubscribeCollectionReqBody, PostApiCommunitySubscribeCollectionRes, PostApiCommunityUpdateCollectionReqBody, PostApiCommunityUpdateCollectionRes, PostApiCommunityUpdateContentReqBody, PostApiCommunityUpdateContentRes, PostApiCommunityUploadMediaReqBody, PostApiCommunityUploadMediaRes, PostApiContentBatchGetVideoDetailReqBody, PostApiContentBatchGetVideoDetailRes, PostApiContentGetMostPlayedVideoListReqBody, PostApiContentGetMostPlayedVideoListRes, PostApiContentGetNewstVideoListReqBody, PostApiContentGetNewstVideoListRes, PostApiContentGetPopularVideoListReqBody, PostApiContentGetPopularVideoListRes, PostApiContentGetTopRatedVideoListReqBody, PostApiContentGetTopRatedVideoListRes, PostApiContentMatchAdsReqBody, PostApiContentMatchAdsRes, PostApiInteractionAddCollectReqBody, PostApiInteractionAddCollectRes, PostApiInteractionBatchClearBrowseReqBody, PostApiInteractionBatchClearBrowseRes, PostApiInteractionBatchDeleteCollectsReqBody, PostApiInteractionBatchDeleteCollectsRes, PostApiInteractionBatchDeleteFoldersReqBody, PostApiInteractionBatchDeleteFoldersRes, PostApiInteractionBatchGetCommentLikeStatusReqBody, PostApiInteractionBatchGetCommentLikeStatusRes, PostApiInteractionBatchGetFollowStatsReqBody, PostApiInteractionBatchGetFollowStatsRes, PostApiInteractionBatchGetLikeStatusReqBody, PostApiInteractionBatchGetLikeStatusRes, PostApiInteractionBatchQueryContentInteractionsReqBody, PostApiInteractionBatchQueryContentInteractionsRes, PostApiInteractionBrowseReqBody, PostApiInteractionBrowseRes, PostApiInteractionCancelDislikeReqBody, PostApiInteractionCancelDislikeRes, PostApiInteractionCancelLikeReqBody, PostApiInteractionCancelLikeRes, PostApiInteractionCheckCollectReqBody, PostApiInteractionCheckCollectRes, PostApiInteractionCheckFollowReqBody, PostApiInteractionCheckFollowRes, PostApiInteractionClearBrowseHistoryReqBody, PostApiInteractionClearBrowseHistoryRes, PostApiInteractionCreateFolderReqBody, PostApiInteractionCreateFolderRes, PostApiInteractionDeleteBrowseRecordReqBody, PostApiInteractionDeleteBrowseRecordRes, PostApiInteractionDeleteFolderReqBody, PostApiInteractionDeleteFolderRes, PostApiInteractionDislikeCommentReqBody, PostApiInteractionDislikeCommentRes, PostApiInteractionDislikeReqBody, PostApiInteractionDislikeRes, PostApiInteractionFollowReqBody, PostApiInteractionFollowRes, PostApiInteractionLikeCommentReqBody, PostApiInteractionLikeCommentRes, PostApiInteractionLikeReqBody, PostApiInteractionLikeRes, PostApiInteractionMoveCollectsReqBody, PostApiInteractionMoveCollectsRes, PostApiInteractionRemoveCollectReqBody, PostApiInteractionRemoveCollectRes, PostApiInteractionTrackEventsBatchReqBody, PostApiInteractionTrackEventsBatchRes, PostApiInteractionUnfollowReqBody, PostApiInteractionUnfollowRes, PostApiInteractionUnifiedBatchLikeDislikeReqBody, PostApiInteractionUnifiedBatchLikeDislikeRes, PostApiInteractionUpdateFolderReqBody, PostApiInteractionUpdateFolderRes, PostApiInteractionUpdateFollowingContentUpdateTimeReqBody, PostApiInteractionUpdateFollowingContentUpdateTimeRes, PostApiUserEditUserInfoReqBody, PostApiUserEditUserInfoRes, PostApiUserLoginReqBody, PostApiUserLoginRes, PostApiUserRegisterByVerifyEmailCodeReqBody, PostApiUserRegisterByVerifyEmailCodeRes, PostApiUserRegisterReqBody, PostApiUserRegisterRes, PostApiUserResetForgetPasswordReqBody, PostApiUserResetForgetPasswordRes, PostApiUserResetPasswordReqBody, PostApiUserResetPasswordRes, PostApiUserSendEmailCodeReqBody, PostApiUserSendEmailCodeRes, PostApiUserSendForgetEmailCodeReqBody, PostApiUserSendForgetEmailCodeRes, PostApiUserSendResetPasswordEmailCodeReqBody, PostApiUserSendResetPasswordEmailCodeRes, PostApiUserUploadUserBgImageReqBody, PostApiUserUploadUserBgImageRes, PostApiUserUserFeedbackReqBody, PostApiUserUserFeedbackRes, PostApiUserUserPrivacySettingsReqBody, PostApiUserUserPrivacySettingsRes, PostApiUserVerifyEmailCodeReqBody, PostApiUserVerifyEmailCodeRes, PostApiUserVerifyForgetEmailCodeReqBody, PostApiUserVerifyForgetEmailCodeRes, PostApiUserVerifyResetPasswordEmailCodeReqBody, PostApiUserVerifyResetPasswordEmailCodeRes, Result, ResultCode, ResultGrpc, Status, UserGetGuestIdentityResponse, UserGetUserEditInfoResponse, UserGetUserInfoResponse, UserGetUserPrivacySettingsResponse, UserGetVisitorPermissionConfigResponse, UserLoginResponse, UserRegisterByVerifyEmailCodeResponse, UserRegisterResponse, UserViewUserInfoResponse };
|