Version Description
- Updated test video on options screen, as previous one had been removed
- Resulting XHTML code is better formatted, with comments identifying code location
- Confirmed WP 3.0 compatibility
=
Download this release
Release Info
Developer | dartiss |
Plugin | YouTube Embed |
Version | 1.1 |
Comparing to | |
See all releases |
Code changes from version 1.0 to 1.1
- readme.txt +11 -3
- youtube-embed-options.php +1 -1
- youtube-embed.php +13 -10
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: dartiss
|
3 |
Donate link: http://tinyurl.com/bdc4uu
|
4 |
Tags: YouTube, XHTML, Video, Embed, Playlist, Thumbnail
|
5 |
-
Requires at least: 2.0
|
6 |
-
Tested up to:
|
7 |
-
Stable tag: 1.
|
8 |
|
9 |
YouTube Embed is a powerful, but simple to use, method of embedding YouTube videos in your WordPress theme.
|
10 |
|
@@ -150,11 +150,19 @@ Feel free to report any problems, or suggestions for enhancements, to me either
|
|
150 |
= 1.0 =
|
151 |
* Initial release
|
152 |
|
|
|
|
|
|
|
|
|
|
|
153 |
== Upgrade Notice ==
|
154 |
|
155 |
= 1.0 =
|
156 |
* Initial release
|
157 |
|
|
|
|
|
|
|
158 |
== Parameters ==
|
159 |
|
160 |
The following parameters can be specified for any embedded YouTube video. Some of these will also work with playlists but, due to a lack of YouTube documentation on the subject, I'm unable to say which they are.
|
2 |
Contributors: dartiss
|
3 |
Donate link: http://tinyurl.com/bdc4uu
|
4 |
Tags: YouTube, XHTML, Video, Embed, Playlist, Thumbnail
|
5 |
+
Requires at least: 2.0
|
6 |
+
Tested up to: 3.0
|
7 |
+
Stable tag: 1.1
|
8 |
|
9 |
YouTube Embed is a powerful, but simple to use, method of embedding YouTube videos in your WordPress theme.
|
10 |
|
150 |
= 1.0 =
|
151 |
* Initial release
|
152 |
|
153 |
+
= 1.1 =
|
154 |
+
* Updated test video on options screen, as previous one had been removed
|
155 |
+
* Resulting XHTML code is better formatted, with comments identifying code location
|
156 |
+
* Confirmed WP 3.0 compatibility
|
157 |
+
|
158 |
== Upgrade Notice ==
|
159 |
|
160 |
= 1.0 =
|
161 |
* Initial release
|
162 |
|
163 |
+
= 1.1 =
|
164 |
+
* Update to get the test video on the options screen working again!
|
165 |
+
|
166 |
== Parameters ==
|
167 |
|
168 |
The following parameters can be specified for any embedded YouTube video. Some of these will also work with playlists but, due to a lack of YouTube documentation on the subject, I'm unable to say which they are.
|
youtube-embed-options.php
CHANGED
@@ -157,7 +157,7 @@ if (!is_array($options)) {
|
|
157 |
|
158 |
<h3>YouTube Video Sample</h3>
|
159 |
<p>This uses the above settings, once they have been saved.</p>
|
160 |
-
<p><?php youtube_video_embed("
|
161 |
|
162 |
<h3>Further Help</h3>
|
163 |
<p>Comprehensive instructions can be found on <a href="http://www.artiss.co.uk/youtube-embed">the official site page</a>, along with <a href="http://www.artiss.co.uk/category/software/wordpress">blog updates</a> and a comprehensive <a href="http://www.artiss.co.uk/category/software/wordpress/feed">news feed</a>.</p>
|
157 |
|
158 |
<h3>YouTube Video Sample</h3>
|
159 |
<p>This uses the above settings, once they have been saved.</p>
|
160 |
+
<p><?php youtube_video_embed("Zohjxz8RSyg"); ?></p>
|
161 |
|
162 |
<h3>Further Help</h3>
|
163 |
<p>Comprehensive instructions can be found on <a href="http://www.artiss.co.uk/youtube-embed">the official site page</a>, along with <a href="http://www.artiss.co.uk/category/software/wordpress">blog updates</a> and a comprehensive <a href="http://www.artiss.co.uk/category/software/wordpress/feed">news feed</a>.</p>
|
youtube-embed.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: YouTube Embed
|
4 |
Plugin URI: http://www.artiss.co.uk/youtube-embed
|
5 |
Description: Embed YouTube Videos in WordPress
|
6 |
-
Version: 1.
|
7 |
Author: David Artiss
|
8 |
Author URI: http://www.artiss.co.uk
|
9 |
*/
|
@@ -83,6 +83,7 @@ function youtube_short_url($id) {return "http://youtu.be/".$id;}
|
|
83 |
|
84 |
// Generate XHTML compatible YouTube embed code
|
85 |
function generate_youtube_code($id,$type,$width,$height,$fullscreen,$related,$autoplay,$loop,$egm,$border,$color1,$color2,$start,$hd,$search,$info,$annotation,$cc,$style,$widget="") {
|
|
|
86 |
// Ensure an ID is passed
|
87 |
if (($id=="")&&(strtolower($widget)!="yes")) {
|
88 |
return youtube_embed_error("No video/playlist ID has been supplied");
|
@@ -101,7 +102,7 @@ function generate_youtube_code($id,$type,$width,$height,$fullscreen,$related,$au
|
|
101 |
$options = array('width'=>'425','height'=>'355','border'=>'0','fullscreen'=>'0','hd'=>'1','color1'=>'2b405b','color2'=>'6b8ab6','style'=>'','autoplay'=>'0','start'=>'0','loop'=>'0','cc'=>'0','annotation'=>'1','egm'=>'0','related'=>'0','info'=>'1','search'=>'1');
|
102 |
}
|
103 |
}
|
104 |
-
if ($width=="") {$width=$options['width'];}
|
105 |
if ($height=="") {$height=$options['height'];}
|
106 |
if ($fullscreen=="") {$fullscreen=$options['fullscreen'];}
|
107 |
if ($related=="") {$related=$options['related'];}
|
@@ -124,13 +125,15 @@ function generate_youtube_code($id,$type,$width,$height,$fullscreen,$related,$au
|
|
124 |
// Generate parameters to add to URL
|
125 |
$paras="&fs=".$fullscreen."&rel=".$related."&autoplay=".$autoplay."&loop=".$loop."&egm=".$egm."&border=".$border."&color1=0x".$color1."&color2=0x".$color2."&hd=".$hd."&showsearch=".$search."&showinfo=".$info."&iv_load_policy=".$annotation."&cc_load_policy=".$cc;
|
126 |
if ($start!=0) {$paras=$paras."&start=".$start;}
|
127 |
-
// Write out
|
128 |
-
|
129 |
-
$
|
130 |
-
$result
|
131 |
-
|
132 |
-
$result
|
133 |
-
|
|
|
|
|
134 |
return $result;
|
135 |
}
|
136 |
}
|
@@ -141,7 +144,7 @@ function generate_thumbnail_code($id,$style,$class,$rel,$target,$width,$height,$
|
|
141 |
$youtube_code="<a href=\"http://www.youtube.com/watch?v=".$id."\"";
|
142 |
if ($style!="") {$youtube_code=$youtube_code." style=\"".$style."\"";}
|
143 |
if ($class!="") {$youtube_code=$youtube_code." class=\"".$class."\"";}
|
144 |
-
if ($rel!="") {$youtube_code=$youtube_code." rel=\"".$rel."\"";}
|
145 |
if ($target!="") {$youtube_code=$youtube_code." target=\"".$target."\"";}
|
146 |
$youtube_code=$youtube_code."><img src=\"http://img.youtube.com/vi/".$id."/2.jpg\"";
|
147 |
if ($width!="") {$youtube_code=$youtube_code." width=\"".$width."px\"";}
|
3 |
Plugin Name: YouTube Embed
|
4 |
Plugin URI: http://www.artiss.co.uk/youtube-embed
|
5 |
Description: Embed YouTube Videos in WordPress
|
6 |
+
Version: 1.1
|
7 |
Author: David Artiss
|
8 |
Author URI: http://www.artiss.co.uk
|
9 |
*/
|
83 |
|
84 |
// Generate XHTML compatible YouTube embed code
|
85 |
function generate_youtube_code($id,$type,$width,$height,$fullscreen,$related,$autoplay,$loop,$egm,$border,$color1,$color2,$start,$hd,$search,$info,$annotation,$cc,$style,$widget="") {
|
86 |
+
$version=1.1;
|
87 |
// Ensure an ID is passed
|
88 |
if (($id=="")&&(strtolower($widget)!="yes")) {
|
89 |
return youtube_embed_error("No video/playlist ID has been supplied");
|
102 |
$options = array('width'=>'425','height'=>'355','border'=>'0','fullscreen'=>'0','hd'=>'1','color1'=>'2b405b','color2'=>'6b8ab6','style'=>'','autoplay'=>'0','start'=>'0','loop'=>'0','cc'=>'0','annotation'=>'1','egm'=>'0','related'=>'0','info'=>'1','search'=>'1');
|
103 |
}
|
104 |
}
|
105 |
+
if ($width=="") {$width=$options['width'];}
|
106 |
if ($height=="") {$height=$options['height'];}
|
107 |
if ($fullscreen=="") {$fullscreen=$options['fullscreen'];}
|
108 |
if ($related=="") {$related=$options['related'];}
|
125 |
// Generate parameters to add to URL
|
126 |
$paras="&fs=".$fullscreen."&rel=".$related."&autoplay=".$autoplay."&loop=".$loop."&egm=".$egm."&border=".$border."&color1=0x".$color1."&color2=0x".$color2."&hd=".$hd."&showsearch=".$search."&showinfo=".$info."&iv_load_policy=".$annotation."&cc_load_policy=".$cc;
|
127 |
if ($start!=0) {$paras=$paras."&start=".$start;}
|
128 |
+
// Write out code
|
129 |
+
$result="<!-- YouTube Embed v".$version." | http://www.artiss.co.uk/youtube-embed -->\n";
|
130 |
+
if ($style!="") {$result.="<div style=\"".$style."\">\n";}
|
131 |
+
$result.="<object type=\"application/x-shockwave-flash\" data=\"http://www.youtube.com/".$type."/".$id.$paras."\" width=\"".$width."px\" height=\"".$height."px\">\n";
|
132 |
+
$result.="<param name=\"movie\" value=\"http://www.youtube.com/".$type."/".$id.$paras."\"></param>\n";
|
133 |
+
if ($fullscreen==1) {$result.="<param name=\"allowFullScreen\" value=\"true\"></param>\n";}
|
134 |
+
$result.="</object>\n";
|
135 |
+
if ($style!="") {$result.="</div>\n";}
|
136 |
+
$result.="<!-- End of YouTube Embed code -->\n";
|
137 |
return $result;
|
138 |
}
|
139 |
}
|
144 |
$youtube_code="<a href=\"http://www.youtube.com/watch?v=".$id."\"";
|
145 |
if ($style!="") {$youtube_code=$youtube_code." style=\"".$style."\"";}
|
146 |
if ($class!="") {$youtube_code=$youtube_code." class=\"".$class."\"";}
|
147 |
+
if ($rel!="") {$youtube_code=$youtube_code." rel=\"".$rel."\"";}
|
148 |
if ($target!="") {$youtube_code=$youtube_code." target=\"".$target."\"";}
|
149 |
$youtube_code=$youtube_code."><img src=\"http://img.youtube.com/vi/".$id."/2.jpg\"";
|
150 |
if ($width!="") {$youtube_code=$youtube_code." width=\"".$width."px\"";}
|