对dz下的flv播放器进一步探索

今晚测试一下veapon同学说的jw player。其实这个东东之前见过,不过没自己用过。具体用哪些代码来调用是个问题

先做做功课

http://www.longtailvideo.com/players/jw-flv-player/#Instructions

JW Player™ Instructions说明文档

The JW Player™ is the Internet's most popular and flexible media player. It supports playback of any format the Adobe Flash Player can handle (FLV, MP4, MP3, AAC, JPG, PNG and GIF). It also supports RTMP, HTTP, live streaming, various playlists formats, a wide range of settings and an extensive javascript API.

JW Player™是一个网上著名的综合性媒体播放器。它支持所有Adobe Flash Player支持的回放格式(FLV, MP4, MP3, AAC, JPG, PNG 以及GIF)它也支持RTMP, HTTP,流媒体和各种播放列表,很大范围的设置以及一个JS的API接口。

The skinning functionality allows you to completely customize its look and its plugin architecture allows you to easily extend the player with features such as sharing, recommendations, searching, analytics and ad serving.

换肤功能允许你完全改变他的界面外观,而插件机制允许你更容易的为播放器增加“分享、提醒、搜索、分析、广告代理”等特性。

Installation安装

This section details a step-by-step process of how to install the JW Player™ onto your page. The download ZIP contains everything you need to get started.

此部分教您如何一步一步把JW Player™安装到您的页面上去。下载到的ZIP包囊括所有你需要准备的东西,直接开始吧。

Step 1: Transfer the player.swf and swfobject.js file from the ZIP to your website. (Make sure that you've also uploaded all the necessary videos / songs / images to your site.)

第一步:把player.swf a和 swfobject.js两个文件从zip包解压出来并上传 到你的 网站。(当然要确保你的视频啊音乐 啊 图片啊什么的都已经传到站点去了。)

Step 2: Embed the player in your HTML page with the lines of code below. Note: If you place the files in different directories, make sure to set the references in this code accordingly.

第二步:像下面这样把代码嵌入你的HTML语句中。注意:如果文件传的目录不同,自行按照代码设置好路径。

The player will show in this paragraph


在dz后太编辑器设置中discuz代码增加flv的代码内将以上代码粘贴进去,仅改动video.flv为{1},参数设置为1即可。

测试效果,由于是JS的,因此一个页面只能加载一个实例。第一次播放有dz的crossdomain权限禁止的弹出提示,不过能够播放,FF下能正常播放,由于论坛是UTF8编码而FTP为GBK编码,所以IE下仍然只支持纯英文路径。

相比之前的播放器好处有:如果ftp上没有这个文件或者无法打开文件直接在播放器中显示错误信息而不是前者那样在FF下不断的弹出ftp连接错误提示。

若要用于论坛需要修改的地方有:播放开始时的JWplayerlogo淡出效果要去掉,最好能加入自己提示文字。更多东西慢慢完善。

Notice the flashvars parameter above can contain a list of variables for configuring the player to use different Plugins or Skins. To quickly set up flashvars, use thesetup wizard. Simply choose an example, select the variables you want to use and paste the code onto your page. It's that easy.

提醒:代码中的flashvars参数可以包含一大列表的配置播放器的插件或皮肤。试试用设置向导setup wizard.来快速设置这个参数吧。仅需要选择一个实例,选择你需要的值,复制代码到你的页面即可,如此简单。

Documentation文档

All documentation of the JW Player can be found in the JW Player Wiki. The Wiki also includes our product roadmap, source code and bug tickets. Here are some direct links:

所有文档都可在JW player的维基JW Player Wiki上找到。这个维基也囊括我们的产品指南,源代码和BUG记录。直链如下:下面就不用翻译了吧

If you've created a CMS module that embeds the player in an existing CMS (or you've found one online), please submit it here.

Also, make sure to check out one of our many tutorials, which cover topics such as:

Support