This file contains hidden or 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
// PBS Video Extractor | |
(function () { | |
var getVideoUrl = function (id, fn) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', 'http://video.pbs.org/video/' + id + '.smil'); | |
xhr.responseType = 'document'; | |
xhr.onload = function () { | |
var videos = Array.prototype.slice.call(xhr.response.querySelectorAll('video'), 0); | |
videos.sort(function (a, b) { |