Skip to content

Instantly share code, notes, and snippets.

@ryanseddon
Created January 12, 2011 23:01
Show Gist options
  • Save ryanseddon/777076 to your computer and use it in GitHub Desktop.
Save ryanseddon/777076 to your computer and use it in GitHub Desktop.
Add airplay attribute to HTML5 video containers
(function(doc){
if("querySelectorAll" in doc) {
var vids = doc.querySelectorAll("video"),
len = vids.length,
cvid;
while(len--) {
cvid = vids[len];
if("setAttribute" in cvid) {
cvid.setAttribute("x-webkit-airplay","allow");
}
}
}
})(document);
// Bookmarklet
javascript:(function(doc){if("querySelectorAll"in doc){var vids=doc.querySelectorAll("video"),len=vids.length,cvid;while(len--){cvid=vids[len];if("setAttribute"in cvid){cvid.setAttribute("x-webkit-airplay","allow");}}}})(document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment