SOURCE URL: https://flowplayer.org/docs/playlist.html

HTML layout

Here is a typical setup for a playlist for a html based playlist:

<div class="flowplayer">
 
<!-- initial clip -->
<video>
<source type="video/webm" src="http://mydomain.com/night1/640x360.webm">
<source type="video/mp4" src="http://mydomain.com/night1/640x360.mp4">
<source type="video/ogg" src="http://mydomain.com/night1/640x360.ogv">
</video>
 
<!-- playlist root -->
<div class="fp-playlist">
 
<!-- playlist entries so. "trigger" elements -->
<a href="http://mydomain.com/night1/640x360.mp4"></a>
<a href="http://mydomain.com/night2/640x360.mp4"></a>
<a href="http://mydomain.com/night3/640x360.mp4"></a>
<a href="http://mydomain.com/night4/640x360.mp4"></a>
</div>
 
</div>
  • The initial clip is configured with multiple formats (webm, mp4, ogv). The playlist assumes that all playlist entries are delivered via HTTP and have the same formats available and obey to the same filename and filename suffix naming scheme. If the entries cannot follow a consistent naming scheme or the videos are delivered via RTMP for the Flash engine you must set up the playlist via JavaScript.
  • The playlist is nested inside the player so you can style it differently depending on the player state.
  • By default the playlist entries are anchor tags inside a tag with CSS class name .fp-playlist. A user without JavaScript support can still see the videos by clicking on the link.
  • You can use autoplay or a splash setup just like when you are not using a playlist.
  • If Analytics is enabled each video is tracked separately.
  • You can have several playlists on one page.
  • When a playlist is configured the next, prev and play(index) methods are available from the API. Additionally the index and is_last properties are available from the video object.

CSS classes

A "video{clip_index}" CSS class name will be assigned to the root element and a "is-active" CSS class is given to the currently active trigger. For example

<div class="flowplayer video1">
 
<div class="fp-playlist">
<a href="http://mydomain.com/video1.mp4"></a>
<a href="http://mydomain.com/video2.mp4" class="is-active"></a>
<a href="http://mydomain.com/video3.mp4"></a>
<a href="http://mydomain.com/video4.mp4"></a>
</div>
 
</div>

You can for example show/hide HTML inside the player based on which clip is being played.

.flowplayer.video1 .info1 {
display: block;
}

v5.1 A convenience class last-video represents the last clip. For example

.last-video.is-finished {
/ do your marketing magic /
}

Next and prev links

Anchors with "fp-prev" and "fp-next" class names will move forward and backward on the playlist. For example

<div class="flowplayer">
 
<video>
<source type="video/webm" src="http://mydomain.com/my-video.webm">
<source type="video/mp4" src="http://mydomain.com/my-video.mp4">
</video>
 
<a class="fp-prev">prev</a>
<a class="fp-next">next</a>
 
<div class="fp-playlist">
<a href="http://mydomain.com/my-video.mp4"></a>
...
</div>
</div>

Configuration

The playlist behaviour is configured at the top level of the configuration object. The following options are available:

option default value description
active "is-active" CSS class name for the trigger element
advance True seek to next clip when previous one is finished and stop when last clip ends
loop True v5.1 continue from the first clip when last clip ends. Overrides the clip specific loop variable
query ".fp-playlist a" jQuery selector for trigger elements

Clip specific cuepoints

v5.1 You can have a separate set of cuepoints for each clip of a playlist. For example:

<div class="flowplayer">
 
<video>
<source type="video/webm" src="http://mydomain.com/night1/640x360.webm">
<source type="video/mp4" src="http://mydomain.com/night1/640x360.mp4">
</video>
 
<div class="fp-playlist">
<a href="http://mydomain.com/night1/640x360.mp4" data-cuepoints="[0.5, 1]"></a>
<a href="http://mydomain.com/night2/640x360.mp4" data-cuepoints="[0.9, 1.5]"></a>
<a href="http://mydomain.com/night3/640x360.mp4"></a>
</div>
 
</div>

Note: Clip specific cuepoints discard all cuepoints set globally for the player. If you want to have cuepoints common to all clips in a playlist while specifying individual ones, you must repeat the common cuepoints for every clip's data-cuepoints.

Javascript playlists

v5.4 Flowplayer allows playlists to be configured completely using javascript. This allows dynamic scenarios where the playlist needs to be retrieved by an API call to be implemented without any DOM manipulation.

This also allows for a minimal HTML structure for the player.

<div  id="jsplaylist"></div>

Please take a look at our javascript playlist demo for a complete implementation. Abbreviated snippets from that demo are used here as examples.

The playlist is provided as an array of video sources. A video source can either be key-value pair of type and url or simply an URL.

var allVideos = [
[
{webm: "http://stream.flowplayer.org/night7/640x360.webm"},
{mp4: "http://stream.flowplayer.org/night7/640x360.mp4"},
{ogg: "http://stream.flowplayer.org/night7/640x360.ogv"},
{flash: "mp4:night7/640x360"}
],
[
{webm: "http://stream.flowplayer.org/night5/640x360.webm"},
{mp4: "http://stream.flowplayer.org/night5/640x360.mp4"},
{ogg: "http://stream.flowplayer.org/night5/640x360.ogv"},
{flash: "mp4:night5/640x360"}
],
[
{webm: "http://stream.flowplayer.org/night6/640x360.webm"},
{mp4: "http://stream.flowplayer.org/night6/640x360.mp4"},
{ogg: "http://stream.flowplayer.org/night6/640x360.ogv"},
{flash: "mp4:night6/640x360"}
],
[
{webm: "http://stream.flowplayer.org/night4/640x360.webm"},
{mp4: "http://stream.flowplayer.org/night4/640x360.mp4"},
{ogg: "http://stream.flowplayer.org/night4/640x360.ogv"},
{flash: "mp4:night4/640x360"}
]
];

