Test some plugins, so complex. I did a simple job: Also can paste on other pages
<script> youtube="uuZQWooEsy0"; </script> <script src=http: //www.yourdomain.com/youtube.js></script>
youtube.js:
document.write('<object width="425" height="350"><param name="movie" value="http: //www.youtube.com/v/'+youtube+'"></param><param name="wmode" value="transparent"></param><embed src="http: //www.youtube.com/v/'+youtube+'" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>');
[I tried to optimize code display due to forum auto-linking problems.... -Philipp] |
You should write that in a function instead, so you don't have to call the JS file every time. (whether cached or not)
Note that WP's Visual Editor breaks scripts/multimedia contents. |
Stefan, I think that's for Wordpress.com users. Hong's solution is for self-hosted Wordpress users. I think there are also several plugins for Wordpress that allow you to easily post YouTube. |
Haochi Thanks, I will try. If we can join multiscript at one JS file. Including Google Search API, Feed API, Google Adsense, ect...
I wish Google can supply this script for us. They will do the best. And, if I put this script for public using, I think, my sever will down at once.
So just want to make YouTube notice that we need simple way to paste video. And, we just need one JS from Google, not too many JS files. |
Paul: Easy to self-develop. just one regular str_replace!
foe example (for my own blog system, not for wordpress!): $post_content= preg_replace('/[youtube=(w+)]/i',$tpl->replace('youtube-id','$1',$tpl -> toString($tpl->getTPL('youtube'))),$post_content);
[Line break added for layout reasons – Tony] |