Version Description
- Added support for Livestream
- Support for latest TED embed code
Download this release
Release Info
Developer | sutherlandboswell |
Plugin | Video Thumbnails |
Version | 2.11 |
Comparing to | |
See all releases |
Code changes from version 2.10.3 to 2.11
- php/providers/class-livestream-thumbnails.php +61 -0
- php/providers/class-ted-thumbnails.php +1 -1
- php/providers/providers.php +2 -0
- readme.txt +6 -1
- video-thumbnails.php +2 -2
php/providers/class-livestream-thumbnails.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/* Copyright 2015 Sutherland Boswell (email : sutherland.boswell@gmail.com)
|
4 |
+
|
5 |
+
This program is free software; you can redistribute it and/or modify
|
6 |
+
it under the terms of the GNU General Public License, version 2, as
|
7 |
+
published by the Free Software Foundation.
|
8 |
+
|
9 |
+
This program is distributed in the hope that it will be useful,
|
10 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12 |
+
GNU General Public License for more details.
|
13 |
+
|
14 |
+
You should have received a copy of the GNU General Public License
|
15 |
+
along with this program; if not, write to the Free Software
|
16 |
+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
17 |
+
*/
|
18 |
+
|
19 |
+
// Require thumbnail provider class
|
20 |
+
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-video-thumbnails-provider.php' );
|
21 |
+
|
22 |
+
class Livestream_Thumbnails extends Video_Thumbnails_Provider {
|
23 |
+
|
24 |
+
// Human-readable name of the video provider
|
25 |
+
public $service_name = 'Livestream';
|
26 |
+
const service_name = 'Livestream';
|
27 |
+
// Slug for the video provider
|
28 |
+
public $service_slug = 'livestream';
|
29 |
+
const service_slug = 'livestream';
|
30 |
+
|
31 |
+
public static function register_provider( $providers ) {
|
32 |
+
$providers[self::service_slug] = new self;
|
33 |
+
return $providers;
|
34 |
+
}
|
35 |
+
|
36 |
+
// Regex strings
|
37 |
+
public $regexes = array(
|
38 |
+
'#\/\/cdn\.livestream\.com\/embed\/([A-Za-z0-9_]+)#', // Embed SRC
|
39 |
+
);
|
40 |
+
|
41 |
+
// Thumbnail URL
|
42 |
+
public function get_thumbnail_url( $id ) {
|
43 |
+
$result = 'http://thumbnail.api.livestream.com/thumbnail?name=' . $id;
|
44 |
+
return $result;
|
45 |
+
}
|
46 |
+
|
47 |
+
// Test cases
|
48 |
+
public static function get_test_cases() {
|
49 |
+
return array(
|
50 |
+
array(
|
51 |
+
'markup' => '<iframe width="560" height="340" src="http://cdn.livestream.com/embed/WFMZ_Traffic?layout=4&height=340&width=560&autoplay=false" style="border:0;outline:0" frameborder="0" scrolling="no"></iframe>',
|
52 |
+
'expected' => 'http://thumbnail.api.livestream.com/thumbnail?name=WFMZ_Traffic',
|
53 |
+
'expected_hash' => '1be02799b2fab7a4749b2187f7687412',
|
54 |
+
'name' => __( 'iFrame Embed', 'video-thumbnails' )
|
55 |
+
),
|
56 |
+
);
|
57 |
+
}
|
58 |
+
|
59 |
+
}
|
60 |
+
|
61 |
+
?>
|
php/providers/class-ted-thumbnails.php
CHANGED
@@ -35,7 +35,7 @@ class Ted_Thumbnails extends Video_Thumbnails_Provider {
|
|
35 |
|
36 |
// Regex strings
|
37 |
public $regexes = array(
|
38 |
-
'#//embed
|
39 |
);
|
40 |
|
41 |
// Thumbnail URL
|
35 |
|
36 |
// Regex strings
|
37 |
public $regexes = array(
|
38 |
+
'#//embed(?:\-ssl)?\.ted\.com/talks/([A-Za-z0-9_-]+)\.html#', // iFrame SRC
|
39 |
);
|
40 |
|
41 |
// Thumbnail URL
|
php/providers/providers.php
CHANGED
@@ -36,6 +36,7 @@ require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-sapo-thumbnails.php'
|
|
36 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-ted-thumbnails.php' );
|
37 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-twitch-thumbnails.php' );
|
38 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-googledrive-thumbnails.php' );
|
|
|
39 |
// require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-kaltura-thumbnails.php' );
|
40 |
|
41 |
// Register providers
|
@@ -58,6 +59,7 @@ add_filter( 'video_thumbnail_providers', array( 'Sapo_Thumbnails', 'register_pro
|
|
58 |
add_filter( 'video_thumbnail_providers', array( 'Ted_Thumbnails', 'register_provider' ) );
|
59 |
add_filter( 'video_thumbnail_providers', array( 'Twitch_Thumbnails', 'register_provider' ) );
|
60 |
add_filter( 'video_thumbnail_providers', array( 'Googledrive_Thumbnails', 'register_provider' ) );
|
|
|
61 |
// add_filter( 'video_thumbnail_providers', array( 'Kaltura_Thumbnails', 'register_provider' ) );
|
62 |
|
63 |
?>
|
36 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-ted-thumbnails.php' );
|
37 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-twitch-thumbnails.php' );
|
38 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-googledrive-thumbnails.php' );
|
39 |
+
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-livestream-thumbnails.php' );
|
40 |
// require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/class-kaltura-thumbnails.php' );
|
41 |
|
42 |
// Register providers
|
59 |
add_filter( 'video_thumbnail_providers', array( 'Ted_Thumbnails', 'register_provider' ) );
|
60 |
add_filter( 'video_thumbnail_providers', array( 'Twitch_Thumbnails', 'register_provider' ) );
|
61 |
add_filter( 'video_thumbnail_providers', array( 'Googledrive_Thumbnails', 'register_provider' ) );
|
62 |
+
add_filter( 'video_thumbnail_providers', array( 'Livestream_Thumbnails', 'register_provider' ) );
|
63 |
// add_filter( 'video_thumbnail_providers', array( 'Kaltura_Thumbnails', 'register_provider' ) );
|
64 |
|
65 |
?>
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://wie.ly/u/donate
|
|
4 |
Tags: Video, Thumbnails, YouTube, Vimeo, Vine, Twitch, Dailymotion, Youku, Rutube, Featured Image
|
5 |
Requires at least: 3.2
|
6 |
Tested up to: 4.1
|
7 |
-
Stable tag: 2.
|
8 |
|
9 |
Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template.
|
10 |
|
@@ -32,6 +32,7 @@ Video Thumbnails makes it easy to automatically display video thumbnails in your
|
|
32 |
* Funny or Die
|
33 |
* CollegeHumor
|
34 |
* MPORA
|
|
|
35 |
* Wistia
|
36 |
* Youku
|
37 |
* Tudou
|
@@ -131,6 +132,10 @@ The Vimeo API has a rate limit, so in rare cases you may exceed this limit. Try
|
|
131 |
|
132 |
== Changelog ==
|
133 |
|
|
|
|
|
|
|
|
|
134 |
= 2.10.3 =
|
135 |
* Various updates to providers
|
136 |
* Removed "sslverify" => false in wp_remote_get() (may cause errors on WordPress versions before 3.7)
|
4 |
Tags: Video, Thumbnails, YouTube, Vimeo, Vine, Twitch, Dailymotion, Youku, Rutube, Featured Image
|
5 |
Requires at least: 3.2
|
6 |
Tested up to: 4.1
|
7 |
+
Stable tag: 2.11
|
8 |
|
9 |
Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template.
|
10 |
|
32 |
* Funny or Die
|
33 |
* CollegeHumor
|
34 |
* MPORA
|
35 |
+
* Livestream
|
36 |
* Wistia
|
37 |
* Youku
|
38 |
* Tudou
|
132 |
|
133 |
== Changelog ==
|
134 |
|
135 |
+
= 2.11 =
|
136 |
+
* Added support for Livestream
|
137 |
+
* Support for latest TED embed code
|
138 |
+
|
139 |
= 2.10.3 =
|
140 |
* Various updates to providers
|
141 |
* Removed "sslverify" => false in wp_remote_get() (may cause errors on WordPress versions before 3.7)
|
video-thumbnails.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: https://refactored.co/plugins/video-thumbnails
|
|
5 |
Description: Automatically retrieve video thumbnails for your posts and display them in your theme. Supports YouTube, Vimeo, Facebook, Vine, Justin.tv, Twitch, Dailymotion, Metacafe, VK, Blip, Google Drive, Funny or Die, CollegeHumor, MPORA, Wistia, Youku, and Rutube.
|
6 |
Author: Sutherland Boswell
|
7 |
Author URI: http://sutherlandboswell.com
|
8 |
-
Version: 2.
|
9 |
License: GPL2
|
10 |
Text Domain: video-thumbnails
|
11 |
Domain Path: /languages/
|
@@ -30,7 +30,7 @@ Domain Path: /languages/
|
|
30 |
|
31 |
define( 'VIDEO_THUMBNAILS_PATH', dirname(__FILE__) );
|
32 |
define( 'VIDEO_THUMBNAILS_FIELD', '_video_thumbnail' );
|
33 |
-
define( 'VIDEO_THUMBNAILS_VERSION', '2.
|
34 |
|
35 |
// Providers
|
36 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/providers.php' );
|
5 |
Description: Automatically retrieve video thumbnails for your posts and display them in your theme. Supports YouTube, Vimeo, Facebook, Vine, Justin.tv, Twitch, Dailymotion, Metacafe, VK, Blip, Google Drive, Funny or Die, CollegeHumor, MPORA, Wistia, Youku, and Rutube.
|
6 |
Author: Sutherland Boswell
|
7 |
Author URI: http://sutherlandboswell.com
|
8 |
+
Version: 2.11
|
9 |
License: GPL2
|
10 |
Text Domain: video-thumbnails
|
11 |
Domain Path: /languages/
|
30 |
|
31 |
define( 'VIDEO_THUMBNAILS_PATH', dirname(__FILE__) );
|
32 |
define( 'VIDEO_THUMBNAILS_FIELD', '_video_thumbnail' );
|
33 |
+
define( 'VIDEO_THUMBNAILS_VERSION', '2.11' );
|
34 |
|
35 |
// Providers
|
36 |
require_once( VIDEO_THUMBNAILS_PATH . '/php/providers/providers.php' );
|