Once the list of videos is set up, the player can be initialized with a simple call to flowplayer().

$("#jsplaylist").flowplayer({
rtmp: "rtmp://s3b78u0kbtx79q.cloudfront.net/cfx/st",
playlist: allVideos
});

Please note how the net connection URL provided by thertmp configuration option is automatically associated with video sources of type flash.

Flowplayer-playlist的更多相关文章

  1. FlowPlayer 参数说明

    <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> & ...

  2. js网页视频播放: vcastr22 、 flowplayer 、 jwplayer

    实例结构: 实例1: demo.html <embed src="vcastr22.swf?vcastr_file=../wujiandao.flv" allowFullSc ...

  3. CF 268E Playlist(贪心)

    题目链接: 传送门 Playlist time limit per test:1 second     memory limit per test:256 megabytes Description ...

  4. HTML5播放器FlowPlayer的极简风格效果

    在线演示 本地下载 使用Flowplayer生成的极简风格的播放器效果.

  5. [开发笔记]-flowplayer视频播放插件

    最近项目中需要添加播放视频的功能,视频文件是flv格式的.在网上找了一些jQuery视频播放插件,还是觉得“flowplayer”要好一些.特将使用方法记录一下. flowplayer也有html5版 ...

  6. Codeforces Round #164 (Div. 2) E. Playlist 贪心+概率dp

    题目链接: http://codeforces.com/problemset/problem/268/E E. Playlist time limit per test 1 secondmemory ...

  7. flowplayer+flashhls使用过程中发现的一些小问题

    flashls里边有好几套代码,主要看生成路径,其中flowplayer用了flashls.swc,flashls.swc使用的代码在这里:/src/org/mangui/hls,所以要注意,当搜索代 ...

  8. 兼容各个浏览器的H.264播放: H.264+HTML5+FLOWPLAYER+WOWZA+RMTP

    一.方案确定 计划做视频播放,要求可以播放H264编码的mp4文件,各个浏览器,各种终端都能播放. 首先查找可行性方案, http://www.cnblogs.com/sink_cup/archive ...

  9. flowplayer视频播放插件

    flowplayer视频播放插件 最近项目中需要添加播放视频的功能,视频文件是flv格式的.在网上找了一些jQuery视频播放插件,还是觉得“flowplayer”要好一些.特将使用方法记录一下. f ...

  10. C. Playlist Educational Codeforces Round 62 (Rated for Div. 2) 贪心+优先队列

    C. Playlist time limit per test 2 seconds memory limit per test 256 megabytes input standard input o ...

随机推荐

  1. BizTalk开发系列(三十一)配置和使用HTTP适配器

    BizTalk的主机分别进程内主机和独立主机.但由于一直使用的是进程内主机,对于独立主机的认识比较模糊,前不久在做一个BizTalk的项目的时 候,个别系统使用HTTP的方式发布Txt之类的文本的.刚 ...

  2. mysql导出导入

    1.导出整个数据库 mysqldump -u 用户名 -p 数据库名 > 导出的文件名 mysqldump -u dbuser -p dbname > dbname.sql 2.导出一个表 ...

  3. IOS第一天多线程-05GCD队列的使用

    ************** // // HMViewController.m // 08-GCD02-队列的使用(了解) // // Created by apple on 14-9-15. // ...

  4. 剑指offer:大恒图像

    大恒图像:成立于1991年,专注于视觉部件.视觉系统及互联网医疗相关产品研发.生产和营销的高科技企业. 旗下产品信息: 1.图像采集卡 摄像机等输入的模拟图像信号经过A/D转换,或将数字摄像机的输出信 ...

  5. 【iCore3 双核心板】例程九:ADC实验——电源监控

    实验指导书及代码包下载: http://pan.baidu.com/s/1o7wSEO6 iCore3 购买链接: https://item.taobao.com/item.htm?id=524229 ...

  6. Codeforces Round #376 (Div. 2) C D F

    在十五楼做的cf..一会一断...比赛的时候做出了ABCF 就没有时间了 之后没看题解写出了D..E是个神奇的博弈(递推或者dp?)看了题解也没有理解..先写了CDF.. C 有n个袜子 每个袜子都有 ...

  7. 修改FreeBSD启动菜单停留时间

    原文:http://blog.chinaunix.net/uid-21782158-id-11006.html 分类: 两种情况: 一.启动时出现菜单的时候要停的10秒 方法: 编辑/boot/loa ...

  8. 连接mysql问题 mysqlnd cannot connect to MySQL 4.1+ using old authentication

    第一篇:PHP5.3开始使用MySqlND作为默认的MySql访问驱动,而且从这个版本开始将不再支持使用旧的用户接口链接Mysql了,你可能会看到类似的提示: #2000 - mysqlnd cann ...

  9. LeetCode Two Sum II - Input array is sorted

    原题链接在这里:https://leetcode.com/problems/two-sum-ii-input-array-is-sorted/ 题目: Given an array of intege ...

  10. kafka java代码实现消费者

    public class KafkaConsumer { public static void main(String[] args) { Properties props = new Propert ...