iframemobileyoutubeembed

Youtube embed live chat is not working on mobile (recently)


I'm working on a web app that depends on YouTube live streams and live chats (also from YouTube). Things went great, when suddently embeded chat refused to work on mobile devices.

I've tried to found a bug or some invalid configuration on my side but I can't find one. As far as I know, iframe with chat is not loading properly when "Mobile" statement is present on User-Agent header.

This is a request that's not called on mobile

This image shows that chat is capable of working fine on mobile

The same window but with "Mobile" header

It's very weird because when I changed the User-Agent header in WebView to Desktop one chat is working flawlessy:

Android WebView with Desktop User-Agent header

It looks like mobile requests are blocked and desktop are not, but I don't know why. I couldn't find any Youtube or Google statement about it.


Solution

  • This seems to have been caused by a user on YouTube picking the username "live_chat" for their channel, which conflicted with YouTube's own chat embed code.

    Having reported the problem to YouTube using their feedback option and including a screenshot of the user's channel, within 24 hours YouTube had fixed the issue!

    Now embedding YouTube's live chat works on Android devices without the need to request the desktop version of the site in Chrome or alter the user-agent in any way!