Closed JayGreentree closed 1 year ago
Can you give me the Twig code you're using to render both the YouTube video, and also the chat please?
Also in local dev with devMode
on, you should be getting a full stack trace of the error... that would be helpful in diagnosing this as well.
Can you give me the Twig code you're using to render both the YouTube video, and also the chat please?
` {% if craft.youtubelive.isLive() %} {{ craft.youtubelive.embedStream() }} {% else %}
{% endif %}`
` {% if craft.youtubelive.isLive() %} {{ craft.youtubelive.embedStream() }} {% else %}
{% endif %}`
When the page is rendered this is what the iframe shows:
<div class="youtube-chat-resp-container"><iframe class="youtube-chat-resp-iframe" src="&embed_domain=localhost" allow="autoplay; fullscreen; encrypted-media"></iframe></div>
Also in local dev with
devMode
on, you should be getting a full stack trace of the error... that would be helpful in diagnosing this as well.
I copied the craft.youtubelive.embedChat() to a blank twig template:
craft 3 works as expected if that makes any difference. I did try to look at the plugin but I'm not a php "expert". Nothing really stuck out as being an obvious issue.
https://github.com/JayGreentree/craft4-dev-live has my current local install if that would help.
Here's what it renders the chat:
https://github.com/nystudio107/craft-youtubeliveembed/blob/develop/src/services/Embed.php#L87
This calls getYoutubeChatUrl
which returns an empty string (which is what you're seeing):
...if getVideoIdFromLiveStream
doesn't return an id.
But the code looks the same on Craft 3 vs. Craft 4 -- are you sure the data being fed into it is the same? Did you configure it via the config/youtubeliveembed.php
file?
I'll try that when Im able I have very limited internet currently. I didnt have the config file in v3 i used the ui admin/settings/plugins/youtubeliveembed.
I did clean dev installs of v3 and v4 using the config file and same result. Video works on both but chat is not working on craft v4 and other then the 404 error I see nothing related to the plugin in the logs except that its in memory. If it helps I've added my v4 logs console-2022-08-23.zip
Okay so I think the problem here was just that the plugin settings were no longer visible in the Craft 4 version.
I've updated both:
v3 -> https://github.com/nystudio107/craft-youtubeliveembed/releases/tag/1.0.9
v4 -> https://github.com/nystudio107/craft-youtubeliveembed/releases/tag/4.0.0
Please update, and then ensure your YouTube Channel ID is set properly in the plugin settings. This should resolve the issue for you.
Describe the bug
When installed on craft 4.x I get video but the chat gives crafts' 404 template not found error. Instead of the iframe giving the Youtube chat embed url it is only showing "&embed_domain=example.com" (tested locally and in production)
Screenshots
Versions