Skip to content

Commit

Permalink
Add youtube-nocookie to video detection. Fixes #561
Browse files Browse the repository at this point in the history
  • Loading branch information
bagofarms committed Apr 23, 2021
1 parent c47bb78 commit f5213be
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/quail/quail/common/accessibility_tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -6450,7 +6450,7 @@ class videosEmbeddedOrLinkedNeedCaptions extends quailTest
*/
function check()
{
$search_youtube = '/(youtube|youtu\.be)/';
$search_youtube = '/(youtube|youtu\.be|youtube-nocookie)/';
$search_vimeo = '/(vimeo)/';

foreach ($this->getAllElements(array('a', 'embed', 'iframe')) as $video) {
Expand Down Expand Up @@ -6501,7 +6501,7 @@ class videoCaptionsAreCorrectLanguage extends quailTest
*/
function check()
{
$search_youtube = '/(youtube|youtu\.be)/';
$search_youtube = '/(youtube|youtu\.be|youtube-nocookie)/';
$search_vimeo = '/(vimeo)/';

foreach ($this->getAllElements(array('a', 'embed', 'iframe')) as $video) {
Expand Down Expand Up @@ -6554,7 +6554,7 @@ class videoUnlistedOrNotFound extends quailTest
*/
function check()
{
$search_youtube = '/(youtube|youtu\.be)/';
$search_youtube = '/(youtube|youtu\.be|youtube-nocookie)/';
$search_vimeo = '/(vimeo)/';

foreach ($this->getAllElements(array('a', 'embed', 'iframe')) as $video) {
Expand Down
2 changes: 1 addition & 1 deletion lib/quail/quail/common/services/media/vimeo.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function captionsMissing($link_url)
}

/**
* Checks to see if a video is missing caption information in YouTube
* Checks to see if a video is missing caption information in Vimeo
* @param string $link_url The URL to the video or video resource
* @param string $course_locale The locale/language of the Canvas course
* @return int 0 if captions are manual and wrong language, 1 if video is private, 2 if there are no captions or if manually generated and correct language
Expand Down
1 change: 1 addition & 0 deletions lib/quail/quail/common/services/media/youtube.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class youtubeService extends mediaService
'@youtu\.be/v/([0-9a-zA-Z_-]+)@i',
'@youtu\.be/watch\?v=([0-9a-zA-Z_-]+)@i',
'@youtu\.be/\?v=([0-9a-zA-Z_-]+)@i',
'@youtube-nocookie\.com/embed/([0-9a-zA-Z_-]+)@i',
);

/**
Expand Down

0 comments on commit f5213be

Please sign in to comment.