Last Comment Bug 794100 - (brightcove) h264 video player (Brightcove) is busted on non-flash enabled FF Android or FF OS
(brightcove)
: h264 video player (Brightcove) is busted on non-flash enabled FF Android or F...
Status: RESOLVED FIXED
[clientsniff][country-all][sitewait][...
:
Product: Tech Evangelism
Classification: Other
Component: Mobile (show other bugs)
: unspecified
: ARM Android
: -- normal with 1 vote (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
http://support.brightcove.com/en/docs...
: 637873 737715 868048 (view as bug list)
Depends on: 794171
Blocks: 935946 941610 965124 973528 737707 868048 936454 970852
  Show dependency treegraph
 
Reported: 2012-09-25 08:20 PDT by Jason Smith [:jsmith]
Modified: 2015-05-14 14:36 PDT (History)
16 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
unaffected
fixed
fixed
fixed


Attachments
Wired Video (180.77 KB, image/png)
2012-09-25 09:20 PDT, Jason Smith [:jsmith]
no flags Details

Description Jason Smith [:jsmith] 2012-09-25 08:20:37 PDT
Upon doing testing on wired.com via playing videos in the video player, we discovered that sites making use of the BrightCove video player result in FF Android user agents getting served flash content, not h264 content. We need to outreach to BrightCove to get them to serve us HTML 5 video content instead of flash content.
Comment 1 Aaron Train [:aaronmt] 2012-09-25 08:43:07 PDT
Are you sure? On Wired Video, while I get a broken player, I see the following configuration served (no Flash plugin) to my Galaxy Nexus (4.1.1)

           var experienceJSON = {
               "success": true,
               "data": {
                   "adPolicy": {
                       "adPlayCap": 1,
                       "firstAdPlay": 1,
                       "id": null,
                       "midrollAdKeys": null,
                       "midrollAds": false,
                       "onLoadAdKeys": "kw=player",
                       "playAdOnLoad": false,
                       "playerAdKeys": ";kw=html5;kw=library;kw=preroll",
                       "postrollAdKeys": ";kw=postroll;kw=postroll",
                       "postrollAds": true,
                       "prerollAdKeys": ";kw=preroll;kw=html5;kw=library",
                       "prerollAds": true,
                       "timeAdPlayInterval": 180,
                       "timeBasedPolicy": false,
                       "titleAdPlayInterval": 1,
                       "titleBasedPolicy": true,
                       "version": null,
                       "zone": 0
                   },
                   "adPolicySWF": null,
                   "adServerURL": "http:\/\/ad.doubleclick.net\/pfadx\/wired.video.bc\/",
                   "adTranslationSWF": null,
                   "analyticsTrackers": ["TR-JSL-E17", "TR-JEP-23S"],
                   "configuredProperties": {
                       "application": {
                           "featureSwitches": "010111111",
                           "enableAPI": "true",
                           "theme": "Minimal",
                           "backgroundImage": "http:\/\/brightcove.condenet.com\/images\/1564549380\/1564549380_1753222175_wiredBG.jpg?pubId=1564549380",
                           "html5Enabled": "true"
                       },
                       "plugins": {
                           "list": "http:\/\/cdn.visiblemeasures.com\/swf\/as3\/v4.9.9\/utility.swf?vmKey=5759ccaef9c011e08b400019b9f1584b&pixel=1"
                       },
                       "videoPlayer": {
                           "removeBranding": "true",
                           "autoStart": "true",
                           "showNewest": "false",
                           "showMostViewed": "false",
                           "showRelated": "false"
                       }
                   },
                   "hasProgramming": false,
                   "id": 1716442119,
                   "isDefaultViralTemplate": false,
                   "layout": "<Runtime><Theme name='Deluxe' style='Light'\/><Layout><VBox padding='3'><VideoPlayer id='videoPlayer'\/><\/VBox><\/Layout><\/Runtime>",
                   "linkBaseURL": "http:\/\/www.wired.com\/video?bcpid=1716442119&bckey=AQ~~,AAAAAF1BIQQ~,g5cZB_aGkYYrkroPj2mIhYaMgpst9vO7",
                   "linkURL": null,
                   "name": "Portal Player",
                   "nextGenAnalyticsEnabled": false,
                   "playerKey": "AQ~~,AAAAAF1BIQQ~,g5cZB_aGkYYrkroPj2mIhYaMgpst9vO7",
                   "programmedContent": {
                       "videoPlayer": {
                           "cause": -1,
                           "componentRefId": "videoPlayer",
                           "id": null,
                           "mediaDTO": {
                               "FLVFullCodec": 3,
                               "FLVFullLengthStreamed": false,
                               "FLVFullLengthURL": "http:\/\/brightcove.condenet.com\/streams\/1564549380\/1564549380_1858882423001_-PV--------VS------TGS2012-Ver--.mp4",
                               "FLVFullSize": 13780332,
                               "FLVPreBumperControllerType": 0,
                               "FLVPreBumperStreamed": false,
                               "FLVPreBumperURL": null,
                               "FLVPreviewCodec": 0,
                               "FLVPreviewSize": 0,
                               "FLVPreviewStreamed": false,
                               "FLVPreviewURL": null,
                               "IOSRenditions": [],
                               "SWFVerificationRequired": false,
                               "WMVFullAssetId": null,
                               "WMVFullLengthURL": null,
                               "adCategories": null,
                               "adKeys": null,
                               "allowViralSyndication": true,
                               "allowedCountries": [],
                               "awards": null,
                               "captions": null,
                               "categories": [],
                               "color": null,
                               "controllerType": 9,
                               "creationDate": "1348508833113",
                               "cuePoints": null,
                               "customFieldValues": null,
                               "customFields": null,
                               "dateFiltered": false,
                               "displayName": "Professor Layton, Phoenix Wright Team For Ultimate Sleuthing Game",
                               "drmMetadataURL": null,
                               "economics": 1,
                               "encodingRate": 499155,
                               "endDate": null,
                               "excludeListedCountries": false,
                               "filterEndDate": null,
                               "filterStartDate": null,
                               "forceAds": false,
                               "geoRestricted": false,
                               "id": 1858846870001,
                               "isSubmitted": false,
                               "language": null,
                               "length": 219104,
                               "lineupId": null,
                               "linkText": null,
                               "linkURL": null,
                               "logoOverlay": null,
                               "longDescription": null,
                               "monthlyAmount": null,
                               "numberOfPlays": 0,
                               "previewLength": 0,
                               "publishedDate": "1348508833113",
                               "publisherId": 1564549380,
                               "publisherName": "Conde Net - Wired",
                               "purchaseAmount": null,
                               "ratingEnum": null,
                               "referenceId": null,
                               "renditions": [{
                                   "audioOnly": false,
                                   "defaultURL": "http:\/\/brightcove.condenet.com\/streams\/1564549380\/1564549380_1858895118001_-PV--------VS------TGS2012-Ver--.mp4",
                                   "encodingRate": 1799282,
                                   "frameHeight": 720,
                                   "frameWidth": 1280,
                                   "mediaDeliveryType": 1,
                                   "size": 48894156,
                                   "videoCodec": "H264",
                                   "videoContainer": 1
                               }, {
                                   "audioOnly": false,
                                   "defaultURL": "http:\/\/brightcove.condenet.com\/streams\/1564549380\/1564549380_1858880726001_-PV--------VS------TGS2012-Ver--.mp4",
                                   "encodingRate": 141032,
                                   "frameHeight": 224,
                                   "frameWidth": 400,
                                   "mediaDeliveryType": 1,
                                   "size": 3952487,
                                   "videoCodec": "H264",
                                   "videoContainer": 1
                               }, {
                                   "audioOnly": false,
                                   "defaultURL": "http:\/\/brightcove.condenet.com\/streams\/1564549380\/1564549380_1858880737001_-PV--------VS------TGS2012-Ver--.mp4",
                                   "encodingRate": 1199282,
                                   "frameHeight": 404,
                                   "frameWidth": 720,
                                   "mediaDeliveryType": 1,
                                   "size": 32379105,
                                   "videoCodec": "H264",
                                   "videoContainer": 1
                               }, {
                                   "audioOnly": false,
                                   "defaultURL": "http:\/\/brightcove.condenet.com\/streams\/1564549380\/1564549380_1858880028001_-PV--------VS------TGS2012-Ver--.mp4",
                                   "encodingRate": 800000,
                                   "frameHeight": 360,
                                   "frameWidth": 640,
                                   "mediaDeliveryType": 1,
                                   "size": 21693978,
                                   "videoCodec": "H264",
                                   "videoContainer": 1
                               }, {
                                   "audioOnly": false,
                                   "defaultURL": "http:\/\/brightcove.condenet.com\/streams\/1564549380\/1564549380_1858882423001_-PV--------VS------TGS2012-Ver--.mp4",
                                   "encodingRate": 499155,
                                   "frameHeight": 268,
                                   "frameWidth": 480,
                                   "mediaDeliveryType": 1,
                                   "size": 13780332,
                                   "videoCodec": "H264",
                                   "videoContainer": 1
                               }, {
                                   "audioOnly": false,
                                   "defaultURL": "http:\/\/brightcove.condenet.com\/streams\/1564549380\/1564549380_1858894587001_-PV--------VS------TGS2012-Ver--.mp4",
                                   "encodingRate": 318213,
                                   "frameHeight": 224,
                                   "frameWidth": 400,
                                   "mediaDeliveryType": 1,
                                   "size": 8892254,
                                   "videoCodec": "H264",
                                   "videoContainer": 1
                               }],
                               "rentalAmount": null,
                               "rentalPeriod": null,
                               "sharedBy": null,
                               "sharedByExternalAcct": false,
                               "sharedSourceId": null,
                               "sharedToExternalAcct": false,
                               "shortDescription": "Japan's popular portable detectives team up for their first ever crossover game, 'Professor Layton vs Phoenix Wright', coming November 29 for the Nintendo 3DS in Japan.",
                               "startDate": null,
                               "submitted": false,
                               "tags": [{
                                   "image": null,
                                   "name": "game trailers"
                               }, {
                                   "image": null,
                                   "name": "wired"
                               }, {
                                   "image": null,
                                   "name": "Library"
                               }, {
                                   "image": null,
                                   "name": "gaming"
                               }, {
                                   "image": null,
                                   "name": "3ds"
                               }, {
                                   "image": null,
                                   "name": "nintendo"
                               }],
                               "thumbnailURL": "http:\/\/brightcove.condenet.com\/images\/1564549380\/1564549380_1858882427001_th-50609ca1ef18b0e4e0102e57-1592194039001.jpg?pubId=1564549380",
                               "version": null,
                               "videoStillURL": "http:\/\/brightcove.condenet.com\/images\/1564549380\/1564549380_1858882426001_vs-50609ca1ef18b0e4e0102e57-1592194039001.jpg?pubId=1564549380",
                               "yearProduced": null
                           },
                           "mediaId": 1858846870001,
                           "playerId": null,
                           "type": 0,
                           "version": null
                       }
                   },
                   "programmingComponents": ["videoPlayer"],
                   "publisherId": 1564549380,
                   "publisherType": "PREMIUM",
                   "userCountry": null,
                   "version": null
               }
           };

The important bits are the objects in the renditions array, I see MP4 files.
Comment 2 Jason Smith [:jsmith] 2012-09-25 09:18:34 PDT
Yeah, I can confirm on my galaxy nexus (Android 4.04) that I'm getting served flash content instead with Nightly.
Comment 3 Jason Smith [:jsmith] 2012-09-25 09:20:15 PDT
Created attachment 664538 [details]
Wired Video

This is what I'm seeing.
Comment 4 Aaron Train [:aaronmt] 2012-09-25 10:51:40 PDT
Two seperate issues here, shall we morph this to investigating why their player is broken for us?

BrightCove test player: http://support.brightcove.com/en/docs/video-test-html-5
Comment 5 Jason Smith [:jsmith] 2012-09-25 10:59:02 PDT
(In reply to Aaron Train [:aaronmt] from comment #4)
> Two seperate issues here, shall we morph this to investigating why their
> player is broken for us?
> 
> BrightCove test player:
> http://support.brightcove.com/en/docs/video-test-html-5

Sure.
Comment 6 Chris Peterson [:cpeterson] 2012-09-25 13:31:27 PDT
Does the Brightcove problem affect both Nightly 18 and Aurora 17? When I was recently investigating a HTML5 video bug with Flash disabled, some sites served me different video content on Aurora 17 and Nightly 18.
Comment 7 thomas elin 2012-10-03 18:09:39 PDT
Hello Folks

I haven't seen an update in a few days. It would be great to get a resolution on this as Wired is a priority partner for the Marketplace.

Additionally, Marketing is looking to speak about the wired.com app in an upcoming campaign. The deadline for Wired.com to be working and included is tomorrow.

Please let me know if there is anything I can do to raise priority on this.

Cheers
Thomas
Comment 8 Lisa Brewster [:adora] 2012-10-04 13:58:49 PDT
Actually, we don't need the fix for Wired until the 9th.  If we could at least get an answer today on if that target is possible, that would be super!
Comment 9 Chris Peterson [:cpeterson] 2012-10-04 14:38:39 PDT
Is the issue that Brightcove is serving us Flash video instead of HTML5 video? That is likely something Brightcove will need to fix in their video player.

Wired serves me Flash video, but it will serve me HTML5 H264 if I use the "Phony" add-on to spoof a WebKit User-Agent string.

http://www.wired.com/video/latest-videos/latest/1815816633/observation-deck-designing-cities-for-people-not-cars/1865061231001
Comment 10 Aaron Train [:aaronmt] 2012-10-04 15:04:17 PDT
My impression is that they are not recognizing us for compatibility. For example, on Nightly, the test-page below fails.

Test-page: http://admin.brightcove.com/html5support/index.html

On their player test-page below, on my Nexus 7, I get a broken player.

Player test-page: http://support.brightcove.com/en/docs/video-test-html-5
Comment 11 thomas elin 2012-10-10 14:26:29 PDT
Should we be providing instructions to wired.com on how to recognize us for compatibility?

If so, what needs to be changed on their end?
Comment 12 Chris Peterson [:cpeterson] 2012-10-10 18:33:16 PDT
This bug should be fixed by my patch for bug 794171.

If Brightcove or Wired _really_ want to workaround our bug in the meantime, they could change their H.264 detection script to check:

  video.canPlayType('video/mp4; codecs="avc"')

in * to:

  video.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')

However, I do not recommend this because the codecs="avc" format is technically invalid and bug 794171 should fix our bug before Firefox 17 leaves beta.
Comment 13 Chris Peterson [:cpeterson] 2012-10-10 18:35:33 PDT
^ that should read "in addition to:"
Comment 14 Chris Peterson [:cpeterson] 2012-10-12 13:53:45 PDT
I fixed bug 794171, so this Brightcove bug should be fixed in the next builds of Nightly 19, Aurora 18, and Beta 17.
Comment 15 Lisa Brewster [:adora] 2012-10-16 15:17:00 PDT
Retested the Wired app in Aurora, and now videos don't play at all.  Screenshot:  http://adora.io/screens/wired-20121016-151632.jpg

It also seems that pages are taking WAY longer to load, leaving the user staring at a white screen for approx 10 seconds.  I'm not seeing this happen in other apps, so perhaps it's a server load issue, but noting it here just in case.
Comment 16 Chris Peterson [:cpeterson] 2012-10-16 16:21:04 PDT
doublec, can you please take a look at this bug? My change in bug 794171 fixed Brightcove's compatibility test page, but did not fix Brightcove's video player test or Wired.com's videos.

 * Compatibility test: http://admin.brightcove.com/html5support/index.html
 * Player test: http://support.brightcove.com/en/docs/video-test-html-5
Comment 17 Chris Pearce (:cpearce) 2012-10-30 14:09:00 PDT
I've been looking into this, and I'm pretty sure this is a problem in Brightcove's player.

I can reproduce the inability to play H.264 in a GStreamer build of Firefox desktop with the user agent set to masquerade as Fennec/Android. However I can play the video with Firefox w/GStreamer if I load the video directly (url:
http://uds.ak.o.brightcove.com/57838016001/57838016001_734484850001_Sea-SplashingWater.mp4 ).

The furthest I've been able to minimize the test case is getting it down to this:

http://c.brightcove.com/services/viewer/htmlFederated?&width=480&height=270&flashID=myExperience734462567001&bgcolor=%23FFFFFF&playerID=620280460001&playerKey=AQ~~%2CAAAADXdqFgE~%2CaEKmio9UXagAaBS7fBojcPoHLrsCEka3&isVid=true&isUI=true&dynamicStreaming=true&%40videoPlayer=734462567001&autoStart=&debuggerID=&startTime=1351559919697&refURL=not%20available

Brightcove's player is inside an <iframe>, and that's the iframe's contents after the player has initialized.

That (slightly more) minimized testcase works in Chrome on desktop Linux. Chrome's DOM inspector equivalent tells me that the <video> element has width and height attributes greater than 1 pixel. However when that minimized testcase is loaded in a Firefox GStreamer build the <video> element has width=1 height=1 attributes, i.e. the video isn't visible. If I change the width and height attributes using Firefox's DOM Inspector to non-1-pixel values the video becomes visible.

If I change my GStreamer build of Firefox's user agent to masquerade as Chrome, the minimized testcase works (though http://support.brightcove.com/en/docs/video-test-html-5 does not), so I think it's reasonable to assume that Brightcove's player is sniffing the user agent and isn't handling Firefox when it does.

So we need someone from Brightcove to look fix this on their side. I will make a Firefox GStreamer build with the ability to change the user agent string to assist Brightcove in testing.
Comment 18 Maire Reavy (On PTO July 23rd to 31st) 2012-10-30 15:05:37 PDT
Since this is not an issue with the Firefox code, I'm removing [swdecoder] from the whiteboard.  I just talked to Lawrence, and he's going to reach out to Brightcove to get this bug on their radar.  

I'm reassigning this to Lawrence since cpearce's work is done and Lawrence seems like the logical owner at this point. Thanks.
Comment 19 Kevin Brosnan [:kbrosnan] 2013-05-02 10:03:02 PDT
CC'ing a Brightcove employee.
Comment 20 Hallvord R. M. Steen [:hallvors] 2013-08-19 03:40:46 PDT
Somewhat depressing UA sniffing:

	brightcove.checkHtmlSupport = function() {
		var v = brightcove.createElement('video');
		var videoSupport = true;
		if (!brightcove.userAgent.match(new RegExp("android", "i"))) {
			videoSupport = !!(v.canPlayType && v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').replace(/no/, ''));
		}
		if (brightcove.userAgent.match(/BlackBerry.*Version\/6\.0/)) {
			return false;
		}
		var canvasSupport = !!brightcove.createElement('canvas').getContext;
		return videoSupport && canvasSupport;
	};
	brightcove.isSupportedHTMLDevice = function(pUAString) {
		var types = ["iPad", "iPhone", "iPod", "android", "Silk"];
		var numTypes = types.length;
		var uaString = pUAString || brightcove.userAgent;
		for (var i = 0; i < numTypes; i++) {
			if (uaString.match(new RegExp(types[i], "i"))) {
				return true;
			}
		}
		return false;
	};

And then it does:

		if (htmlSupport) {
			if (brightcove.isSupportedHTMLDevice() || experience.params.htmlFallback) {
				return brightcove.playerType.HTML;
			}
		}
		return brightcove.playerType.NO_SUPPORT;
Comment 21 Hallvord R. M. Steen [:hallvors] 2013-08-19 05:16:20 PDT
If the feature detection ran without the UA sniffing, try this on device for the result: http://jsfiddle.net/jwyJC/
Comment 22 Hallvord R. M. Steen [:hallvors] 2013-08-19 07:31:04 PDT
(Seems the Gaia browser's response to that feature detection isn't being honest though.. As it says "probably" I keep trying to get an MP4 file to play, but it doesn't seem to work - not that I expected it to, but seeing "probably" from canPlayType() was sort of promising. So if we're lying the sniffing is there for a good reason :-/)
Comment 23 Hallvord R. M. Steen [:hallvors] 2013-08-19 07:40:34 PDT
*** Bug 868048 has been marked as a duplicate of this bug. ***
Comment 24 Hallvord R. M. Steen [:hallvors] 2013-08-19 07:41:03 PDT
*** Bug 737707 has been marked as a duplicate of this bug. ***
Comment 25 Harald Kirschner :digitarald 2013-08-19 10:11:54 PDT
We return "probably" for H.264, but I also saw "maybe" for other types (when just a container is specified and no codec). Both values are acceptable and pass what they are testing for.

The actual problem is their isSupportedHTMLDevice test, as it doesn't include "Firefox".

All test cases collected here, including: http://jsfiddle.net/digitarald/urXL7/.

Do we have a relationship with Brightcove to fix their UA detection, Hallvord?
Comment 26 Hallvord R. M. Steen [:hallvors] 2013-08-19 23:52:49 PDT
We will of course be contacting them again about the sniffing. FirefoxOS might be an interesting target for them now the phones are actually shipping, and I think Fx on Android also has way more installs now than last time we discussed this. (On the other hand, when the feature detection approach is so shaky I can totally understand that they end up white-listing user-agents.. :-( it would be nice if canPlayType() was more reliable.)
Comment 27 Hallvord R. M. Steen [:hallvors] 2013-08-30 04:59:00 PDT
Verified that their demo plays fine in my Geeksphone Peek with FirefoxOS 1.1 after changing their isSupportedHTMLDevice() method.

Contacted again by E-mail, following up an older discussion.
Comment 28 Hallvord R. M. Steen [:hallvors] 2013-09-02 08:31:18 PDT
*** Bug 737715 has been marked as a duplicate of this bug. ***
Comment 29 Hallvord R. M. Steen [:hallvors] 2014-09-02 04:28:40 PDT
*** Bug 637873 has been marked as a duplicate of this bug. ***
Comment 30 Hallvord R. M. Steen [:hallvors] 2015-03-29 00:52:31 PDT
Below I paste the last response from Brightcove support. Based on this, this bug is both WONTFIX (for their old player) and FIXED (for their new player). We need to go through the dependencies (other sites using Brightcove) and check if they are using the old or the new player - if they are using the old one, we should contact them and suggest they update to using the new one.

Brightcove support says:


Thank you for your reply. That link is the older Smart Player. The players do look different visually, but the most foolproof way to determine which version is loaded is to check the page source code: if you can see any reference to BrightcoveExperiences.js, "experience", "admin.brightcove.com" or "c.brightcove.com", it will be the Smart Player. None of those terms or URLs are used in the new player.

The new player exclusively uses JavaScript from "players.brightcove.net".

This page has a good demonstration of the new Brightcove Player:
https://www.brightcove.com/en/perform

All players are hosted centrally so any fixes/changes we make are automatically pushed out to customer sites (there is a way to force a specific version when deploying a player, but I would not expect many people to be making use of that). I'm afraid that there are no plans to expand browser support for the legacy Smart Player as all development work is focused on the new Brightcove Player. As customers move over to it, support for Firefox will broaden.

The "install Flash" message definitely comes from the Smart Player. There's a lot going on behind the scenes so that adding Firefox to the "allowed" browser list would just be the beginning!
Comment 31 Hallvord R. M. Steen [:hallvors] 2015-03-29 04:29:11 PDT
I've verified the new player works fine on both Firefox Android and Firefox OS. I will go through the duplicates and dependencies and re-open those we need to contact.

Note You need to log in before you can comment on or make changes to this bug.