Reputation: 1237
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.
Upvotes: 3
Views: 5583
Reputation: 26
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!
Upvotes: 1
Reputation: 1237
I believe that the only way of fixing it is to change mentioned earlier "User-Agent" header in HTTP request to a desktop one, like:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36
Maybe the issue will be fixed from the YouTube side someday.
Upvotes: 2