WordPress安装使用Flowplayer简易指南
<p><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">本文是简单易懂的现代魔法系列文章的第二弹~ </span><br /><br /><strong>一、Flowplayer简介 </strong><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">FlowPlayer 是一个用Flash开发的在Web上的视频播放器,可以很容易将它集成在任何的网页上。支持HTTP以及流媒体传输。 </span><br /><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">最新版本为5.1.1,最新版本使用纯 HTML5 + CSS3 实现的原生 VIDEO 标签,自动降级为 Flash 播放器,专门为现今的浏览器设计,旨在提供良好的性能和用户体验。 </span><br /><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">最新版本大D在使用中遇到的问题比较多,于是转为使用Flowplayer 3.2.15版本。 </span><br /><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">Flowplayer官网:</span>http://flowplayer.org/ <br /><br /><strong>二、Flowplayer下载</strong><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px"> </span><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">这里大D只提供3.2.15版本的下载,5.11版请到官网下载。 </span><br /><br /><br /><strong>三、Flowplayer安装</strong><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px"> </span><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">首先解压文件, 得到 </span><br /><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">•flowplayer.controls-3.2.14.swf </span><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">•flowplayer-3.2.11.min.js </span><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">•flowplayer-3.2.15.swf </span><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">得到以上三个文件,在/wp-content/plugins文件夹下建立一个名为flowplayer的文件夹,并把上面解压出来的三个文件上传到新建的这个flowplayer文件夹。 </span><br /><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">打开主题的header.php,在前面添加如下语句: </span><br /> </p><div style="background:#f6fbff; border-color:#0099cc; border-style:solid; border-width:1px; clear:both; font-family:tahoma,arial,"Microsoft YaHei"; line-height:21.6px; margin-bottom:0; margin-left:auto; margin-right:auto; margin-top:3px; outline:none; overflow:hidden; padding:0px 3px"><p>代码如下:</p></div>
<p style="margin-left:auto; margin-right:auto"><br /> </p>
<p><br /><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">至此,Flowplayer安装完毕,下面来说一下使用。 </span><br /><br /><strong>四、使用Flowplayer</strong><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px"> </span><br /><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">首先要说明一点,你要在整篇blog文章写完之后再添加Flowplayer的调用代码。 </span><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">否则会出现一些奇怪的问题,诸如无法进入可视化编辑环境等。 </span><br /><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">在写完文章之后,在需要添加视频的地方写入以下代码(HTML编辑模式下添加): </span><br /> </p>
<div style="background:#f6fbff; border-color:#0099cc; border-style:solid; border-width:1px; clear:both; font-family:tahoma,arial,"Microsoft YaHei"; line-height:21.6px; margin-bottom:0; margin-left:auto; margin-right:auto; margin-top:3px; outline:none; overflow:hidden; padding:0px 3px"><p>代码如下:</p></div>
<p style="margin-left:auto; margin-right:auto"><br /> </p>
<p><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">其中,playerID要保持一致,地址为视频的绝对地址。发个例子吧 </span><br /> </p>
<div style="background:#f6fbff; border-color:#0099cc; border-style:solid; border-width:1px; clear:both; font-family:tahoma,arial,"Microsoft YaHei"; line-height:21.6px; margin-bottom:0; margin-left:auto; margin-right:auto; margin-top:3px; outline:none; overflow:hidden; padding:0px 3px"><p>代码如下:<br /> </p></div>
<p><br /><br /><strong>五、添加后台调用按钮 </strong><br /><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">像大D这种懒人,肯定是记不住调用代码的写法。 </span><br /><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">于是弄了一个HTML编辑模式的后台按钮,如下图:</span><br /> </p>
<p style="text-align:center"><img style="max-width:100%!important;height:auto!important;"alt="WordPress安装使用Flowplayer简易指南" height="64" src="https://zhuji.jb51.net/uploads/allimg/20250613/1-2506131J244Y5.png" width="854" /></p>
<p><br /><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">添加后台调用按钮方法: </span><br /><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">1、在主题functions.php文件中添加如下代码: </span><br /> </p>
<div style="background:#f6fbff; border-color:#0099cc; border-style:solid; border-width:1px; clear:both; font-family:tahoma,arial,"Microsoft YaHei"; line-height:21.6px; margin-bottom:0; margin-left:auto; margin-right:auto; margin-top:3px; outline:none; overflow:hidden; padding:0px 3px"><p>代码如下:</p></div>
<p style="margin-left:auto; margin-right:auto"><br />add_action('admin_print_scripts', 'my_quicktags'); <br />function my_quicktags() { <br />wp_enqueue_script( <br />'my_quicktags', <br />get_stylesheet_directory_uri().'/my-quicktags.js', <br />array('quicktags') <br />); </p>
<p><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">2、新建一个名为my-quicktags.js的文件,并写入以下代码: </span></p>
<div style="background:#f6fbff; border-color:#0099cc; border-style:solid; border-width:1px; clear:both; font-family:tahoma,arial,"Microsoft YaHei"; line-height:21.6px; margin-bottom:0; margin-left:auto; margin-right:auto; margin-top:3px; outline:none; overflow:hidden; padding:0px 3px"><p>代码如下:</p></div>
<p style="margin-left:auto; margin-right:auto"><br />QTags.addButton( 'Video', 'Video', '','' ); <br />//QTags.addButton( 'my_id', 'my button', '\n', '\n' ); <br />//这儿共有四对引号,分别是按钮的ID、显示名、点一下输入内容、再点一下关闭内容(此为空则一次输入全部内容),\n表示换行。 </p>
<p><br /><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">如果你用的主题文件中有这个文件,那么直接将上述代码写进my-quicktags.js文件即可。 </span><br /><span style="font-family:tahoma,arial,"Microsoft YaHei"; font-size:14px">已经写好的my-quicktags.js文件下载地址(本文件添加了“下一页”,“h4”,“h6”,“Video”四个按钮):</span>my-quicktags.rar<br /><br /><strong>六、参考文献 </strong></p>
<p style="margin-left:0; margin-right:0">http://codex.wordpress.org/Quicktags_API</p>
<p style="margin-left:0; margin-right:0">http://flash.flowplayer.org/documentation/installation/index.html</p>
<p style="margin-left:0; margin-right:0">http://www.solagirl.net/wordpress-path-related-functions.html<br /> </p>
頁:
[1]