function SimplePlayer(option) { option = option || {}; this.baseurl = option.baseurl || '/cxplayer/'; this.render = option.render || 'moocpalyer'; this.width = option.width || document.getElementById(this.render).parentNode.getAttribute('width'); this.height = option.height || document.getElementById(this.render).parentNode.getAttribute('height'); this.playerSWF = option.playerSWF || '/cxplayer/player.swf'; this.videoUrl = option.videoUrl || ''; this.hd_videoUrl = option.hd_videoUrl || ''; this.priviewUrl=option.priviewUrl||''; this.coverUrl = option.coverUrl || ''; this.skin = option.skin || 'default'; this._init(); } SimplePlayer.prototype._init = function() { var me = this; if (!me.videoUrl) { return; } var me = this; var vUrl; if(me.hd_videoUrl==""){ vUrl = me.videoUrl; }else{ vUrl = me.hd_videoUrl; } var videoUrl = ServerHost.moocDomain+'/course/watchvideo?videoUrl=' + vUrl; var config = { width: me.width, //指定播放器宽度 height: me.height, //指定播放器高度 player: me.playerSWF, //指定播放器flash文件 datas:{ siteId:"mooc", intervalTime:1000, isAutoChgLine:false, isDefaultPlay:false, currVideoInfo:{ //videoId: '',//视频ID //serieId: '',//系列ID seriNum:1,//当前是第几集,从1开始 //title: '', //视频标题 previewUrl:me.priviewUrl, getVideoUrl: videoUrl //获得视频播放地址数组(加密地址) //subtitleUrl:"http://video.chaoxing.com/ajax/getvideosubtitle_18427.shtml", //视频字幕加载地址 //pointListUrl:"http://video.chaoxing.com/getVideoPoints_93632.json",//知识点列表加载地址 //playListUrl:"http://video.chaoxing.com/ajax/getvideolistinfo_400052474_170196.shtml?&pageNo=1&pageSize=10",//当前视频所在播放列表加载地址 //relatListUrl:"" ,//当前视频相关列表加载地址 //getViewPicUrl: "",//加载与当前视频相关的读条上的图片列表 //getResourceUrl: ""//加载与当前视频相关的资源 } }, skin:{ text:{ siteNameText:"超星网", playLines:[ {index:1,name:"标清",intro:"默认线路"}, {index:0,name:"高清",intro:"请在宽带大于2M的环境下使用"} ] }, img:{ waterIconImg:"",//水印logo图片地址,默认无me.baseurl + "skin/" + me.skin + "/water_logo.png loadLogoImg:"",// me.baseurl + "skin/" + me.skin + "/loading_logo.png",//加载面板中logo图片地址,内置默认图片 loadAdvertImg: me.baseurl + "skin/" + me.skin + "/ad_logo.png",//广告语图片地址,默认无 loadBgImg: me.baseurl + "skin/" + me.skin + "/loading_bg.png",//加载面板背景图片,默认无 bottomBgImg: me.baseurl + "skin/" + me.skin + "/bottom_bg.png",//底部工具栏背景图片,内置默认图片 shareIcons:[ {index:0,name:"人人网",url: me.baseurl + "skin/" + me.skin + "/icons/renren.png",linkTo:"http://www.renren.com"}, {index:1,name:"QQ空间",url: me.baseurl + "skin/" + me.skin + "/icons/qzone.png",linkTo:"http://qzon.qq.com"}, {index:4,name:"豆瓣",url: me.baseurl + "skin/" + me.skin + "/icons/douban.png",linkTo:"http://www.douban.com"} ] }, view:{ bottomPanel:{ bottons:{ playNextBtn:false,//是否显示下一集按钮,默认值true playPrevBtn:false,//是否显示上一集按钮,默认值true playListBtn:true,//全屏时是否显示播放列表按钮,默认值true chgLineBtn:false,// 是否显示切换路按钮,默认值true lineListBtn:false,// 是否显示线路下拉列表按钮,默认值true cutImgBtn:false, // 是否显示截图按钮,默认值true settingBtn:false // 是否显示设置按钮,默认值true }, labels:{ msgLabel:false, // 是显示下载速度提示面板,默认值true timeLabel:true // 是显示播放时长,默认值true } }, rightPanel:{ visiable:false,//是否显示右侧工具栏,默认值true bottons:{ shareBtn:false, // 是否显示分享按钮,默认值true trunOffBtn:false, // 是否开、关灯按钮,默认值true chgLineBtn:false, // 是否显示切换线路按钮,默认值true downloadBtn:false// 是否显示下载按钮,默认值true } } } } }; jQuery('#' + me.render).cxplayer(config); };