Video Thumbnails - Version 0.2.2

Version Description

  • Added support for Vimeo Shortcode
Download this release

Release Info

Developer sutherlandboswell
Plugin Icon 128x128 Video Thumbnails
Version 0.2.2
Comparing to
See all releases

Code changes from version 0.3 to 0.2.2

Files changed (2) hide show
  1. readme.txt +6 -22
  2. video-thumbnails.php +4 -25
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: http://sutherlandboswell.com
4
  Tags: Video, YouTube, Vimeo, Thumbnails
5
  Requires at least: 3.0
6
  Tested up to: 3.0.1
7
- Stable tag: 0.3
8
 
9
  Video Thumbnails is a simple plugin that makes it easier to display video thumbnails in your template.
10
 
@@ -14,11 +14,10 @@ Video Thumbnails makes it simple to display video thumbnails in your templates.
14
 
15
  Video Thumbnails currently supports:
16
 
17
- * YouTube
18
- * Vimeo
19
- * Blip.tv
20
- * JR Embed (this plugin seems to have disappeared)
21
- * [Vimeo Shortcode](http://blog.esimplestudios.com/2010/08/embedding-vimeo-videos-in-wordpress/)
22
 
23
  When using `video_thumbnail()` and no thumbnail is found, a default thumbnail is echoed, which can be changed by replacing the `default.jpg` file found in your `/plugins/video-thumbnails/` directory.
24
 
@@ -48,12 +47,6 @@ Coming Soon
48
 
49
  == Changelog ==
50
 
51
- = 0.3 =
52
- * Added basic support for Blip.tv auto embedded using URLs in this format: http://blip.tv/file/12345
53
-
54
- = 0.2.3 =
55
- * Added support for any Vimeo URL
56
-
57
  = 0.2.2 =
58
  * Added support for [Vimeo Shortcode](http://blog.esimplestudios.com/2010/08/embedding-vimeo-videos-in-wordpress/)
59
 
@@ -79,13 +72,4 @@ Coming Soon
79
  == Known Issues ==
80
 
81
  * The Vimeo API is rate limited, so the default image will be displayed when the limit has been exceeded. I'm planning to add local copies of files in a future release to solve this problem.
82
- * While not really an issue, the current method for only displaying a thumbnail if one is found seems like it could be streamlined, so if you have any suggestions let me know.
83
-
84
- == Roadmap ==
85
-
86
- This plugin is still very young, and has a future planned as the ultimate plugin for video thumbnails. Here's some of the planned additions:
87
-
88
- * More comprehensive Blip.tv support
89
- * Local thumbnail storage
90
- * More services
91
- * More shortcode plugins
4
  Tags: Video, YouTube, Vimeo, Thumbnails
5
  Requires at least: 3.0
6
  Tested up to: 3.0.1
7
+ Stable tag: 0.2.2
8
 
9
  Video Thumbnails is a simple plugin that makes it easier to display video thumbnails in your template.
10
 
14
 
15
  Video Thumbnails currently supports:
16
 
17
+ * YouTube
18
+ * Vimeo
19
+ * JR Embed (uses `[youtube id=VIDEO_ID]` to embed videos, I've modified mine to also allow `[vimeo id=VIDEO_ID]`)
20
+ * [Vimeo Shortcode](http://blog.esimplestudios.com/2010/08/embedding-vimeo-videos-in-wordpress/)
 
21
 
22
  When using `video_thumbnail()` and no thumbnail is found, a default thumbnail is echoed, which can be changed by replacing the `default.jpg` file found in your `/plugins/video-thumbnails/` directory.
23
 
47
 
48
  == Changelog ==
49
 
 
 
 
 
 
 
50
  = 0.2.2 =
51
  * Added support for [Vimeo Shortcode](http://blog.esimplestudios.com/2010/08/embedding-vimeo-videos-in-wordpress/)
52
 
72
  == Known Issues ==
73
 
74
  * The Vimeo API is rate limited, so the default image will be displayed when the limit has been exceeded. I'm planning to add local copies of files in a future release to solve this problem.
75
+ * While not really an issue, the current method for only displaying a thumbnail if one is found seems like it could be streamlined, so if you have any suggestions let me know.
 
 
 
 
 
 
 
 
 
video-thumbnails.php CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://sutherlandboswell.com/2010/11/wordpress-video-thumbnails/
5
  Description: A plugin designed to fetch video thumbnails. Use <code>&lt;?php video_thumbnail(); ?&gt;</code> in a loop to return a URL for the thumbnail of the first video in a post. Currently works with YouTube and Vimeo, and with the JR_embed plugin.
6
  Author: Sutherland Boswell
7
  Author URI: http://sutherlandboswell.com
8
- Version: 0.3
9
  License: GPL2
10
  */
11
  /* Copyright 2010 Sutherland Boswell (email : sutherland.boswell@gmail.com)
@@ -38,16 +38,6 @@ function getVimeoInfo($id, $info = 'thumbnail_large') {
38
  return $output;
39
  };
40
 
41
- // Blip.tv Functions
42
- function getBliptvInfo($id) {
43
- $xml = simplexml_load_file("http://blip.tv/file/$id?skin=rss");
44
- $result = $xml->xpath("/rss/channel/item/media:thumbnail/@url");
45
- foreach($result as $element) {
46
- $thumbnail = $element["url"];
47
- }
48
- return $thumbnail;
49
- }
50
-
51
  // The Main Event
52
  function get_video_thumbnail() {
53
 
@@ -86,11 +76,6 @@ function get_video_thumbnail() {
86
  preg_match('#\[vimeo id=([A-Za-z0-9\-_]+)]#s', $markup, $matches);
87
  }
88
 
89
- // If we still haven't found anything, check for Vimeo URL
90
- if(!isset($matches[1])) {
91
- preg_match('#http://www.vimeo.com/([A-Za-z0-9\-_]+)#s', $markup, $matches);
92
- }
93
-
94
  // If we still haven't found anything, check for Vimeo shortcode
95
  if(!isset($matches[1])) {
96
  preg_match('#\[vimeo clip_id="([A-Za-z0-9\-_]+)"[^>]*]#s', $markup, $matches);
@@ -107,15 +92,9 @@ function get_video_thumbnail() {
107
  }
108
  }
109
 
110
- // If nothing has been found, look for Blip.tv
111
- else {
112
- preg_match('#http://blip.tv/file/([0-9]+)#s', $markup, $matches);
113
- if(isset($matches[1])) {
114
- return getBliptvInfo($matches[1]);
115
- }
116
- else {
117
- return null;
118
- }
119
  }
120
  }
121
 
5
  Description: A plugin designed to fetch video thumbnails. Use <code>&lt;?php video_thumbnail(); ?&gt;</code> in a loop to return a URL for the thumbnail of the first video in a post. Currently works with YouTube and Vimeo, and with the JR_embed plugin.
6
  Author: Sutherland Boswell
7
  Author URI: http://sutherlandboswell.com
8
+ Version: 0.2.2
9
  License: GPL2
10
  */
11
  /* Copyright 2010 Sutherland Boswell (email : sutherland.boswell@gmail.com)
38
  return $output;
39
  };
40
 
 
 
 
 
 
 
 
 
 
 
41
  // The Main Event
42
  function get_video_thumbnail() {
43
 
76
  preg_match('#\[vimeo id=([A-Za-z0-9\-_]+)]#s', $markup, $matches);
77
  }
78
 
 
 
 
 
 
79
  // If we still haven't found anything, check for Vimeo shortcode
80
  if(!isset($matches[1])) {
81
  preg_match('#\[vimeo clip_id="([A-Za-z0-9\-_]+)"[^>]*]#s', $markup, $matches);
92
  }
93
  }
94
 
95
+ // If nothing has been found, show the default
96
+ else {
97
+ return null;
 
 
 
 
 
 
98
  }
99
  }
100