Closed Bug 1273725 Opened 8 years ago Closed 8 years ago

When you try to play video in Firefox for android, it shows NO video with supported format and MIME type found

Categories

(Core :: Audio/Video: Playback, defect, P3)

46 Branch
Unspecified
Android
defect

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
platform-rel --- ?
firefox50 --- fixed

People

(Reporter: siddharthshah012, Assigned: cpearce)

References

Details

(Whiteboard: [platform-rel-Google] [platform-rel-Youtube])

Attachments

(3 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36

Steps to reproduce:

Open FireFox browser in android 6.0 Marshmallow, Then play a video on youtube.com


Actual results:

 It shows it initially shows "NO video with supported format and MIME type found."


Expected results:

Video should directly play.
OS: Unspecified → Android
Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core
(In reply to Anthony Jones (:kentuckyfriedtakahe, :k17e) from comment #1)
> Please provide a URL.

Richard - this is an issue on YouTube where it shows this message but the video still plays.
I play the same link[1] as comment 0 with Firefox 46.0.1 on my HTC M9+(Android 5.02) and Nexus6 (Android 6.0.1).
They both can play the link[1] well.  

[1]https://m.youtube.com/watch?v=GU9tzrpvQi4
Hi Kevin,
I cannot repro it, could you help try to repro this bug?
Thanks.
Flags: needinfo?(kbrosnan)
This happens all the time. It might be a YT bug.
Flags: needinfo?(kbrosnan)
Can someone help me in how to proceed forward and help in resolving this bug ?
We are still in the process of diagnosing this bug. There is not any solution at this time. It is mostly a cosmetic issue as the video will decode after briefly showing the "No video with supported format and MIME type found." message. It would be good for Firefox for Android users not to see the message.
Mass change P2 -> P3
Priority: P2 → P3
platform-rel: --- → ?
Whiteboard: [platform-rel-Google] [platform-rel-Youtube]
What's happening is YouTube is calling load() when there's no resource that can be loaded, and so our controls are trying to be helpful and notify developers that they're loading a video but it's not going to work because there's nothing to load.

I think YouTube should just not call load() when they've got no resource to load. The load algorithm should be invoked when they set the src attribute. They should rely on that.

Additionally, we only see this error some of the time because this is hitting a race between our code and the Resource Selection Algorithm and setupInitialState() in videocontrols.xml.

So ideally we should fix the race somehow, so that we consistently always (or consistently never!) see the failure message when script tries to load without a resource to load.

The Resource Fetch Algorithm sets the networkState to NETWORK_NO_SOURCE, and then continues in a synchronous section where it will reset the networkState to NETWORK_EMPTY if there's no resource. Our video controls setup code (setupInitialState()) seems to normally run after the synchronous section has finished, and so sees networkState==NETWORK_EMPTY and the controls can't tell that the load stopped because there's no resource to load.

But if something happens that spins the event loop (I think), setupInitalState() runs before the synchronous section of the Resource Selection Algorithm has reset the networkState, and so setupInitalState() sees networkState==NETWORK_NO_SOURCE (when setupInitalState() calls hasError()), and shows the error message.

I think it makes sense for Firefox to show an error message when the load failed due to there being no specified resource to load. But again, the spec is basically requiring this time period where networkState==NETWORK_NO_SOURCE and is then reset to networkState==NETWORK_EMPTY, which makes it hard to detect this case.

Potentially, we could propose changing the spec to fail or not proceed with the load if there's no resource before entering synchronous section. Then we'd avoid this time-window where the observable state on the media element isn't reliable.
+                hasSources : function() {
+                    if (this.video.hasAttribute('src')) {
+                        return true;
+                    }
+                    for (var child = this.video.firstChild;
+                         child !== null;
+                         child = child.nextElementSibling) {
+                        if (child instanceof HTMLSourceElement) {
+                            return true;
+                        }
+                    }
+                    return false;

Can you add a check that it not only has the attribute but that the attribute value is not empty?
Assignee: nobody → cpearce
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
We're flashing a warning message  "NO video with supported format and MIME type
found." when we're loading a YouTube page in Fennec. This is because YouTube
are calling load() on a video element with no src attribute or source children
in a click handler in order to defeat the "requires user interaction to play"
restrictions on mobile Chrome and Safari in that video element.

We're showing the warning message to help developers diagnose why loads are
unintentionally failing. However, the behaviour that YouTube are doing is
intentional, and YouTube are likely to not be the only ones doing this. So we
should change our video controls to not display the warning message in this
case. We should be compatible with other browsers.

We'll still log a debug message to the browser console as to why the load
is failing, to help developers who hit this unintentionally.

Review commit: https://reviewboard.mozilla.org/r/63766/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/63766/
Attachment #8770290 - Flags: review?(jaws)
Comment on attachment 8770290 [details]
Bug 1273725 - Don't show 'No supported source' message in video controls if there's no sources.

Cancelling review; I'd not seen the comment above on my try push before pushing to review.
Attachment #8770290 - Flags: review?(jaws)
Comment on attachment 8770290 [details]
Bug 1273725 - Don't show 'No supported source' message in video controls if there's no sources.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/63766/diff/1-2/
Attachment #8770290 - Flags: review?(jaws)
Comment on attachment 8770290 [details]
Bug 1273725 - Don't show 'No supported source' message in video controls if there's no sources.

https://reviewboard.mozilla.org/r/63766/#review60826
Attachment #8770290 - Flags: review?(jaws) → review+
Pushed by cpearce@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/afb94913764c
Don't show 'No supported source' message in video controls if there's no sources. r=jaws
https://hg.mozilla.org/mozilla-central/rev/afb94913764c
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: