网页中嵌入百度影音播放器的代码
2012-06-24 14:37
323 查看
@{
//假如传入1,播放 http://localhost:5578/Upload/[电影天堂心战HD中字.mkv
//传入2,播放 http://localhost:5578/Upload/狄仁杰之神都龙王_hd.mp4
//传入3,播放 http://localhost:5578/Upload/人再囧途之泰囧_DVD清晰中字.rmvb
//1的下一集是2,2的下一集是3。
Layout = null;
string videopath = "";//本集视频地址
string nextvideopath = "";//下一集视频地址,用来缓冲视频的
string prewebpage = "";//上一集网页地址
string nextwebpage = "";//下一集网页地址
if (ViewBag.id == "1")//默认第一集(viewbag.id是传过来的参数)
{
videopath = "http://localhost:5578/Upload/[电影天堂心战HD中字.mkv";
nextvideopath = "http://localhost:5578/Upload/狄仁杰之神都龙王_hd.mp4";
prewebpage = "";
nextwebpage = "http://localhost:5578/index/BDPlayer/2";
}
else if(ViewBag.id == "2")
{
prewebpage = "http://localhost:5578/index/BDPlayer/1";
nextwebpage = "http://localhost:5578/index/BDPlayer/3";
videopath = "http://localhost:5578/Upload/狄仁杰之神都龙王_hd.mp4";
nextvideopath = "http://localhost:5578/Upload/人再囧途之泰囧_DVD清晰中字.rmvb";
}
else if (ViewBag.id == "3")
{
prewebpage = "http://localhost:5578/index/BDPlayer/2";
nextwebpage = "";
videopath = "http://localhost:5578/Upload/人再囧途之泰囧_DVD清晰中字.rmvb";
nextvideopath = "";
}
}
<!DOCTYPE html>
<html>
<head>
<title>BDPlayer</title>
</head>
<body>
<div>
<script language="javascript">
var BdPlayer = new Array();
BdPlayer['time'] = 8; //缓冲广告展示时间(如果设为0,则根据缓冲进度自动控制广告展示时间)
BdPlayer['buffer'] = 'http://player.baidu.com/lib/show.html?buffer'; //贴片广告网页地址
BdPlayer['pause'] = 'http://player.baidu.com/lib/show.html?pause'; //暂停广告网页地址
BdPlayer['end'] = 'http://player.baidu.com/lib/show.html?end'; //影片播放完成后加载的广告
BdPlayer['tn'] = '12345678'; //播放器下载地址渠道号
BdPlayer['width'] = 800; //播放器宽度(只能为数字)
BdPlayer['height'] = 550; //播放器高度(只能为数字)
BdPlayer['showclient'] = 1; //是否显示拉起拖盘按钮(1为显示 0为隐藏)
BdPlayer['url'] = '@(videopath)'; //当前播放任务播放地址
BdPlayer['nextcacheurl'] = '@(nextvideopath)'; //下一集播放地址(没有请留空)
BdPlayer['lastwebpage'] = '@(prewebpage)'; //上一集网页地址(没有请留空)
BdPlayer['nextwebpage'] = '@(nextwebpage)'; //下一集网页地址(没有请留空)
</script>
<script language="javascript" src="http://php.player.baidu.com/bdplayer/player.js"
charset="utf-8"></script>
</div>
</body>
</html>
测试效果:
//假如传入1,播放 http://localhost:5578/Upload/[电影天堂心战HD中字.mkv
//传入2,播放 http://localhost:5578/Upload/狄仁杰之神都龙王_hd.mp4
//传入3,播放 http://localhost:5578/Upload/人再囧途之泰囧_DVD清晰中字.rmvb
//1的下一集是2,2的下一集是3。
Layout = null;
string videopath = "";//本集视频地址
string nextvideopath = "";//下一集视频地址,用来缓冲视频的
string prewebpage = "";//上一集网页地址
string nextwebpage = "";//下一集网页地址
if (ViewBag.id == "1")//默认第一集(viewbag.id是传过来的参数)
{
videopath = "http://localhost:5578/Upload/[电影天堂心战HD中字.mkv";
nextvideopath = "http://localhost:5578/Upload/狄仁杰之神都龙王_hd.mp4";
prewebpage = "";
nextwebpage = "http://localhost:5578/index/BDPlayer/2";
}
else if(ViewBag.id == "2")
{
prewebpage = "http://localhost:5578/index/BDPlayer/1";
nextwebpage = "http://localhost:5578/index/BDPlayer/3";
videopath = "http://localhost:5578/Upload/狄仁杰之神都龙王_hd.mp4";
nextvideopath = "http://localhost:5578/Upload/人再囧途之泰囧_DVD清晰中字.rmvb";
}
else if (ViewBag.id == "3")
{
prewebpage = "http://localhost:5578/index/BDPlayer/2";
nextwebpage = "";
videopath = "http://localhost:5578/Upload/人再囧途之泰囧_DVD清晰中字.rmvb";
nextvideopath = "";
}
}
<!DOCTYPE html>
<html>
<head>
<title>BDPlayer</title>
</head>
<body>
<div>
<script language="javascript">
var BdPlayer = new Array();
BdPlayer['time'] = 8; //缓冲广告展示时间(如果设为0,则根据缓冲进度自动控制广告展示时间)
BdPlayer['buffer'] = 'http://player.baidu.com/lib/show.html?buffer'; //贴片广告网页地址
BdPlayer['pause'] = 'http://player.baidu.com/lib/show.html?pause'; //暂停广告网页地址
BdPlayer['end'] = 'http://player.baidu.com/lib/show.html?end'; //影片播放完成后加载的广告
BdPlayer['tn'] = '12345678'; //播放器下载地址渠道号
BdPlayer['width'] = 800; //播放器宽度(只能为数字)
BdPlayer['height'] = 550; //播放器高度(只能为数字)
BdPlayer['showclient'] = 1; //是否显示拉起拖盘按钮(1为显示 0为隐藏)
BdPlayer['url'] = '@(videopath)'; //当前播放任务播放地址
BdPlayer['nextcacheurl'] = '@(nextvideopath)'; //下一集播放地址(没有请留空)
BdPlayer['lastwebpage'] = '@(prewebpage)'; //上一集网页地址(没有请留空)
BdPlayer['nextwebpage'] = '@(nextwebpage)'; //下一集网页地址(没有请留空)
</script>
<script language="javascript" src="http://php.player.baidu.com/bdplayer/player.js"
charset="utf-8"></script>
</div>
</body>
</html>
测试效果:
相关文章推荐
- 网上比较常用的嵌入网页中的播放器代码收藏
- (jsp/html)网页上嵌入播放器(常用播放器代码整理) http://www.jb51.net/article/37267.htm
- 常用网页嵌入播放器代码精解收集
- (jsp/html)网页上嵌入播放器(常用播放器代码整理)
- 网上比较常用的嵌入网页中的播放器代码收藏
- (jsp/html)网页上嵌入播放器(常用播放器代码整理)
- 网上比较常用的嵌入网页中的播放器代码收藏
- 网页嵌入播放器代码集锦
- 【转】在网页嵌入QQ+MSN+淘宝旺旺+Gtalk快速对话框官方代码的方法
- 网页在线播放器代码大全
- 如何在网页HTML中嵌入QQ、MSN、旺旺、Gtalk快速对话框代码
- MSN,QQ在线即时交谈网页嵌入代码
- 防止网页被嵌入框架的JS代码
- 防止网页被嵌入框架的代码
- 在线视频代码 播放器代码 网页制作 在线视频播放代码 各种格式播放器 播放器代码大全
- flash嵌入html 在html网页代码中嵌入Flash文件的解决方案(下)
- 网页中支持mpg格式的播放器代码
- 给网页加入各种播放器的代码
- 【转】在网页中嵌入QQ 阿里旺旺 淘宝代码及详解
- 网页嵌入播放器,并且可以控制播放列表的