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");