webcompat / web-bugs

A place to report bugs on websites.
https://webcompat.com
Mozilla Public License 2.0
746 stars 67 forks source link

youtube.com - videos don't play #7

Closed simevidas closed 9 years ago

simevidas commented 10 years ago

URL: http://m.youtube.com Browser: Firefox for Android Version: 28 Problem type: Looks like the website has a bug. Site owner: No

Steps to Reproduce None of the videos on YouTube's mobile site plays in Firefox Android. I just see a black screen. I'm forced to switch to Chrome/Opera whenever I want to watch YouTube on my phone :-(

adamopenweb commented 10 years ago

Hmm. I'm not able to reproduce this error on Firefox Android version 29.

simevidas commented 10 years ago

@adamopenweb What? Could it really be just my phone then? I have an Sony Xperia S for over 2 years now and, as far as I remember, I've never been able to play YouTube videos in Firefox. I'll have to ask around to check if there are others with the same issue.

miketaylr commented 10 years ago

Yeah, that's interesting @simevidas. No issues with m.youtube.com here: he man

Do you happen to have adb installed (likely via the Android sdk)? It would be interesting to see the output of adb logcat | grep Gecko when you try to play a video.

simevidas commented 10 years ago

@miketaylr That screenshot is exactly how the YouTube Android app looks on my phone. Are you sure that's still in Firefox? I'm asking because on my phone:

  1. The YouTube Android app is pre-installed and cannot be uninstalled
  2. When clicking "Play" on m.youtube.com in Firefox, the app plays the video, not Firefox's video player
  3. If I disable the app, Firefox tries to play the video in fullscreen, but fails

On the other hand, Chrome always plays the video with its own video player (even if the app is installed).

I don't know. This sounds like a limitation specific to my device. Each device maker customizes the OS, so maybe Sony screwed up. If you don't have other clues, I'd close this issue.

magsout commented 10 years ago
When clicking "Play" on m.youtube.com in Firefox, the app plays the video, not Firefox's video player

@simevidas yes, me too. I have a Google Nexus 7 with the last version of Android 4.4.3.

On the other hand, Chrome always plays the video with its own video player (even if the app is installed)

Same thing.

Maybe reset your installation ? Which version of Android you have ? And Youtube ?

simevidas commented 10 years ago

@magsout Sony Xperia S w/ Android 4.1.2. I've re-installed the YouTube app and even disabled/enabled it and I still get the same behavior. I may try to factory-reset my device once I by a new Android.

magsout commented 10 years ago

@simevidas Actually I'm able to reproduce the bug. If I disabled Youtube App and launch m.youtube.com on Firefox, I have black screen and nothing happened.

Honestly, I don't know if it's a bug or if Firefox need Youtube App to work.

@miketaylr @karlcow , what dou you think about it ?

karlcow commented 10 years ago

@simevidas So I have something similar I think on the GT-i9100 with CyanodgenMod I do not have the youtube app.

  1. Going to youtube
  2. Select a video
  3. Tap

The screen fades away and becomes black. Then nothing happens.

karlcow commented 10 years ago

@magsout puts me on the right track on IRC. Simple question sometimes.

This is the code for the video in m.youtube.com

<div class="_mce" id="koya_elem_14_1">
<a href="#" class="_mdr" onclick="return koya.onEvent(arguments[0]||window.event,'14_2')">
    <div class="_mer" style="background-image:url(http://i.ytimg.com/vi/9Sv29tHv57c/hqdefault.jpg?w=320&amp;h=192&amp;sigh=yFmTJ8chi7FBIyDhq0TdOxy_ZvI);">
        <div id="koya_elem_14_3">
            <div class="_mfr">
                <div class="_mor" id="koya_elem_14_4">
                    <div class="_mpr"></div>
                </div>
            </div>
        </div>
    </div>
</a>
</div>

I can emulate Firefox for Android UA on Desktop and navigate to m.youtube.com. When clicking on a video page, it fails too. The address bar contains

vnd.youtube:9Sv29tHv57c?vndapp=youtube_mobile&vndclient=mv-google&vndel=watch&vnddnc=1

So it's indeed trying to launch an app for YouTube.

karlcow commented 10 years ago

Let's push this a bit further. Now emulating Firefox OS UA, I receive the same markup but when I click, the DOM is populated with a new element:

<video controls="" title="バイトル「AKBスペシャルライブ告知」篇" src="http://r5---sn-uxjoxu-ioql.googlevideo.com/videoplayback?fexp=927625%2C930008%2C931330%2C934030%2C937429%2C938645&amp;mws=yes&amp;signature=3BE3AE5FF1A2E921864EA4C90581D85074AD04CB.B2FEC6D3D9A2398A96C7A4F3C053C158330B5C4B&amp;sparams=id%2Cip%2Cipbits%2Citag%2Cratebypass%2Csource%2Cupn%2Cexpire&amp;ipbits=0&amp;ratebypass=yes&amp;ip=42.145.168.181&amp;key=yt5&amp;dnc=1&amp;ms=au&amp;mv=m&amp;source=youtube&amp;expire=1403618400&amp;sver=3&amp;app=youtube_mobile&amp;itag=36&amp;el=watch&amp;mt=1403595354&amp;upn=_YoMmiSTiik&amp;id=o-APvCH301snl-cc2HldvvAJqAS_rQu7MMbWjecvtCIq1t&amp;yms=hi_JGjhhxlY&amp;cpn=SjLMUj3kj5rf1mBE" class="_mwc _mwd _mxd" id="player_9Sv29tHv57c" poster="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="></video>
magsout commented 10 years ago

Thanks @karlcow for the analysis.

This is not really a bug, it's Android that sniff. But there is not fallback when Youtube App is disabled.

mwargers commented 10 years ago

@karlcow , hey, how do you emulate the Firefox OS UA exactly? When I use Firefox OS Simulator, I still get the vnd.youtube protocol which tries you to send you to the Youtube App.

karlcow commented 10 years ago

@mwargers using something like User Agent Switcher

karlcow commented 10 years ago

Duplicate in https://bugzilla.mozilla.org/show_bug.cgi?id=1073220

mwargers commented 10 years ago

@kalrcow, I did use the User Agent Switcher. That didn't help. The issue is that Youtube somehow can make a difference between FirefoxOS on the desktop and FirefoxOS on the device and I don't know what the cause of that is: https://bugzilla.mozilla.org/show_bug.cgi?id=877594

karlcow commented 9 years ago

@mwargers it's common some libraries will test for example if touch events exist or the viewport (a mobile device will resize the site to the width of the screen, not the desktop).

I wonder if this bug is a duplicate of this one which was fixed already. https://bugzilla.mozilla.org/show_bug.cgi?id=984301

@simevidas do you still have the issue?

simevidas commented 9 years ago

@karlcow I’ve tested on my new Android device (Nexus 7 running Android 4.4.4). By default, YouTube videos are directed to the YouTube app. After disabling the app (twice, i.e. both the updated (downloaded) app and the built-in YouTube app which is part of the Android image), the mobile YouTube site will display a video player and videos play normally.

Side note: When playing a YouTube video in Firefox, I’ve encountered a minor bug with not being able to toggle play/pause correctly when tapping on the video. See here. I guess, YouTube’s JavaScript tap event handlers are not optimized for Firefox’s implementation, which could be part of the reason why YouTube decided to relegate video playback to the app instead.

karlcow commented 9 years ago

@simevidas Thanks a lot! Let's say this one has been fixed.

For the JS, if it's reproducible. Better to open a new bug where we could investigate.