|
@@ -34,6 +34,15 @@ function video_filter_codec_info() {
|
|
|
'control_bar_height' => 30,
|
|
|
);
|
|
|
|
|
|
+ $codecs['candidcareer'] = array(
|
|
|
+ 'name' => t('Candid Career'),
|
|
|
+ 'sample_url' => 'https://www.candidcareer.com/embed.php?vkey=ed5fdd900a274930252f&shared=CandidCareer&uid=30',
|
|
|
+ 'callback' => 'video_filter_candidcareer',
|
|
|
+ 'regexp' => '/candidcareer\.com\/embed\.php\?vkey=([a-zA-Z0-9\-_&;]+)shared=([a-zA-Z0-9\-_&;]+)uid=([a-zA-Z0-9\-_&;]+)/',
|
|
|
+ 'ratio' => 16 / 9,
|
|
|
+ 'control_bar_height' => 20,
|
|
|
+ );
|
|
|
+
|
|
|
$codecs['capped'] = array(
|
|
|
'name' => t('Capped'),
|
|
|
'sample_url' => 'http://capped.tv/playeralt.php?vid=some-title',
|
|
@@ -196,7 +205,7 @@ function video_filter_codec_info() {
|
|
|
'sample_url' => 'http://wistia.com/medias/9pj9n6ftlk',
|
|
|
'callback' => 'video_filter_wistia_html5',
|
|
|
'html5_callback' => 'video_filter_wistia_html5',
|
|
|
- 'regexp' => '@https?://(.+\.)?(wistia\.com|wi\.st)/((m|medias|projects)|embed/(iframe|playlists))/([a-zA-Z0-9]+)@',
|
|
|
+ 'regexp' => '@https?://(.+\.)?(wistia\.(com|net)|wi\.st)/((m|medias|projects)|embed/(iframe|playlists))/([a-zA-Z0-9]+)@',
|
|
|
);
|
|
|
|
|
|
$codecs['youtube'] = array(
|
|
@@ -205,9 +214,10 @@ function video_filter_codec_info() {
|
|
|
'callback' => 'video_filter_youtube',
|
|
|
'html5_callback' => 'video_filter_youtube_html5',
|
|
|
'regexp' => array(
|
|
|
- '/youtube\.com\/watch\?v=([a-z0-9\-_]+)/i',
|
|
|
+ '/youtube\.com\/watch\?.*?v=([a-z0-9\-_]+)/i',
|
|
|
'/youtu.be\/([a-z0-9\-_]+)/i',
|
|
|
'/youtube\.com\/v\/([a-z0-9\-_]+)/i',
|
|
|
+ '/youtube\.com\/embed\/([a-z0-9\-_]+)/i',
|
|
|
),
|
|
|
'ratio' => 16 / 9,
|
|
|
'control_bar_height' => 25,
|
|
@@ -233,7 +243,7 @@ function video_filter_codec_info() {
|
|
|
* @see video_filter_codec_info()
|
|
|
*/
|
|
|
function video_filter_archive($video) {
|
|
|
- $video['source'] = 'http://www.archive.org/embed/' . $video['codec']['matches'][1];
|
|
|
+ $video['source'] = '//www.archive.org/embed/' . $video['codec']['matches'][1];
|
|
|
|
|
|
return video_filter_iframe($video);
|
|
|
}
|
|
@@ -290,7 +300,7 @@ function video_filter_bliptv($video) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- $video['source'] = 'http://blip.tv/play/' . $id;
|
|
|
+ $video['source'] = '//blip.tv/play/' . $id;
|
|
|
$params = array(
|
|
|
'allowscriptaccess' => 'always',
|
|
|
);
|
|
@@ -298,13 +308,27 @@ function video_filter_bliptv($video) {
|
|
|
return video_filter_flash($video, $params);
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * Callback for Candid Career codec.
|
|
|
+ *
|
|
|
+ * @see video_filter_codec_info()
|
|
|
+ */
|
|
|
+function video_filter_candidcareer($video) {
|
|
|
+ // Their urls contain & symbols which Drupal is encoding, so decode those.
|
|
|
+ $decoded = decode_entities($video['codec']['matches'][0]);
|
|
|
+ $video['source'] = '//' . $decoded;
|
|
|
+ $video['attributes']['marginwidth'] = 0;
|
|
|
+ $video['attributes']['marginheight'] = 0;
|
|
|
+ return video_filter_iframe($video);
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* Callback for Capped codec.
|
|
|
*
|
|
|
* @see video_filter_codec_info()
|
|
|
*/
|
|
|
function video_filter_capped($video) {
|
|
|
- $video['source'] = 'http://capped.micksam7.com/playeralt.swf?vid=' . $video['codec']['matches'][1];
|
|
|
+ $video['source'] = '//capped.micksam7.com/playeralt.swf?vid=' . $video['codec']['matches'][1];
|
|
|
|
|
|
return video_filter_flash($video);
|
|
|
}
|
|
@@ -315,7 +339,7 @@ function video_filter_capped($video) {
|
|
|
* @see video_filter_codec_info()
|
|
|
*/
|
|
|
function video_filter_collegehumor($video) {
|
|
|
- $video['source'] = 'http://www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=' . $video['codec']['matches'][1] . '&fullscreen=1';
|
|
|
+ $video['source'] = '//www.collegehumor.com/moogaloop/moogaloop.swf?clip_id=' . $video['codec']['matches'][1] . '&fullscreen=1';
|
|
|
|
|
|
return video_filter_flash($video);
|
|
|
}
|
|
@@ -326,7 +350,7 @@ function video_filter_collegehumor($video) {
|
|
|
* @see video_filter_codec_info()
|
|
|
*/
|
|
|
function video_filter_dailymotion($video) {
|
|
|
- $video['source'] = 'http://www.dailymotion.com/swf/' . $video['codec']['matches'][1];
|
|
|
+ $video['source'] = '//www.dailymotion.com/swf/' . $video['codec']['matches'][1];
|
|
|
|
|
|
return video_filter_flash($video);
|
|
|
}
|
|
@@ -354,7 +378,7 @@ function video_filter_flickr_slideshows($video) {
|
|
|
* @see video_filter_codec_info()
|
|
|
*/
|
|
|
function video_filter_flickr_video($video) {
|
|
|
- $video['source'] = 'http://www.flickr.com/apps/video/stewart.swf?v=1.161';
|
|
|
+ $video['source'] = '//www.flickr.com/apps/video/stewart.swf?v=1.161';
|
|
|
|
|
|
$params['flashvars'] = '&photo_id=' . $video['codec']['matches'][2] . '&flickr_show_info_box=true';
|
|
|
|
|
@@ -373,7 +397,7 @@ function video_filter_gametrailers($video) {
|
|
|
elseif (is_numeric($video['codec']['matches'][2])) {
|
|
|
$match = $video['codec']['matches'][2];
|
|
|
}
|
|
|
- $video['source'] = 'http://media.mtvnservices.com/embed/mgid:moses:video:gametrailers.com:' . $match;
|
|
|
+ $video['source'] = '//media.mtvnservices.com/embed/mgid:moses:video:gametrailers.com:' . $match;
|
|
|
|
|
|
return video_filter_iframe($video);
|
|
|
}
|
|
@@ -384,7 +408,7 @@ function video_filter_gametrailers($video) {
|
|
|
* @see video_filter_codec_info()
|
|
|
*/
|
|
|
function video_filter_gamevideos($video) {
|
|
|
- $video['source'] = 'http://gamevideos.1up.com/swf/gamevideos12.swf?embedded=1&fullscreen=1&autoplay=0&src=http://gamevideos.1up.com/do/videoListXML%3Fid%3D' . $video['codec']['matches'][1];
|
|
|
+ $video['source'] = '//gamevideos.1up.com/swf/gamevideos12.swf?embedded=1&fullscreen=1&autoplay=0&src=http://gamevideos.1up.com/do/videoListXML%3Fid%3D' . $video['codec']['matches'][1];
|
|
|
|
|
|
return video_filter_flash($video);
|
|
|
}
|
|
@@ -395,7 +419,7 @@ function video_filter_gamevideos($video) {
|
|
|
* @see video_filter_codec_info()
|
|
|
*/
|
|
|
function video_filter_godtube($video) {
|
|
|
- $video['source'] = 'http://www.godtube.com/embed/watch/' . $video['codec']['matches'][1];
|
|
|
+ $video['source'] = '//www.godtube.com/embed/watch/' . $video['codec']['matches'][1];
|
|
|
|
|
|
return video_filter_iframe($video);
|
|
|
}
|
|
@@ -406,7 +430,7 @@ function video_filter_godtube($video) {
|
|
|
* @see video_filter_codec_info()
|
|
|
*/
|
|
|
function video_filter_google($video) {
|
|
|
- $video['source'] = 'http://video.google.com/googleplayer.swf?docId=' . $video['codec']['matches'][1];
|
|
|
+ $video['source'] = '//video.google.com/googleplayer.swf?docId=' . $video['codec']['matches'][1];
|
|
|
|
|
|
return video_filter_flash($video);
|
|
|
}
|
|
@@ -417,7 +441,7 @@ function video_filter_google($video) {
|
|
|
* @see video_filter_codec_info()
|
|
|
*/
|
|
|
function video_filter_metacafe($video) {
|
|
|
- $video['source'] = 'http://metacafe.com/fplayer/' . $video['codec']['matches'][1] . '/' . $video['codec']['matches'][2] . '.swf';
|
|
|
+ $video['source'] = '//metacafe.com/fplayer/' . $video['codec']['matches'][1] . '/' . $video['codec']['matches'][2] . '.swf';
|
|
|
|
|
|
return video_filter_flash($video);
|
|
|
}
|
|
@@ -430,7 +454,7 @@ function video_filter_metacafe($video) {
|
|
|
function video_filter_myspace($video) {
|
|
|
// The last match is the ID we need.
|
|
|
$last = count($video['codec']['matches']);
|
|
|
- $video['source'] = 'http://mediaservices.myspace.com/services/media/embed.aspx/m=' . $video['codec']['matches'][$last - 1];
|
|
|
+ $video['source'] = '//mediaservices.myspace.com/services/media/embed.aspx/m=' . $video['codec']['matches'][$last - 1];
|
|
|
|
|
|
return video_filter_flash($video, $params);
|
|
|
}
|
|
@@ -441,7 +465,7 @@ function video_filter_myspace($video) {
|
|
|
* @see video_filter_codec_info()
|
|
|
*/
|
|
|
function video_filter_picasa_slideshows($video) {
|
|
|
- $video['source'] = 'http://picasaweb.google.com/s/c/bin/slideshow.swf';
|
|
|
+ $video['source'] = '//picasaweb.google.com/s/c/bin/slideshow.swf';
|
|
|
|
|
|
$user_name = $video['codec']['matches'][1];
|
|
|
$set_id = $video['codec']['matches'][2];
|
|
@@ -457,7 +481,7 @@ function video_filter_picasa_slideshows($video) {
|
|
|
* @see video_filter_codec_info()
|
|
|
*/
|
|
|
function video_filter_slideshare($video) {
|
|
|
- $video['source'] = 'http://www.slideshare.net/slideshow/embed_code/' . $video['codec']['matches'][1];
|
|
|
+ $video['source'] = '//www.slideshare.net/slideshow/embed_code/' . $video['codec']['matches'][1];
|
|
|
|
|
|
return video_filter_iframe($video);
|
|
|
}
|
|
@@ -468,7 +492,7 @@ function video_filter_slideshare($video) {
|
|
|
* @see video_filter_codec_info()
|
|
|
*/
|
|
|
function video_filter_streamhoster($video) {
|
|
|
- $video['source'] = 'http://public.streamhoster.com/Resources/Flash/JWFLVMediaPlayer/mediaplayer.swf';
|
|
|
+ $video['source'] = '//public.streamhoster.com/Resources/Flash/JWFLVMediaPlayer/mediaplayer.swf';
|
|
|
|
|
|
$params = array('allowscriptaccess' => 'always');
|
|
|
$protocol = $video['codec']['matches'][1];
|
|
@@ -496,7 +520,7 @@ function video_filter_streamhoster($video) {
|
|
|
* @see video_filter_codec_info()
|
|
|
*/
|
|
|
function video_filter_teachertube($video) {
|
|
|
- $video['source'] = 'http://www.teachertube.com/embed/player.swf';
|
|
|
+ $video['source'] = '//www.teachertube.com/embed/player.swf';
|
|
|
|
|
|
$params['flashvars'] = 'file=http://www.teachertube.com/embedFLV.php?pg=video_' . $video['codec']['matches'][1] . '&menu=false&frontcolor=ffffff&lightcolor=FF0000&logo=http://www.teachertube.com/www3/images/greylogo.swf&skin=http://www.teachertube.com/embed/overlay.swf&volume=80&controlbar=over&displayclick=link&viral.link=http://www.teachertube.com/viewVideo.php?video_id=' . $video['codec']['matches'][1] . '&stretching=exactfit&plugins=viral-2&viral.callout=none&viral.onpause=false';
|
|
|
|
|
@@ -509,7 +533,7 @@ function video_filter_teachertube($video) {
|
|
|
* @see video_filter_codec_info()
|
|
|
*/
|
|
|
function video_filter_vimeo($video) {
|
|
|
- $video['source'] = 'http://www.vimeo.com/moogaloop.swf?clip_id=' . $video['codec']['matches'][1] . '&server=www.vimeo.com&fullscreen=1&show_title=1&show_byline=1&show_portrait=0&color=&autoplay=' . $video['autoplay'];
|
|
|
+ $video['source'] = '//www.vimeo.com/moogaloop.swf?clip_id=' . $video['codec']['matches'][1] . '&server=www.vimeo.com&fullscreen=1&show_title=1&show_byline=1&show_portrait=0&color=&autoplay=' . $video['autoplay'];
|
|
|
|
|
|
return video_filter_flash($video);
|
|
|
}
|
|
@@ -520,7 +544,7 @@ function video_filter_vimeo($video) {
|
|
|
* @see video_filter_codec_info()
|
|
|
*/
|
|
|
function video_filter_vimeo_html5($video) {
|
|
|
- $video['source'] = 'http://player.vimeo.com/video/' . $video['codec']['matches'][1] . ($video['autoplay'] ? '?autoplay=1' : '');
|
|
|
+ $video['source'] = '//player.vimeo.com/video/' . $video['codec']['matches'][1] . ($video['autoplay'] ? '?autoplay=1' : '');
|
|
|
|
|
|
return video_filter_iframe($video);
|
|
|
}
|
|
@@ -537,7 +561,7 @@ function video_filter_youtube($video) {
|
|
|
'fs' => 'fs=1',
|
|
|
);
|
|
|
|
|
|
- $video['source'] = 'http://www.youtube.com/v/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes);
|
|
|
+ $video['source'] = '//www.youtube.com/v/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes);
|
|
|
|
|
|
$params['wmode'] = 'opaque';
|
|
|
|
|
@@ -551,11 +575,12 @@ function video_filter_youtube($video) {
|
|
|
*/
|
|
|
function video_filter_youtube_html5($video) {
|
|
|
$attributes = array(
|
|
|
+ 'html5' => 'html5=1',
|
|
|
'rel' => $video['related'] ? 'rel=1' : 'rel=0',
|
|
|
'autoplay' => $video['autoplay'] ? 'autoplay=1' : 'autoplay=0',
|
|
|
'wmode' => 'wmode=opaque',
|
|
|
);
|
|
|
- $video['source'] = 'http://www.youtube.com/embed/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes);
|
|
|
+ $video['source'] = '//www.youtube.com/embed/' . $video['codec']['matches'][1] . '?' . implode('&', $attributes);
|
|
|
|
|
|
return video_filter_iframe($video);
|
|
|
}
|
|
@@ -571,7 +596,7 @@ function video_filter_youtube_playlist_html5($video) {
|
|
|
'autoplay' => $video['autoplay'] ? 'autoplay=1' : 'autoplay=0',
|
|
|
'wmode' => 'wmode=opaque',
|
|
|
);
|
|
|
- $video['source'] = 'http://www.youtube.com/embed/videoseries?list=' . $video['codec']['matches'][1] . '&' . implode('&', $attributes);
|
|
|
+ $video['source'] = '//www.youtube.com/embed/videoseries?list=' . $video['codec']['matches'][1] . '&' . implode('&', $attributes);
|
|
|
|
|
|
return video_filter_iframe($video);
|
|
|
}
|
|
@@ -584,9 +609,9 @@ function video_filter_youtube_playlist_html5($video) {
|
|
|
* @see video_filter_codec_info()
|
|
|
*/
|
|
|
function video_filter_wistia_html5($video) {
|
|
|
- $video_code = $video['codec']['matches'][6];
|
|
|
+ $video_code = $video['codec']['matches'][7];
|
|
|
$matches = $video['codec']['matches'];
|
|
|
- $embed_type = ($matches[3] == 'projects' || $matches[5] == 'playlists') ? 'playlists' : 'iframe';
|
|
|
+ $embed_type = ($matches[4] == 'projects' || $matches[6] == 'playlists') ? 'playlists' : 'iframe';
|
|
|
|
|
|
// Get embed code via oEmbed.
|
|
|
$endpoint = 'http://fast.wistia.com/oembed';
|
|
@@ -599,12 +624,12 @@ function video_filter_wistia_html5($video) {
|
|
|
$html = $data['html'];
|
|
|
|
|
|
// See if the video source is already an iframe src.
|
|
|
- $pattern = '@https?://fast.wistia.com/embed/(iframe|playlists)/[a-zA-Z0-9]+\?+.+@';
|
|
|
+ $pattern = '@https?://fast.wistia.(com|net)/embed/(iframe|playlists)/[a-zA-Z0-9]+\?+.+@';
|
|
|
$matches = array();
|
|
|
if (preg_match($pattern, $video['source'], $matches)) {
|
|
|
// Replace the oEmbed iframe src with that provided in the token, in order
|
|
|
// to support embed builder URLs.
|
|
|
- $pattern = '@https?://fast.wistia.com/embed/(iframe|playlists)/[a-zA-Z0-9]+\?[^"]+@';
|
|
|
+ $pattern = '@https?://fast.wistia.(com|net)/embed/(iframe|playlists)/[a-zA-Z0-9]+\?[^"]+@';
|
|
|
$replacement = $matches[0];
|
|
|
$html = preg_replace($pattern, $replacement, $html);
|
|
|
}
|