给WordPress添加FLV播放器

实现方法:

  1. 下载 flvplayer.swf 播放器:http://www.hzlzh.com/up/flvplayer.swf
  2. 把播放器放到 当前使用主题目录  即 wp-content/theme/****;
  3. 在主题的 functions.php 中添加如下代码即可;
/**FLV player */
function flvplayer($atts, $content=null){
extract(shortcode_atts(array("width"=>'460',"height"=>'330'),$atts));
return '<embed width="'.$width.'" height="'.$height.'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" allowfullscreen="true" src="'.get_bloginfo("template_url").'/flvplayer.swf?IsAutoPlay=0&IsContinue=1&BarPosition=1&IsShowBar=1&vcastr_file='.$content.'">
';}
add_shortcode('mv','flvplayer');

以后写文章的时候,调用使用[m v] [/m v]标签,当然可以传出尺寸的参数  即 [m v width=”600″ height=”300″]  url [/m v]

思章老师

认准了方向,就要勇敢地走下去,十年磨一剑,我相信,只要坚持,一切都有可能。

相关日志

  1. 没有图片

    2010.05.14

    常用的WordPress 统计代码

    在使用Z-Blog的博主们都知道,Z-Blo…

  2. 没有图片

    2010.05.07

    腾讯微博:世界感情之最

    世界最难断的是感情,最难求的是爱情,最难还的…

  3. 没有图片

    2010.06.28

    WordPress Post Thumbnail 文章缩略图功能教程

    WordPress主要是为博客而来的,但如果…

  4. 没有图片

    2010.05.15

    再谈男人与女人

    男人们聊天,七分谈理想,三分谈女人;女人们则…

  5. 没有图片

    2010.05.07

    翻墙的后果

    为了杜绝学生翻墙,某校园的铁栅栏都是带尖头的…

  6. 没有图片

    2010.09.05

    笔记本U盘启动的设置方法

    本来这是个很简单的问题,发现有很多朋友问如何…

评论

还没有评论。