您的位置:首页 > 编程语言

网页中嵌入百度影音播放器的代码

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>

测试效果:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: