Skip to content

Commit

Permalink
fix: adding titles to videos
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhooks committed Jan 21, 2025
1 parent aa5fd88 commit f2e3d54
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 4 deletions.
1 change: 1 addition & 0 deletions apps/ai-hero/src/app/(content)/[post]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ async function PlayerContainer({ post }: { post: Post | null }) {
className="mb-10 flex flex-col items-center justify-center border-b bg-black"
>
<PostPlayer
title={post.fields?.title}
thumbnailTime={post.fields?.thumbnailTime || 0}
postId={post.id}
className="aspect-video h-full max-h-[75vh] w-full overflow-hidden"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { revalidateModuleLesson } from '../actions'
import { useModuleProgress } from './module-progress-provider'

export function AuthedVideoPlayer({
title,
muxPlaybackId,
className,
playbackIdLoader,
Expand All @@ -43,6 +44,7 @@ export function AuthedVideoPlayer({
...props
}: {
muxPlaybackId?: string
title?: string
playbackIdLoader: Promise<string | null | undefined>
className?: string
abilityLoader?: Promise<AbilityForResource>
Expand Down Expand Up @@ -184,7 +186,7 @@ export function AuthedVideoPlayer({
<MuxPlayer
metadata={{
video_id: currentResource.id,
video_title: currentResource.fields?.title,
video_title: title || currentResource.fields?.title,
}}
ref={playerRef}
playbackId={playbackId}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ export const LessonMetadataFormFields: React.FC<{
<>
{videoResource && videoResource.state === 'ready' ? (
<div>
<LessonPlayer videoResource={videoResource} />
<LessonPlayer
title={lesson.fields?.title}
videoResource={videoResource}
/>
<Button
variant="ghost"
type="button"
Expand Down
4 changes: 3 additions & 1 deletion apps/ai-hero/src/app/(content)/_components/lesson-player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ export function LessonPlayer({
muxPlaybackId,
className,
videoResource,
title,
}: {
muxPlaybackId?: string
videoResource: VideoResource | null | undefined
className?: string
title?: string
}) {
const playerProps = {
id: 'mux-player',
Expand All @@ -34,7 +36,7 @@ export function LessonPlayer({
<MuxPlayer
metadata={{
video_id: videoResource?.id,
video_title: videoResource?.title,
video_title: title || videoResource?.id,
}}
playbackId={playbackId}
className={cn(className)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ export function PostPlayer({
videoResource,
postId,
thumbnailTime,
title,
}: {
muxPlaybackId?: string
videoResource: VideoResource
className?: string
postId: string
thumbnailTime?: number
title?: string
}) {
// const ability = abilityLoader ? use(abilityLoader) : null
// const canView = ability?.canView
Expand Down Expand Up @@ -124,7 +126,7 @@ export function PostPlayer({
<MuxPlayer
metadata={{
video_id: videoResource?.id,
video_title: videoResource?.title,
video_title: title || videoResource?.id,
}}
playbackId={playbackId}
className={cn(className)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ async function PlayerContainer({
playbackIdLoader={playbackIdLoader}
resource={lesson}
abilityLoader={abilityLoader}
title={lesson.fields?.title}
/>
</Suspense>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ async function PlayerContainer({
abilityLoader={abilityLoader}
moduleSlug={params.module}
moduleType="workshop"
title={lesson.fields?.title}
/>
</Suspense>
</div>
Expand Down

0 comments on commit f2e3d54

Please sign in to comment.