WP YouTube Lyte - Version 0.5.0

Version Description

  • implemented the new HTML5 YouTube embed code and removed my newTube.js-hack for html5-embedding
  • player size now applies to Flash- and the new HTML5-embeds
Download this release

Release Info

Developer futtta
Plugin Icon 128x128 WP YouTube Lyte
Version 0.5.0
Comparing to
See all releases

Code changes from version 0.4.1 to 0.5.0

lyte/lyte-min.js CHANGED
@@ -1 +1 @@
1
- if (typeof bU!=="string") var bU="http://futtta.be/lyte/";function lyte(){lytes=getElementsByClassName("lyte");for(var i=0;i<lytes.length;i++){lyte_id=lytes[i].id;p=document.getElementById(lyte_id);jsonUrl="http://gdata.youtube.com/feeds/api/videos/"+lyte_id+"?fields=id,title&alt=json-in-script&callback=parseMe";loadScript(jsonUrl);pl=document.createElement('div');p.appendChild(pl);p.onclick=nolyte;setStyle(p,'margin:5px 0px;width:'+pW+'px;height:'+pH+'px;background-color:#000;');pl.id="lyte_"+lyte_id;setStyle(pl,'cursor:pointer;text-align:center;overflow:hidden;height:'+pH+'px;width:'+pW+'px;position:relative;margin:0px;');pl.innerHTML="<img src=\""+bU+"play.png\" alt=\"Click to play this video\" style=\"margin-top:"+((pH/2)-30)+"px;opacity:0.8;\" onmouseover=\"this.style.opacity=1;\" onmouseout=\"this.style.opacity=0.8;\"/><img src=\""+bU+"controls.png\" width=\"100%\" alt=\"\" style=\"position:absolute; left:0px; bottom:0px; max-width:"+pW+"px; padding:0px; spacing:0px;\"/>";if(pH>385){vA="center"}else{vA="top"};pl.style.background="#000 url(http://img.youtube.com/vi/"+lyte_id+"/0.jpg) no-repeat center "+vA}}function nolyte(){this.onclick="";this.innerHTML="<embed src=\"http://www.youtube.com/v/"+this.id+"&autoplay=1&rel=0&egm=0&fs=1\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" id=\"lyte_"+this.id+"\" wmode=\"transparent\" width=\""+pW+"\" height=\""+pH+"\" allowscriptaccess=\"always\"></embed>"}function parseMe(r){title=r.entry.title.$t;idu=r.entry.id.$t;p=document.getElementById("lyte_"+idu.substring((idu.length-11)));c=document.createElement('div');p.appendChild(c);setStyle(c,"position:relative;margin:-"+((pH/2)+15)+"px 5px;padding:5px;background-color:rgba(0,0,0,0.3);-moz-border-radius:7px;-webkit-border-radius:7px;border-radius:7px");t=document.createElement('div');c.appendChild(t);s="font-weight:bold;font-size:16px;color:#ffffff;font-family:sans-serif;text-align:left;";setStyle(t,s);t.innerHTML=title;}function setStyle(e,s){if(typeof e.setAttribute==="function")e.setAttribute('style',s);else if(typeof e.style.setAttribute==="object")e.style.setAttribute('cssText',s)}function loadScript(url){scr=document.createElement('script');scr.src=url;scr.type='text/javascript';document.getElementsByTagName('head')[0].appendChild(scr)}var getElementsByClassName=function(className,tag,elm){if(document.getElementsByClassName){getElementsByClassName=function(className,tag,elm){elm=elm||document;var elements=elm.getElementsByClassName(className),nodeName=(tag)?new RegExp("\\b"+tag+"\\b","i"):null,returnElements=[],current;for(var i=0,il=elements.length;i<il;i+=1){current=elements[i];if(!nodeName||nodeName.test(current.nodeName)){returnElements.push(current)}}return returnElements}}else if(document.evaluate){getElementsByClassName=function(className,tag,elm){tag=tag||"*";elm=elm||document;var classes=className.split(" "),classesToCheck="",xhtmlNamespace="http://www.w3.org/1999/xhtml",namespaceResolver=(document.documentElement.namespaceURI===xhtmlNamespace)?xhtmlNamespace:null,returnElements=[],elements,node;for(var j=0,jl=classes.length;j<jl;j+=1){classesToCheck+="[contains(concat(' ', @class, ' '), ' "+classes[j]+" ')]"}try{elements=document.evaluate(".//"+tag+classesToCheck,elm,namespaceResolver,0,null)}catch(e){elements=document.evaluate(".//"+tag+classesToCheck,elm,null,0,null)}while((node=elements.iterateNext())){returnElements.push(node)}return returnElements}}else{getElementsByClassName=function(className,tag,elm){tag=tag||"*";elm=elm||document;var classes=className.split(" "),classesToCheck=[],elements=(tag==="*"&&elm.all)?elm.all:elm.getElementsByTagName(tag),current,returnElements=[],match;for(var k=0,kl=classes.length;k<kl;k+=1){classesToCheck.push(new RegExp("(^|\\s)"+classes[k]+"(\\s|$)"))}for(var l=0,ll=elements.length;l<ll;l+=1){current=elements[l];match=false;for(var m=0,ml=classesToCheck.length;m<ml;m+=1){match=classesToCheck[m].test(current.className);if(!match){break}}if(match){returnElements.push(current)}}return returnElements}}return getElementsByClassName(className,tag,elm)};lyte();
1
+ if (typeof bU!=="string") var bU="http://futtta.be/lyte/";function lyte(){lytes=getElementsByClassName("lyte");for(var i=0;i<lytes.length;i++){lyte_id=lytes[i].id;p=document.getElementById(lyte_id);jsonUrl="http://gdata.youtube.com/feeds/api/videos/"+lyte_id+"?fields=id,title&alt=json-in-script&callback=parseMe";loadScript(jsonUrl);pl=document.createElement('div');p.appendChild(pl);p.onclick=nolyte;setStyle(p,'margin:5px 0px;width:'+pW+'px;height:'+pH+'px;background-color:#000;');pl.id="lyte_"+lyte_id;setStyle(pl,'cursor:pointer;text-align:center;overflow:hidden;height:'+pH+'px;width:'+pW+'px;position:relative;margin:0px;');pl.innerHTML="<img src=\""+bU+"play.png\" alt=\"Click to play this video\" style=\"margin-top:"+((pH/2)-30)+"px;opacity:0.8;\" onmouseover=\"this.style.opacity=1;\" onmouseout=\"this.style.opacity=0.8;\"/><img src=\""+bU+"controls.png\" width=\"100%\" alt=\"\" style=\"position:absolute; left:0px; bottom:0px; max-width:"+pW+"px; padding:0px; spacing:0px;\"/>";if(pH>385){vA="center"}else{vA="top"};pl.style.background="#000 url(http://img.youtube.com/vi/"+lyte_id+"/0.jpg) no-repeat center "+vA}}function nolyte(){this.onclick="";this.innerHTML="<embed src=\"http://www.youtube-nocookie.com/v/"+this.id+"&autoplay=1&rel=0&egm=0&fs=1\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" id=\"lyte_"+this.id+"\" wmode=\"transparent\" width=\""+pW+"\" height=\""+pH+"\" allowscriptaccess=\"always\"></embed>"}function parseMe(r){title=r.entry.title.$t;idu=r.entry.id.$t;p=document.getElementById("lyte_"+idu.substring((idu.length-11)));c=document.createElement('div');p.appendChild(c);setStyle(c,"position:relative;margin:-"+((pH/2)+15)+"px 5px;padding:5px;background-color:rgba(0,0,0,0.3);-moz-border-radius:7px;-webkit-border-radius:7px;border-radius:7px");t=document.createElement('div');c.appendChild(t);s="font-weight:bold;font-size:16px;color:#ffffff;font-family:sans-serif;text-align:left;";setStyle(t,s);t.innerHTML=title;}function setStyle(e,s){if(typeof e.setAttribute==="function")e.setAttribute('style',s);else if(typeof e.style.setAttribute==="object")e.style.setAttribute('cssText',s)}function loadScript(url){scr=document.createElement('script');scr.src=url;scr.type='text/javascript';document.getElementsByTagName('head')[0].appendChild(scr)}var getElementsByClassName=function(className,tag,elm){if(document.getElementsByClassName){getElementsByClassName=function(className,tag,elm){elm=elm||document;var elements=elm.getElementsByClassName(className),nodeName=(tag)?new RegExp("\\b"+tag+"\\b","i"):null,returnElements=[],current;for(var i=0,il=elements.length;i<il;i+=1){current=elements[i];if(!nodeName||nodeName.test(current.nodeName)){returnElements.push(current)}}return returnElements}}else if(document.evaluate){getElementsByClassName=function(className,tag,elm){tag=tag||"*";elm=elm||document;var classes=className.split(" "),classesToCheck="",xhtmlNamespace="http://www.w3.org/1999/xhtml",namespaceResolver=(document.documentElement.namespaceURI===xhtmlNamespace)?xhtmlNamespace:null,returnElements=[],elements,node;for(var j=0,jl=classes.length;j<jl;j+=1){classesToCheck+="[contains(concat(' ', @class, ' '), ' "+classes[j]+" ')]"}try{elements=document.evaluate(".//"+tag+classesToCheck,elm,namespaceResolver,0,null)}catch(e){elements=document.evaluate(".//"+tag+classesToCheck,elm,null,0,null)}while((node=elements.iterateNext())){returnElements.push(node)}return returnElements}}else{getElementsByClassName=function(className,tag,elm){tag=tag||"*";elm=elm||document;var classes=className.split(" "),classesToCheck=[],elements=(tag==="*"&&elm.all)?elm.all:elm.getElementsByTagName(tag),current,returnElements=[],match;for(var k=0,kl=classes.length;k<kl;k+=1){classesToCheck.push(new RegExp("(^|\\s)"+classes[k]+"(\\s|$)"))}for(var l=0,ll=elements.length;l<ll;l+=1){current=elements[l];match=false;for(var m=0,ml=classesToCheck.length;m<ml;m+=1){match=classesToCheck[m].test(current.className);if(!match){break}}if(match){returnElements.push(current)}}return returnElements}}return getElementsByClassName(className,tag,elm)};lyte();
lyte/lyte-newtube-min.js CHANGED
@@ -1 +1 @@
1
- if (typeof bU!=="string") var bU="http://futtta.be/lyte/";function lyte(){lytes=getElementsByClassName("lyte");for(var i=0;i<lytes.length;i++){lyte_id=lytes[i].id;p=document.getElementById(lyte_id);jsonUrl="http://gdata.youtube.com/feeds/api/videos/"+lyte_id+"?fields=id,title&alt=json-in-script&callback=parseMe";loadScript(jsonUrl);pl=document.createElement('div');p.appendChild(pl);p.onclick=nolyte;setStyle(p,'width:650px;height:390px;margin:5px 0px;background-color:#000;overflow:hidden;position: relative;');pl.id="lyte_"+lyte_id;setStyle(pl,"overflow:hidden;width:650px;height:390px;cursor:pointer;text-align:center;overflow:hidden;position:relative;margin:0px;");pl.innerHTML="<img src=\""+bU+"play.png\" alt=\"Click to play this video\" style=\"margin-top:165px;opacity:0.8;\" onmouseover=\"this.style.opacity=1;\" onmouseout=\"this.style.opacity=0.8;\"/><img src=\""+bU+"controls-newtube.png\" width=\"100%\" alt=\"\" style=\"position:absolute;left:0px;bottom:0px;max-width:650px;padding:0px;spacing:0px;\"/>";pl.style.background="#000 url(http://img.youtube.com/vi/"+lyte_id+"/0.jpg) no-repeat top center"}}function nolyte(){this.onclick="";uA=navigator.userAgent;if (uA.indexOf('AppleWebKit')!=-1){vC="-125px";hC="-17px";} else {vC="-125px";hC="-25px";} this.innerHTML="<iframe style=\"overflow:hidden;height:1600px;width:1024px;position:absolute;top:"+vC+";left:"+hC+";\" src=\"http://www.youtube.com/watch?v="+this.id+"\"></iframe><br/>"}function parseMe(r){title=r.entry.title.$t;idu=r.entry.id.$t;p=document.getElementById("lyte_"+idu.substring((idu.length-11)));c=document.createElement('div');p.appendChild(c);setStyle(c,"position:relative;margin:-210px 5px;padding:5px;background-color:rgba(0,0,0,0.3);-moz-border-radius:7px;-webkit-border-radius:7px;border-radius:7px");t=document.createElement('div');c.appendChild(t);s="font-weight:bold;font-size:16px;color:#ffffff;font-family:sans-serif;text-align:left;";setStyle(t,s);t.innerHTML=title;}function setStyle(e,s){if(typeof e.setAttribute==="function")e.setAttribute('style',s);else if(typeof e.style.setAttribute==="object")e.style.setAttribute('cssText',s)}function loadScript(url){scr=document.createElement('script');scr.src=url;scr.type='text/javascript';document.getElementsByTagName('head')[0].appendChild(scr)}var getElementsByClassName=function(className,tag,elm){if(document.getElementsByClassName){getElementsByClassName=function(className,tag,elm){elm=elm||document;var elements=elm.getElementsByClassName(className),nodeName=(tag)?new RegExp("\\b"+tag+"\\b","i"):null,returnElements=[],current;for(var i=0,il=elements.length;i<il;i+=1){current=elements[i];if(!nodeName||nodeName.test(current.nodeName)){returnElements.push(current)}}return returnElements}}else if(document.evaluate){getElementsByClassName=function(className,tag,elm){tag=tag||"*";elm=elm||document;var classes=className.split(" "),classesToCheck="",xhtmlNamespace="http://www.w3.org/1999/xhtml",namespaceResolver=(document.documentElement.namespaceURI===xhtmlNamespace)?xhtmlNamespace:null,returnElements=[],elements,node;for(var j=0,jl=classes.length;j<jl;j+=1){classesToCheck+="[contains(concat(' ', @class, ' '), ' "+classes[j]+" ')]"}try{elements=document.evaluate(".//"+tag+classesToCheck,elm,namespaceResolver,0,null)}catch(e){elements=document.evaluate(".//"+tag+classesToCheck,elm,null,0,null)}while((node=elements.iterateNext())){returnElements.push(node)}return returnElements}}else{getElementsByClassName=function(className,tag,elm){tag=tag||"*";elm=elm||document;var classes=className.split(" "),classesToCheck=[],elements=(tag==="*"&&elm.all)?elm.all:elm.getElementsByTagName(tag),current,returnElements=[],match;for(var k=0,kl=classes.length;k<kl;k+=1){classesToCheck.push(new RegExp("(^|\\s)"+classes[k]+"(\\s|$)"))}for(var l=0,ll=elements.length;l<ll;l+=1){current=elements[l];match=false;for(var m=0,ml=classesToCheck.length;m<ml;m+=1){match=classesToCheck[m].test(current.className);if(!match){break}}if(match){returnElements.push(current)}}return returnElements}}return getElementsByClassName(className,tag,elm)};lyte();
1
+ if (typeof bU!=="string") var bU="http://futtta.be/lyte/";function lyte(){lytes=getElementsByClassName("lyte");for(var i=0;i<lytes.length;i++){lyte_id=lytes[i].id;p=document.getElementById(lyte_id);jsonUrl="http://gdata.youtube.com/feeds/api/videos/"+lyte_id+"?fields=id,title&alt=json-in-script&callback=parseMe";loadScript(jsonUrl);pl=document.createElement('div');p.appendChild(pl);p.onclick=nolyte;setStyle(p,'margin:5px 0px;width:'+pW+'px;height:'+pH+'px;background-color:#000;');pl.id="lyte_"+lyte_id;setStyle(pl,'cursor:pointer;text-align:center;overflow:hidden;height:'+pH+'px;width:'+pW+'px;position:relative;margin:0px;');pl.innerHTML="<img src=\""+bU+"play.png\" alt=\"Click to play this video\" style=\"margin-top:"+((pH/2)-30)+"px;opacity:0.8;\" onmouseover=\"this.style.opacity=1;\" onmouseout=\"this.style.opacity=0.8;\"/><img src=\""+bU+"controls-newtube.png\" width=\"100%\" alt=\"\" style=\"position:absolute; left:0px; bottom:0px; max-width:"+pW+"px; padding:0px; spacing:0px;\"/>";if(pH>385){vA="center"}else{vA="top"};pl.style.background="#000 url(http://img.youtube.com/vi/"+lyte_id+"/0.jpg) no-repeat center "+vA}}function nolyte(){this.onclick="";this.innerHTML="<iframe class=\"youtube-player\" type=\"text/html\" width=\""+pW+"\" height=\""+pH+"\" src=\"http://www.youtube.com/embed/"+this.id+"?autoplay=1\" frameborder=\"0\"></iframe>"}function parseMe(r){title=r.entry.title.$t;idu=r.entry.id.$t;p=document.getElementById("lyte_"+idu.substring((idu.length-11)));c=document.createElement('div');p.appendChild(c);setStyle(c,"position:relative;margin:-"+((pH/2)+15)+"px 5px;padding:5px;background-color:rgba(0,0,0,0.3);-moz-border-radius:7px;-webkit-border-radius:7px;border-radius:7px");t=document.createElement('div');c.appendChild(t);s="font-weight:bold;font-size:16px;color:#ffffff;font-family:sans-serif;text-align:left;";setStyle(t,s);t.innerHTML=title;}function setStyle(e,s){if(typeof e.setAttribute==="function")e.setAttribute('style',s);else if(typeof e.style.setAttribute==="object")e.style.setAttribute('cssText',s)}function loadScript(url){scr=document.createElement('script');scr.src=url;scr.type='text/javascript';document.getElementsByTagName('head')[0].appendChild(scr)}var getElementsByClassName=function(className,tag,elm){if(document.getElementsByClassName){getElementsByClassName=function(className,tag,elm){elm=elm||document;var elements=elm.getElementsByClassName(className),nodeName=(tag)?new RegExp("\\b"+tag+"\\b","i"):null,returnElements=[],current;for(var i=0,il=elements.length;i<il;i+=1){current=elements[i];if(!nodeName||nodeName.test(current.nodeName)){returnElements.push(current)}}return returnElements}}else if(document.evaluate){getElementsByClassName=function(className,tag,elm){tag=tag||"*";elm=elm||document;var classes=className.split(" "),classesToCheck="",xhtmlNamespace="http://www.w3.org/1999/xhtml",namespaceResolver=(document.documentElement.namespaceURI===xhtmlNamespace)?xhtmlNamespace:null,returnElements=[],elements,node;for(var j=0,jl=classes.length;j<jl;j+=1){classesToCheck+="[contains(concat(' ', @class, ' '), ' "+classes[j]+" ')]"}try{elements=document.evaluate(".//"+tag+classesToCheck,elm,namespaceResolver,0,null)}catch(e){elements=document.evaluate(".//"+tag+classesToCheck,elm,null,0,null)}while((node=elements.iterateNext())){returnElements.push(node)}return returnElements}}else{getElementsByClassName=function(className,tag,elm){tag=tag||"*";elm=elm||document;var classes=className.split(" "),classesToCheck=[],elements=(tag==="*"&&elm.all)?elm.all:elm.getElementsByTagName(tag),current,returnElements=[],match;for(var k=0,kl=classes.length;k<kl;k+=1){classesToCheck.push(new RegExp("(^|\\s)"+classes[k]+"(\\s|$)"))}for(var l=0,ll=elements.length;l<ll;l+=1){current=elements[l];match=false;for(var m=0,ml=classesToCheck.length;m<ml;m+=1){match=classesToCheck[m].test(current.className);if(!match){break}}if(match){returnElements.push(current)}}return returnElements}}return getElementsByClassName(className,tag,elm)};lyte();
options.php CHANGED
@@ -27,15 +27,15 @@ function lyte_settings_page() {
27
  <th scope="row">Play video using Flash or HTML5-video?</th>
28
  <td>
29
  <fieldset><legend class="screen-reader-text"><span>Use Flash or HTML5 video?</span></legend>
30
- <label title="embed HTML5 video (highly experimental)"><input type="radio" name="newTube" value="1" <?php if (get_option('newTube')==="1") echo "checked" ?> /> Embed HTML5 video (<a href="http://wordpress.org/extend/plugins/wp-youtube-lyte/faq/" target="_blank">rather experimental, see FAQ</a>). Fixed player size: 650X390px.</label><br />
31
  <label title="normal YouTube embeds with Flash video"><input type="radio" name="newTube" value="0" <?php if (get_option('newTube')!=="1") echo "checked" ?> /> Normal YouTube embeds with Flash video.</label><br />
32
  </fieldset>
33
  </td>
34
  </tr>
35
  <tr valign="top">
36
- <th scope="row">Player size (not for HTML5):</th>
37
  <td>
38
- <fieldset><legend class="screen-reader-text"><span>Player size (does not work for HTML5-version)</span></legend>
39
  <?php require 'player_sizes.inc.php';
40
  $i=0;
41
  if (is_bool(get_option('size'))) { $sel = (int) $pDefault; } else { $sel= (int) get_option('size'); }
@@ -69,19 +69,4 @@ function lyte_settings_page() {
69
 
70
  </form>
71
  </div>
72
- <script type="text/javascript">
73
- jQuery(document).ready(function($) {
74
- function toggleSize() {
75
- val=$("input[name='newTube']:checked").val();
76
- if (val==0) {
77
- $('.l_size').removeAttr("disabled")
78
- } else {
79
- $('.l_size').attr("disabled","disabled")
80
- }
81
- }
82
-
83
- $("input[name='newTube']").click(function(){toggleSize()});
84
- toggleSize();
85
- })
86
- </script>
87
  <?php } ?>
27
  <th scope="row">Play video using Flash or HTML5-video?</th>
28
  <td>
29
  <fieldset><legend class="screen-reader-text"><span>Use Flash or HTML5 video?</span></legend>
30
+ <label title="embed HTML5 video (highly experimental)"><input type="radio" name="newTube" value="1" <?php if (get_option('newTube')==="1") echo "checked" ?> /> Embed HTML5 video (experimental, uses <a href="http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html" target="_blank">the brand new YouTube embed-code</a>)</label><br />
31
  <label title="normal YouTube embeds with Flash video"><input type="radio" name="newTube" value="0" <?php if (get_option('newTube')!=="1") echo "checked" ?> /> Normal YouTube embeds with Flash video.</label><br />
32
  </fieldset>
33
  </td>
34
  </tr>
35
  <tr valign="top">
36
+ <th scope="row">Player size:</th>
37
  <td>
38
+ <fieldset><legend class="screen-reader-text"><span>Player size</span></legend>
39
  <?php require 'player_sizes.inc.php';
40
  $i=0;
41
  if (is_bool(get_option('size'))) { $sel = (int) $pDefault; } else { $sel= (int) get_option('size'); }
69
 
70
  </form>
71
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  <?php } ?>
player_sizes.inc DELETED
File without changes
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: futtta
3
  Tags: youtube, video, lyte, lite youtube embeds, html5 video, html5
