Closed Bug 1043592 Opened 10 years ago Closed 8 years ago

Google Ad SDK breaks FoxNews Video in Firefox for Android

Categories

(Web Compatibility :: Site Reports, defect)

Firefox 31
All
Android
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: u509263, Assigned: karlcow)

References

()

Details

(Keywords: reproducible, Whiteboard: [country-us] [video] [sitewait] [lib-livefyre] [lib-akamai-video])

User Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0 (Beta/Release)
Build ID: 20140716183446

Steps to reproduce:

Tried to play video from the following URL: http://video.foxnews.com/v/3695243351001


Actual results:

Page and video thumbnail image are displayed. But video does not play, even after clicking the play button on image. In fact, the same seems to happen with all videos from that site (http://video.foxnews.com) 


Expected results:

Expected video playback after a short video ad, but neither plays. Video should have played as it does in Chrome (Android) or Firefox (Desktop).
OS: Windows XP → Android
Hardware: x86 → All
Thanks for the report. I'm able to reproduce this on my Asus Nexus 7 (Android 4.4.4) tablet and on the desktop Firefox (disabled Flash, set the mobile UA).

I suspect this to be an evangelism issue for the reason that on the player I see 'Error: No valid source could be found'

The video-on-demand framework they are using is at: http://global.fncstatic.com/static/p/video/app/embed/iframe/js/vod.js

Player scripts:
  
  http://global.fncstatic.com/static/p/video/app/js/ag.video.v2.js
  http://global.fncstatic.com/static/p/video/app/embed/config.js
Status: UNCONFIRMED → NEW
Component: General → Mobile
Ever confirmed: true
Keywords: reproducible
Product: Firefox for Android → Tech Evangelism
Summary: Video does not play in Firefox for Android → FoxNews Video does not play in Firefox for Android
For me, it plays fine in Desktop. 

It generates this VIDEO tag inside an IFRAME (same in Desktop and Fx Android):
<video src="http://media2.foxnews.com/072414/072414_rs_service3_FNC_LOW.mp4" class="akamai-html5 akamai-video"></video>

The oddest thing is that loading that video URL directly seems to play it back just fine - right there in the browser -
Simply injecting
document.getElementsByTagName('iframe')[1].contentDocument.getElementsByTagName('video')[0].play()
in the devtools console when attached to the page loaded on Android, will make the video play just fine. TBC.
See also Bug 821581
See Also: → 821581
Whiteboard: [country-us] [video] [contactready]
Wait a moment - I would like to figure out why it doesn't start playing automatically like in other browsers.. setting notcontactready.
Whiteboard: [country-us] [video] [contactready] → [country-us] [video] [notcontactready]
Still an issue. After a while this is printed to the console:
"[DependencyManager.livefyre.isReady] Max attempts reached to check ready state."

According to some of the markup they are using "Akamai video player"

Smoking gun:

  window.loadHandler = function () {
    $.loadAttempt(150, 50, function () {
      return _embed_fired && window.akamai && window.akamai.amp && window.akamai.amp.AMP ? !0 : !1
    }, function () {
      akamai.amp.AMP.loadDefaults(pageVars.configUrl);
      akamai.amp.utils.Utils.getPlaybackMode();
      setParentEmbedUrl(),
      setPlayerNameProp(),
      forceAutoPlay('undefined' == typeof config.autoplay ? !1 : config.autoplay),
      log('[VideoPlayer.Embed] Config: ', config),
      window.amp = new akamai.amp.AMP('akamai-media-player', config),
      amp.addEventListener('ready', initializedHandler)
    })
  }

(from vod.js) 
So _embed_fired needs to be true and the akamai.amp API stuff needs to be defined to make the video play. The _embed_fired variable is set to true by some JS that listens to the event fired (or not) from here:

target.find("> iframe:first").bind("load",function(){MessageHandler.sendMessage(this,"FOXVIDEO.IFRAME.Embed",info)})
Whiteboard: [country-us] [video] [notcontactready] → [country-us] [video] [notcontactready] [lib-livefyre] [lib-akamai-video]
(That was more a red herring than a smoking gun)
No more time today, will try to finish this analysis later. There's a click handler at

return fn['apply'](me, arguments);

which runs when tapping the play button, I haven't been able to step through that script due to bugs in devtools.
Assignee: nobody → hsteen
Status: NEW → ASSIGNED
Site has changed somewhat - now the video element says "Error: no valid source could be found" both on Fx-Android and Fx-OS.
There's a mysterious exception happening if one taps the video: "Argument 10 of TouchEvent.initTouchEvent is not an object."

d.initTouchEvent(a.V, !0, !0, window, b.detail, b.screenX, b.screenY, b.clientX + c.x, b.clientY + c.y, b.ctrlKey, b.altKey, b.shiftKey, b.metaKey, Sl(this, b.touches), Sl(this, b.targetTouches), Sl(this, b.changedTouches), b.scale, b.rotation);

MDN's initTouchEvent page is 404 (https://developer.mozilla.org/en-US/docs/Web/API/TouchEvent/initTouchEvent ) so I don't know what arguments are expected here.
Here we go: https://dxr.mozilla.org/mozilla-central/source/dom/webidl/TouchEvent.webidl#19 - Firefox doesn't expect the screenX, screenY etc location arguments. When this is fixed in Foxnews' JS we can start the video by a touch.
Assignee: hsteen → nobody
Status: ASSIGNED → NEW
Whiteboard: [country-us] [video] [notcontactready] [lib-livefyre] [lib-akamai-video] → [country-us] [video] [needscontact] [lib-livefyre] [lib-akamai-video]
From https://w3c.github.io/touch-events/,

> "The initTouchEvent method is not standardized and is superseded by the TouchEvent constructor."

That's lame.
(In reply to Hallvord R. M. Steen [:hallvors] from comment #10)
> There's a mysterious exception happening if one taps the video: "Argument 10
> of TouchEvent.initTouchEvent is not an object."
> 
> d.initTouchEvent(a.V, !0, !0, window, b.detail, b.screenX, b.screenY,
> b.clientX + c.x, b.clientY + c.y, b.ctrlKey, b.altKey, b.shiftKey,
> b.metaKey, Sl(this, b.touches), Sl(this, b.targetTouches), Sl(this,
> b.changedTouches), b.scale, b.rotation);

http://imasdk.googleapis.com/js/sdkloader/ima3.js

That code comes a Google Ad SDK. Karl, can we let google know?
Flags: needinfo?(kdubost)
Flags: needinfo?(kdubost)
Summary: FoxNews Video does not play in Firefox for Android → Google Ad SDK breaks FoxNews Video in Firefox for Android
Sorry for the delay. 
Contacted today.
Assignee: nobody → kdubost
Status: NEW → ASSIGNED
Whiteboard: [country-us] [video] [needscontact] [lib-livefyre] [lib-akamai-video] → [country-us] [video] [sitewait] [lib-livefyre] [lib-akamai-video]
This seems to be working now.
Status: ASSIGNED → RESOLVED
Closed: 8 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.