From 3a5ab7be8bc764ec6d834a8d9983fce98e8daf93 Mon Sep 17 00:00:00 2001 From: annie Date: Fri, 28 Jun 2024 17:05:26 -0700 Subject: [PATCH] polish --- README.md | 2 ++ app/page.tsx | 2 +- components/NavBar.tsx | 4 ++++ components/StreamingAvatar.tsx | 12 ++++++------ public/demo.png | Bin 0 -> 1423319 bytes public/favicon.ico | Bin 25931 -> 0 bytes public/next.svg | 1 - public/vercel.svg | 1 - 8 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 public/demo.png delete mode 100644 public/favicon.ico delete mode 100644 public/next.svg delete mode 100644 public/vercel.svg diff --git a/README.md b/README.md index f84a050..23ff29a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # HeyGen Streaming Avatar NextJS Demo +![HeyGen Streaming Avatar NextJS Demo Screenshot](./public/demo.png) + This is a sample project and was bootstrapped using [NextJS](https://nextjs.org/). Feel free to play around with the existing code and please leave any feedback for the SDK [here](https://github.com/HeyGen-Official/StreamingAvatarSDK/discussions). diff --git a/app/page.tsx b/app/page.tsx index c39416a..61a8b8b 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -20,7 +20,7 @@ export default function App() { return (
-
+
{(items) => ( diff --git a/components/NavBar.tsx b/components/NavBar.tsx index 163b7e6..cb1b3ae 100644 --- a/components/NavBar.tsx +++ b/components/NavBar.tsx @@ -26,24 +26,28 @@ export default function NavBar() { Avatars Voices API Docs diff --git a/components/StreamingAvatar.tsx b/components/StreamingAvatar.tsx index aa43a22..c5f6b65 100644 --- a/components/StreamingAvatar.tsx +++ b/components/StreamingAvatar.tsx @@ -83,7 +83,7 @@ export default function StreamingAvatar() { } } - async function start() { + async function startSession() { setIsLoadingSession(true); await updateToken(); if (!avatar.current) { @@ -131,7 +131,7 @@ export default function StreamingAvatar() { setInitialized(true); } - async function stop() { + async function endSession() { if (!initialized || !avatar.current) { setDebug("Avatar API not initialized"); return; @@ -169,7 +169,7 @@ export default function StreamingAvatar() { init(); return () => { - stop(); + endSession(); }; }, []); @@ -251,11 +251,11 @@ export default function StreamingAvatar() {
) : !isLoadingSession ? ( @@ -272,7 +272,7 @@ export default function StreamingAvatar() { />