From 8b2597d6190a7fef250a57596116e00ecfcdee73 Mon Sep 17 00:00:00 2001 From: Mark Finkle Date: Thu, 1 May 2014 17:29:00 -0400 Subject: [PATCH] Bug 1001279 - Add support of websites to opt-out of casting videos r=wesj --- mobile/android/chrome/content/CastingApps.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mobile/android/chrome/content/CastingApps.js b/mobile/android/chrome/content/CastingApps.js index 00d21c26467..8d22a58322e 100644 --- a/mobile/android/chrome/content/CastingApps.js +++ b/mobile/android/chrome/content/CastingApps.js @@ -138,11 +138,17 @@ var CastingApps = { }, _getVideo: function(aElement) { - // Given the hardware support for H264, let's only look for 'mp4' sources if (!aElement instanceof HTMLVideoElement) { return null; } + // Allow websites to opt-out using the Apple airplay attribute + // https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/AirPlayGuide/OptingInorOutofAirPlay/OptingInorOutofAirPlay.html + if (aElement.getAttribute("x-webkit-airplay") === "deny") { + return null; + } + + // Given the hardware support for H264, let's only look for 'mp4' sources function allowableExtension(aURI) { if (aURI && aURI instanceof Ci.nsIURL) { return (aURI.fileExtension == "mp4");