Bug 1001279 - Add support of websites to opt-out of casting videos r=wesj

This commit is contained in:
Mark Finkle 2014-05-01 17:29:00 -04:00
parent d6e8f4b945
commit 8b2597d619

View File

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