Created
January 12, 2011 23:01
-
-
Save ryanseddon/777076 to your computer and use it in GitHub Desktop.
Add airplay attribute to HTML5 video containers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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