Open mateuszwszola opened 2 months ago
You. Are. The. MAN!!!
I'd been banging my head against the wall trying to get the mic input to work and this solved it. The HeyGen folks should take note of this as I believe the issue is likely causing downstream pain for a lot of others. Big thanks for sharing 🙏.
Thanks for this! been looking for a solution for a while now
Hey everyone!
I wanted to share a solution to an issue I've been wrestling with for a while. If you're using the
@heygen/streaming-avatar
with Next.js (v14) in production, this might save you some headaches!The Problem I've encountered: In the deployed version of the application, the avatar wasn't loading because the URL for
streaming.proto
was getting messed up. Instead ofhttps://static.heygen.ai/static/streaming.proto
, it was trying to load it fromhttps://my-app-name.app/static.heygen.ai/static/streaming.proto
.The Fix: I solved it with a simple Next.js middleware. Here's the code:
This middleware intercepts requests starting with
/static.heygen.ai/
and redirects them to the correct external URL, solving the misformatted URL issue.Hope this helps someone out there! Let me know if it works for you, and if you have any feedback.
Happy coding! 🚀