用户
 找回密码
 入住 CI 中国社区
搜索
查看: 6181|回复: 5
收起左侧

[Ionize CMS] 在Ionize框架中使用flash播放器JW Player的方法

[复制链接]
发表于 2012-3-18 14:00:45 | 显示全部楼层 |阅读模式
在Ionize框架中使用flash播放器JW Player的方法
JW Player是个很好的flash播放器,功能较强,可以切换全屏幕观看FLV和MP4视频,特别在Ionize框架中,视频作为文章的媒体文件,而每个页面可能包含许多篇文章,每个视频不可能占有太大的屏幕窗口,因此切换全屏幕观看视频的功能特别重要.以下介绍我们使用JW Player的方法.
1.将JW Player播放器文件下载到/themes/admin/flash/mediaplayer/,并rename为jwplayer.swf;
2.在使用JW Player播放器的php文件添加以下代码:
<ion:medias type="video">
<EMBED src="/themes/admin/flash/mediaplayer/jwplayer.swf" width=280 height=200 type="application/x-shockwave-flash"
bgcolor="#2A2F34" allowscriptaccess="always" allowfullscreen="true"
flashvars="file=/<ion:path /> & link=/<ion:path />"> </EMBED>
</ion:medias>
3.在Ionize的admin管理面板中,对相应的文章添加视频文件.

发表于 2012-3-19 09:10:29 | 显示全部楼层
这似乎是ci框架吧
 楼主| 发表于 2012-3-20 10:40:17 | 显示全部楼层
是ci框架下的一个CMS框架,很好用,我开始学习它时,一个星期就可以建造一个网站。它的理念很简单:语言-〉菜单->页面-〉文章-〉媒体,后台管理功能强大,容易上手。
发表于 2012-3-22 15:17:55 | 显示全部楼层
先收藏一下,试试去...
发表于 2012-3-22 15:42:40 | 显示全部楼层
本帖最后由 xiehao 于 2012-3-22 15:45 编辑

试了一下,要做一点调整才能在首页上显示出来吧。
首先下载这个东东: mediaplayer-viral.zip (495.02 KB, 下载次数: 2847)

1. 将JW Player播放器文件下载到/themes/xxxxxx/flash/mediaplayer/,并rename为jwplayer.swf; 其中xxxxxx为你自己的模板目录。

2.在首页加入一段代码,嘿嘿,这个页面/themes/xxxxxx/views/page_home.php
PHP复制代码
 
<ion:medias type="video">
<EMBED src="<ion:theme_url />flash/mediaplayer/jwplayer.swf" width="560" height="400" type="application/x-shockwave-flash" bgcolor="#2A2F34" allowscriptaccess="always" allowfullscreen="true" flashvars="file=<ion:base_url /><ion:path /> & link=<ion:base_url /><ion:path />"></EMBED>
</ion:medias>
 
复制代码


3. 别忘了在头部加载一下它的js文件。
HTML复制代码
<script type="text/javascript" src="<ion:theme_url />flash/mediaplayer/jwplayer.js"></script>
复制代码


4.在Ionize的admin管理面板中,对相应的文章添加视频文件。

5.到首页去看看吧,我实现了,有图为证。
MSNLite catchScreen 2012-03-22 15_42_57.png
 楼主| 发表于 2012-3-26 16:48:45 | 显示全部楼层
谢谢xiehao 先生!是的,JW Player实现有2种方法,即js脚本和嵌入法,我用的是后者,无需在头部加载js文件,实现代码如下:
        <ion:articles  type="">

                <div class="span-33 home <?php if('<ion:index />' == 3) :?> last<?php endif;?>">
                        <ion:medias type="picture" limit="1">
                                <div class="imgborder" >
                                        <div class="img" style="background:url(<ion:src folder="280" />);height:130px;"></div>
                                </div>
                        </ion:medias>
<ion:medias type="video">
<EMBED src="/themes/admin/flash/mediaplayer/jwplayer.swf" width=280 height=200 type="application/x-shockwave-flash"
bgcolor="#2A2F34" allowscriptaccess="always" allowfullscreen="true"
flashvars="file=/<ion:path /> & link=/<ion:path />"> </EMBED>

</ion:medias>
                        <h2><ion:title /></h2>
                       
                        <ion:content />
                       
                </div>
               
        </ion:articles>
   

本版积分规则