Closed Bug 1194662 Opened 9 years ago Closed 6 years ago

Videos on www.brightcove.com don't work in Firefox for Android and Firefox OS

Categories

(Web Compatibility :: Site Reports, defect, P1)

ARM
Unspecified
defect

Tracking

(platform-rel -)

RESOLVED FIXED
Tracking Status
platform-rel --- -

People

(Reporter: marco, Assigned: hsteen)

References

()

Details

(Whiteboard: [country-all] [sitewait] [js][platform-rel-Brightcove])

Looks like the Brightcove solution is used by a lot of media websites.

In Chrome the videos on their page play correctly.

In Firefox an error appears when you try to play a video ("This video is either unavailable or not supported in this browser" "Error Code: MEDIA_ERR_SRC_NOT_SUPPORTED" ...)

The error looks similar to the one in bug 1194658.

In Firefox OS there's a different error ("Could not download the video" "Error Code: PLAYER_ERR_TIMEOUT").
See Also: → 1171872
Does this happen in nightly?
CAn you give us a url which shows the problem to test against?
(In reply to Ralph Giles (:rillian) from comment #2)
> CAn you give us a url which shows the problem to test against?

There was a video in the homepage, which is now gone.

I can now reproduce the problem with the second video at https://www.brightcove.com/en/solutions/media, in the section "Why the World's Most Innovative ...".


(In reply to Anthony Jones (:kentuckyfriedtakahe, :k17e) from comment #1)
> Does this happen in nightly?

I've tested with Firefox Beta on Android and a Nightly build of Firefox OS.
Hm... I've tested in Firefox Beta and Firefox Nightly and it seems the video is broken if there is an Android version number in the UA string. 

The amusing thing here is that one of the main reasons for adding an Android version number to the UA string was that a lot of sites using Brightcove's earlier video library version failed to play videos when we didn't have a version number. Now, today.. Brightcove's *new* video library fails if we *do* have an Android version number. Yay, we just can't win, can we?
So, this problem occurs when they try to use a M3U8 src for the VIDEO element, and the code that causes it is this one:

                var a, b = /^application\/(?:x-|vnd\.apple\.)mpegurl/i,
                    c = /^video\/mp4/i;
                vjs.Html5.patchCanPlayType = function() {
                    if (vjs.ANDROID_VERSION >= 4) {
                        if (!a) {
                            a = vjs.TEST_VID.constructor.prototype.canPlayType
                        }
                        vjs.TEST_VID.constructor.prototype.canPlayType = function(c) {
                            if (c && b.test(c)) {
                                return "maybe"
                            }
                            return a.call(this, c)
                        }
                    }

So for certain Android versions they make canPlayType() return "maybe" for M3U8.

As it seems the problem is trying to work around bugs in canPlayType() in some other implementations, it's not straightforward to fix it in a nice way. I think they may want to try to handle the error more gracefully and fall back to trying other formats (come to think of it, why not create a VIDEO element with several SOURCE children right away?). The minimal fix would be to teach the script that the hack is not to be applied in Firefox:

                    if (vjs.ANDROID_VERSION >= 4 && !vjs.IS_FIREFOX) {

(But then you might of course get the same problems in other non-Firefox non-M3U8 supporting browsers).
Whiteboard: [country-all] [sitewait] [js]
Version: 41 Branch → Trunk
(In reply to Hallvord R. M. Steen [:hallvors] from comment #5)
> As it seems the problem is trying to work around bugs in canPlayType() in
> some other implementations, it's not straightforward to fix it in a nice
> way.

The best solution would be to catch the error we fire and fall back. Do you have any contacts in Brightcove?
We have contacts but so far we haven't actually gotten anyone to change anything.
(In reply to Hallvord R. M. Steen [:hallvors] from comment #7)
> We have contacts but so far we haven't actually gotten anyone to change
> anything.

Has any progress been made? Do we need to nag the right person in Brightcove?
Basically, this is only a problem in their old version. They don't want to maintain that version (even though the libs are usually loaded from their CDN), they would rather have their customers upgrade to the new one. From what I've seen the uptake is a bit slow..
Oops, sorry. I'm confusing myself. This bug is about the problem affecting the *new* version.. I'll dig up my contacts.
I've verified that we still have this problem - it also happens on https://brightcove.com/en/perform - and contacted Brightcove again. If we don't get through to the right person this time let's see if we have better contacts..
Priority: -- → P1
Component: Audio/Video → Mobile
Product: Firefox for Android → Tech Evangelism
Assignee: nobody → hsteen
If we can solve this via a UA override (which requires having a stable domain for the player), I think we probably should.

Hallvord, do we know which domains the new and old players are served from?
Flags: needinfo?(hsteen)
While the JS is typically served from the same server (players.brightcove.net), the videos and other content might come from anywhere. It's not useful to spoof the CDN the scripts come from, but if we come across this on a higher profile site we should probably spoof.
Flags: needinfo?(hsteen)
FTR I have the same issue on FF on a Galaxy Note 5, fully updated, at SMH.com.au and none of the videos play there though occasionally I do get sound, but the error message sits on ablack background.
(In reply to DS from comment #14)
> FTR I have the same issue on FF on a Galaxy Note 5, fully updated, at
> SMH.com.au and none of the videos play there though occasionally I do get
> sound, but the error message sits on ablack background.

Also on theage.com.au (which is the same company as smh.com.au) - according to Alexa these are the 55th and 30th top sites in Australia respectively, and 19th and 10th of .au addresses in that list - so these are certainly high-profile sites in this part of the world. Best I can tell these sites also use brightplayer - the video tag says:

<video ... data-fm-brightcove-player="videoOptions: ...}> and best I can tell the video loads from https://edge.api.brightcove.com/playback/v1/accounts/3910869709001/videos/ref:7379649
platform-rel: --- → ?
Whiteboard: [country-all] [sitewait] [js] → [country-all] [sitewait] [js][platform-rel-Brightcove]
(In reply to Hallvord R. M. Steen [:hallvors] from comment #5)
> As it seems the problem is trying to work around bugs in canPlayType() in
> some other implementations, it's not straightforward to fix it in a nice
> way. I think they may want to try to handle the error more gracefully and
> fall back to trying other formats (come to think of it, why not create a
> VIDEO element with several SOURCE children right away?). The minimal fix
> would be to teach the script that the hack is not to be applied in Firefox:
> 
>                     if (vjs.ANDROID_VERSION >= 4 && !vjs.IS_FIREFOX) {
> 
> (But then you might of course get the same problems in other non-Firefox
> non-M3U8 supporting browsers).

Can you do me a favour and submit a pull request to video.js ?

https://github.com/videojs/video.js
Flags: needinfo?(geckobugs)
Flags: needinfo?(geckobugs)
I've created a new pull request (https://github.com/videojs/video.js/pull/3586) based off of Anthony's one with some test fixes (they couldn't merge Anthony one otherwise).
platform-rel: ? → +
http://www.dailypress.com/tidewater-review/news/91765720-132.html

Black screen in Firefox 49.0.2

Fine in Chrome 54.0.2840.71 m

Do I need an extension/plugin ?

Thanks !
(In reply to murrayww from comment #20)
> http://www.dailypress.com/tidewater-review/news/91765720-132.html
> 
> Black screen in Firefox 49.0.2
> 
> Fine in Chrome 54.0.2840.71 m
> 
> Do I need an extension/plugin ?
> 
> Thanks !

They're probably still using the old version of the Brightcove Player.
When they switch to the new version or if/when we ship HLS support, videos should work in Firefox too.
The following URL: http://www.dailypress.com/tidewater-review/news/91765720-132.html — is re-producible on desktop (together with :k17e) on a MacBook 12" Nightly 53.0a1
The upstream player is fixed. It will take some time for sites to update their players.
platform-rel: + → -
Marking this issue as Resolved - Fixed.

We cannot reproduce the issue anymore on Google Pixel, Android 8.1.0 and Nightly 62.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Product: Tech Evangelism → Web Compatibility
Component: Mobile → Site Reports
You need to log in before you can comment on or make changes to this bug.