言希 發表於 2025-6-13 00:00:00

WordPress安装使用Flowplayer简易指南

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