-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73bbc44
commit 9858df5
Showing
8 changed files
with
205 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import '@vidstack/react/player/styles/default/theme.css'; | ||
import '@vidstack/react/player/styles/default/layouts/audio.css'; | ||
import '@vidstack/react/player/styles/default/layouts/video.css'; | ||
|
||
import Chat from '../../../components/Chat'; | ||
import LiveVideoPlayer from '../../../components/LiveVideoPlayer'; | ||
|
||
export default function LiveStreamPage() { | ||
return ( | ||
<> | ||
<div className="flex w-full h-screen"> | ||
<LiveVideoPlayer | ||
src={ | ||
'https://stream.mux.com/v69RSHhFelSm4701snP22dYz2jICy4E4FUyk02rW4gxRM.m3u8' | ||
} | ||
poster={ | ||
'https://image.mux.com/v69RSHhFelSm4701snP22dYz2jICy4E4FUyk02rW4gxRM/thumbnail.webp?time=30' | ||
} | ||
/> | ||
<Chat /> | ||
</div> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,11 @@ | ||
import Navbar from '../components/Navbar'; | ||
import VideosList from '../components/VideosList'; | ||
import getUsers from '../../utils/API/getUsers'; | ||
import { User } from '@clerk/nextjs/server'; | ||
|
||
export default async function Page() { | ||
const users = await getUsers(); | ||
return ( | ||
<> | ||
<Navbar /> | ||
<VideosList /> | ||
<ol> | ||
{users.data && users.data.map((user: User) => ( | ||
<li key={user.id}>{user?.username}</li> | ||
))} | ||
</ol> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
import { Button } from '@org/shared'; | ||
import { Textarea } from '@org/shared'; | ||
import { SendIcon } from 'lucide-react'; | ||
|
||
export default function Chat() { | ||
return( | ||
<div className="bg-background border-l flex flex-col w-[400px]"> | ||
<div className="border-b px-4 py-3 text-lg font-medium">Live Chat</div> | ||
<div className="flex-1 overflow-auto p-4 space-y-4"> | ||
<div className="flex items-start gap-3"> | ||
<div className="rounded-full bg-primary text-primary-foreground w-8 h-8 flex items-center justify-center text-sm font-medium"> | ||
JD | ||
</div> | ||
<div> | ||
<div className="font-medium">John Doe</div> | ||
<div className="text-muted-foreground text-sm"> | ||
Hey, this is looking great! | ||
</div> | ||
</div> | ||
</div> | ||
<div className="flex items-start gap-3"> | ||
<div className="rounded-full bg-secondary text-secondary-foreground w-8 h-8 flex items-center justify-center text-sm font-medium"> | ||
SA | ||
</div> | ||
<div> | ||
<div className="font-medium">Sarah Adams</div> | ||
<div className="text-muted-foreground text-sm"> | ||
Wow, the video quality is amazing! | ||
</div> | ||
</div> | ||
</div> | ||
<div className="flex items-start gap-3"> | ||
<div className="rounded-full bg-accent text-accent-foreground w-8 h-8 flex items-center justify-center text-sm font-medium"> | ||
MJ | ||
</div> | ||
<div> | ||
<div className="font-medium">Michael Johnson</div> | ||
<div className="text-muted-foreground text-sm"> | ||
Can not wait to see more of this! | ||
</div> | ||
</div> | ||
</div> | ||
<div className="flex items-start gap-3"> | ||
<div className="rounded-full bg-muted text-muted-foreground w-8 h-8 flex items-center justify-center text-sm font-medium"> | ||
EM | ||
</div> | ||
<div> | ||
<div className="font-medium">Emily Miller</div> | ||
<div className="text-muted-foreground text-sm"> | ||
This is so cool, I am loving it! | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="border-t p-4"> | ||
<div className="relative"> | ||
<Textarea | ||
placeholder="Type your message..." | ||
className="pr-12 rounded-md" | ||
/> | ||
<Button | ||
type="submit" | ||
size="icon" | ||
className="absolute top-1/2 right-2 -translate-y-1/2" | ||
> | ||
<SendIcon className="w-5 h-5" /> | ||
</Button> | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { MediaPlayer, MediaProvider, PlayerSrc, Poster } from '@vidstack/react'; | ||
import { | ||
DefaultVideoLayout, | ||
defaultLayoutIcons, | ||
} from '@vidstack/react/player/layouts/default'; | ||
|
||
interface VideoPlayerProps { | ||
src: PlayerSrc; | ||
poster: string; | ||
} | ||
|
||
export default function LiveVideoPlayer({ src, poster }: VideoPlayerProps) { | ||
return ( | ||
<div className="w-full h-full" style={{ maxWidth: '80%' }}> | ||
<MediaPlayer | ||
src="https://stream.mux.com/v69RSHhFelSm4701snP22dYz2jICy4E4FUyk02rW4gxRM.m3u8" | ||
poster="https://image.mux.com/v69RSHhFelSm4701snP22dYz2jICy4E4FUyk02rW4gxRM/thumbnail.webp?time=30" | ||
viewType="video" | ||
streamType="live" | ||
className="h-full" | ||
logLevel="warn" | ||
crossOrigin | ||
playsInline | ||
> | ||
<MediaProvider> | ||
<Poster className="vds-poster" /> | ||
</MediaProvider> | ||
<DefaultVideoLayout icons={defaultLayoutIcons} /> | ||
</MediaPlayer> | ||
</div> | ||
); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as React from "react" | ||
|
||
import { cn } from "@org/shared/lib/utils" | ||
|
||
export interface TextareaProps | ||
extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {} | ||
|
||
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>( | ||
({ className, ...props }, ref) => { | ||
return ( | ||
<textarea | ||
className={cn( | ||
"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50", | ||
className | ||
)} | ||
ref={ref} | ||
{...props} | ||
/> | ||
) | ||
} | ||
) | ||
Textarea.displayName = "Textarea" | ||
|
||
export { Textarea } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
// Use this file to export React client components (e.g. those with 'use client' directive) or other non-server utilities | ||
|
||
export * from './components/ui/button'; | ||
export * from './components/ui/avatar' | ||
export * from './components/ui/avatar'; | ||
export * from './components/ui/textarea'; |