Skip to content
This repository has been archived by the owner on Sep 24, 2019. It is now read-only.

Commit

Permalink
Removed link to YouTube v2 api #381
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilco Fiers committed Oct 13, 2015
1 parent 49c85a9 commit e650c0e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
32 changes: 0 additions & 32 deletions src/js/components/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,38 +35,6 @@ quail.components.video = {

providers : {

youTube : {

selector : 'a, iframe',

apiUrl : 'http://gdata.youtube.com/feeds/api/videos/?q=%video&caption&v=2&alt=json',

isVideo : function(element) {
return (this.getVideoId(element) !== false) ? true : false;
},

getVideoId : function(element) {
var attribute = (element.is('iframe')) ? 'src' : 'href';
var regExp = /^.*((youtu.be\/)|(v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))\??v?=?([^#&\?]*).*/;
var match = element.attr(attribute).match(regExp);
if (match && match[7].length === 11) {
return match[7];
}
return false;
},

hasCaptions : function(element, callback) {
var videoId = this.getVideoId(element);
$.ajax({url : this.apiUrl.replace('%video', videoId),
async : false,
dataType : 'json',
success : function(data) {
callback(element, (data.feed.openSearch$totalResults.$t > 0));
}
});
}
},

flash : {

selector : 'object',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</object>
</div>

<div class="quail-test" data-expected="pass" data-accessibility-test="videosEmbeddedOrLinkedNeedCaptions">
<div class="quail-test" data-expected="cantTell" data-accessibility-test="videosEmbeddedOrLinkedNeedCaptions">
<p>
Hey, check
<a href="http://youtube.com/watch?v=zJOS0sV2a24">Out this awesome video.</a>
Expand Down

0 comments on commit e650c0e

Please sign in to comment.