4
  Requires at least: 2.9
5
  Tested up to: 3.0
6
- Stable tag: 0.4.1
7
 
8
  "Lite YouTube Embeds" look like normal YouTube embeds but don't use Flash, thus reducing download size & page rendering time.
9
 
@@ -13,7 +13,7 @@ WP-YouTube-Lyte inserts "Lite YouTube Embeds" in your blog. These look and feel
13
 
14
  WP-YouTube-Lyte implements [LYTE](http://blog.futtta.be/2010/04/23/high-performance-youtube-embeds/ "High Performance YouTube embeds"), which is a small javascript-library that creates a "dummy" YouTube-player which includes the clip thumbnail and title. When clicked on, the dummy player is seamlessly replaced by the Flash video player.
15
 
16
- Since version 0.3 experimental support for embedding html5 YouTube video is available (implementing [newTube.js](http://blog.futtta.be/2010/02/04/embedding-youtube-html5-video-with-newtube/)), meaning WP-YouTube-Lyte allows for an entirely flash-less YouTube experience on your blog, displaying YouTube's HTML5 video in h264 or the new WebM-coded. There are some caveats though, see [FAQ](http://wordpress.org/extend/plugins/wp-youtube-lyte/faq/) for more info.
17
 
18
  WP-Youtube-lyte can be used together with [Smart Youtube](http://wordpress.org/extend/plugins/smart-youtube/ "Great plugin"). In that case WP-Youtube-lyte will take care of the default embeds (httpv), while Smart Youtube continues to parse other types (httpvh, httpvhd, httpvp, ...).
19
 
@@ -27,25 +27,16 @@ Just install form your Wordpress "Plugins|Add New" screen and all will be well.
27
 
28
  == Frequently Asked Questions ==
29
  = What does "experimental html5 video support" mean? =
30
- HTML5 video will not be visible for everyone (see requirements), some visitors will see the fallback Flash video instead and there are some possible caveats.
31
 
32
  = What are requirements to see embedded YouTube HTML5 video? =
33
 
34
  * It only works in browsers that support the h264 (Safari, Chrome, IE9) or WebM (currently development versions of Chrome, Opera and Firefox) video codecs
35
  * You have to be enrolled in the [YouTube html5 beta](http://www.youtube.com/html5)
36
 
37
- = What are the issues, bugs & caveats with embedded YouTube HTML5 video =
38
-
39
- * It might break if YouTube [implements x-frame-options](http://blog.futtta.be/tag/x-frame-options/) for their video-pages
40
- * Positioning of the player might be a few pixels off in some browsers
41
- * Some buttons in the embedded player (e.g. view full screen) won't function properly
42
- * This might (not) work on iphone/ipod/ipad's (there are known issues with iframes & overflow in mobile Safari that might affect html5 embedding, feedback is welcome)
43
-
44
- = But YouTube does not provide embedded html5 video, so how can this work? =
45
- It's an re-implementation of [an earlier experiment called 'newTube.js'](http://blog.futtta.be/2010/02/04/embedding-youtube-html5-video-with-newtube/). newTube.js is sort of a dirty hack which replaces the LYTE dummy player with an iframe with overflow:hidden, in which the full YouTube-page is carefully positioned to display only the player.
46
-
47
- = Any other bugs I should know about? =
48
- * The YouTube-thumbnail doesn't fit in the smaller-sized player, which will typically be visible for 16:9 videos (as YouTube adds black border on top and bottom)
49
  * The controls (play button & bottom control) are not optimized for the different sizes, they just scale along (for now).
50
 
51
  = What features might be added at a later stage? =
@@ -56,6 +47,10 @@ It's an re-implementation of [an earlier experiment called 'newTube.js'](http://
56
  Just ask, I'll see what I can do.
57
 
58
  == Changelog ==
 
 
 
 
59
  = 0.4.1 =
60
  * add fullscreen-button to player
61
  * disable size in options if html5 is selected
3
  Tags: youtube, video, lyte, lite youtube embeds, html5 video, html5
4
  Requires at least: 2.9
5
  Tested up to: 3.0
6
+ Stable tag: 0.5.0
7
 
8
  "Lite YouTube Embeds" look like normal YouTube embeds but don't use Flash, thus reducing download size & page rendering time.
9
 
13
 
14
  WP-YouTube-Lyte implements [LYTE](http://blog.futtta.be/2010/04/23/high-performance-youtube-embeds/ "High Performance YouTube embeds"), which is a small javascript-library that creates a "dummy" YouTube-player which includes the clip thumbnail and title. When clicked on, the dummy player is seamlessly replaced by the Flash video player.
15
 
16
+ Experimental support for embedding html5 YouTube video is available (implementing [YouTube's new embed code](http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html)), meaning WP-YouTube-Lyte allows for an entirely flash-less YouTube experience on your blog, displaying YouTube's HTML5 video in h264 or the new WebM-coded.
17
 
18
  WP-Youtube-lyte can be used together with [Smart Youtube](http://wordpress.org/extend/plugins/smart-youtube/ "Great plugin"). In that case WP-Youtube-lyte will take care of the default embeds (httpv), while Smart Youtube continues to parse other types (httpvh, httpvhd, httpvp, ...).
19
 
27
 
28
  == Frequently Asked Questions ==
29
  = What does "experimental html5 video support" mean? =
30
+ HTML5 video will not be visible for everyone (see requirements), some visitors will see the fallback Flash video instead.
31
 
32
  = What are requirements to see embedded YouTube HTML5 video? =
33
 
34
  * It only works in browsers that support the h264 (Safari, Chrome, IE9) or WebM (currently development versions of Chrome, Opera and Firefox) video codecs
35
  * You have to be enrolled in the [YouTube html5 beta](http://www.youtube.com/html5)
36
 
37
+ = Any bugs/ issues should I know about? =
38
+ * The new YouTube HTML5-embed-code is a work in progress, positioning of video isn't always perfect when fallback Flash-version is used.
39
+ * The YouTube-thumbnail doesn't fit in the smaller-sized player, which will typically be visible when playing 16:9 videos (as YouTube adds black border on top and bottom)
 
 
 
 
 
 
 
 
 
40
  * The controls (play button & bottom control) are not optimized for the different sizes, they just scale along (for now).
41
 
42
  = What features might be added at a later stage? =
47
  Just ask, I'll see what I can do.
48
 
49
  == Changelog ==
50
+ = 0.5.0 =
51
+ * implemented the new [HTML5 YouTube embed code](http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html) and removed my [newTube.js-hack](http://blog.futtta.be/2010/06/16/embedding-html5-youtube-video-with-wp-youtube-lyte/) for html5-embedding
52
+ * player size now applies to Flash- and the new HTML5-embeds
53
+
54
  = 0.4.1 =
55
  * add fullscreen-button to player
56
  * disable size in options if html5 is selected
wp-youtube-lyte.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WP YouTube Lyte
4
  Plugin URI: http://blog.futtta.be/tag/lyte
5
  Description: WordPress Lite YouTube Embeds (with optional HTML5 video) in posts.
6
  Author: Frank (futtta) Goossens
7
- Version: 0.4.1
8
  Author URI: http://blog.futtta.be/
9
  */
10
 
@@ -16,16 +16,15 @@ $lyteSettings[0]=$wp_lyte_plugin_url."lyte/";
16
 
17
  if (get_option('newTube')==="1") {
18
  $lyteSettings[1]="lyte-newtube-min.js";
19
- $lyteSettings[2]="650";
20
- $lyteSettings[3]="390";
21
  } else {
22
  $lyteSettings[1]="lyte-min.js";
23
- include 'player_sizes.inc.php';
24
- $oSize = (int) get_option('size');
25
- if ((is_bool($oSize)) || ($pSize[$oSize][a]===false)) { $sel = (int) $pDefault; } else { $sel= $oSize; }
26
- $lyteSettings[2]=$pSize[$sel][w];
27
- $lyteSettings[3]=$pSize[$sel][h];
28
- }
 
29
 
30
  $lyteSettings[4]=get_option('show_links');
31
 
4
  Plugin URI: http://blog.futtta.be/tag/lyte
5
  Description: WordPress Lite YouTube Embeds (with optional HTML5 video) in posts.
6
  Author: Frank (futtta) Goossens
7
+ Version: 0.5.0
8
  Author URI: http://blog.futtta.be/
9
  */
10
 
16
 
17
  if (get_option('newTube')==="1") {
18
  $lyteSettings[1]="lyte-newtube-min.js";
 
 
19
  } else {
20
  $lyteSettings[1]="lyte-min.js";
21
+ }
22
+
23
+ include 'player_sizes.inc.php';
24
+ $oSize = (int) get_option('size');
25
+ if ((is_bool($oSize)) || ($pSize[$oSize][a]===false)) { $sel = (int) $pDefault; } else { $sel= $oSize; }
26
+ $lyteSettings[2]=$pSize[$sel][w];
27
+ $lyteSettings[3]=$pSize[$sel][h];
28
 
29
  $lyteSettings[4]=get_option('show_links');
30