给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.28

    《想女人》《思君》《折红杏》-一首打油诗的演变

    网上一名叫又黄又瘦的题一诗《想女人》: 独身…

  2. 没有图片

    2011.03.12

    MySQL内容批量替换方法

    针对MySQL里某字段的内容,有时需要批量替…

  3. 没有图片

    2011.01.10

    自定义WordPress登录页面Logo

    通常自己设计WordPress主题,很少把后…

  4. 没有图片

    2011.05.27

    Gregarius安装错误和写入数据库乱码等问题的方法

    Gregarius官方网站: http://…

  5. 没有图片

    2010.12.12

    回首

    菠萝写博客已经N久了,最早的时候就是跟着MS…

  6. 没有图片

    2018.01.03

    2017年终总结

    2017年就要结束,不写个总结总觉得2017…

评论

还没有评论。