PageSourceSearch

https://rubpage.com/assets/VideoWatchPage-BavhMKL9.js

js rubpage.com collected 2026-10-02 19:37:15 UTC 3,142 bytes, 1 lines download raw bytes

1import{u as p,j as t}from"./vendor-query-nkyHp8gL.js";import{h as x,r as b,L as l}from"./vendor-react-BNT0nzvx.js";import{L as a,n as h,P as n,s as f}from"./index-UlqsakHc.js";import{B as g}from"./Breadcrumbs-DYhNFUrn.js";import{A as j}from"./arrow-left-BA21u0OK.js";import"./vendor-ui-DPPUfW-O.js";import"./vendor-charts-B_MCcq71.js";import"./vendor-supabase-BRDBMtg7.js";import"./chevron-right-Cm0QdkHJ.js";const y=f;function v(s){return s.match(/(?:youtu\.be\/|youtube\.com\/(?:watch\?v=|embed\/|v\/))([a-zA-Z0-9_-]{11})/)?.[1]??null}const A=()=>{const{slug:s}=x(),{data:e,isLoading:d}=p({queryKey:["video",s],enabled:!!s,queryFn:async()=>{const{data:m,error:i}=await y.from("videos").select("*").eq("slug",s).eq("published",!0).single();if(i)throw i;return m}}),r=e?v(e.youtube_url):null,o=e?.thumbnail_url||(r?`https://img.youtube.com/vi/${r}/hqdefault.jpg`:null),c=b.useMemo(()=>{if(!(!e||!r))return{"@type":"VideoObject",name:e.title,description:e.description||e.title,thumbnailUrl:o,uploadDate:e.created_at,contentUrl:e.youtube_url,embedUrl:`https://www.youtube.com/embed/${r}`,publisher:{"@type":"Organization",name:"RubPage",url:"https://rubpage.com"}}},[e,r,o]),u=[{label:"Home",href:"/"},{label:"Videos",href:"/videos"},{label:e?.title??"Watch"}];return d?t.jsx(a,{children:t.jsx("div",{className:"flex items-center justify-center py-32",children:t.jsx(h,{className:"w-8 h-8 animate-spin text-muted-foreground"})})}):e?t.jsxs(a,{children:[t.jsx(n,{title:`${e.title} — RubPage Videos`,description:e.description||`Watch ${e.title} on RubPage`,canonical:`/videos/${e.slug}`,ogImage:o||void 0,jsonLd:c,noindex:!1}),t.jsxs("div",{className:"container mx-auto px-4 py-6 max-w-4xl",children:[t.jsx(g,{items:u}),r&&t.jsx("div",{className:"relative aspect-video rounded-lg overflow-hidden bg-black mb-6",children:t.jsx("iframe",{src:`https://www.youtube.com/embed/${r}?rel=0`,title:e.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"absolute inset-0 w-full h-full",loading:"lazy"})}),t.jsx("h1",{className:"text-xl md:text-2xl font-bold text-foreground mb-3",children:e.title}),e.description&&t.jsx("div",{className:"prose prose-sm max-w-none text-foreground/90 mb-6",children:t.jsx("p",{children:e.description})}),e.transcript&&t.jsxs("details",{className:"border border-border rounded-lg p-4 mb-6",children:[t.jsx("summary",{className:"font-medium text-foreground cursor-pointer",children:"Transcript"}),t.jsx("div",{className:"mt-3 text-sm text-muted-foreground whitespace-pre-wrap leading-relaxed",children:e.transcript})]}),t.jsxs(l,{to:"/videos",className:"inline-flex items-center gap-1.5 text-sm text-primary hover:underline",children:[t.jsx(j,{className:"w-4 h-4"})," All Videos"]})]})]}):t.jsxs(a,{children:[t.jsx(n,{title:"Video Not Found — RubPage",noindex:!0}),t.jsxs("div",{className:"container mx-auto px-4 py-16 text-center",children:[t.jsx("h1",{className:"text-xl font-bold mb-2",children:"Video Not Found"}),t.jsx(l,{to:"/videos",className:"text-primary hover:underline",children:"← Back to Videos"})]})]})};export{A as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.