网页插入腾讯视频

//<script language="javascript" src="http://qzs.qq.com/tencentvideo_v1/js/tvp/tvp.player.js" charset="utf-8"></script>

//定义视频对象 var temp_u="https://v.qq.com/iframe/player.htmlplayer.html?vid=b0708tfkkku&auto=0"; var reg = new RegExp("(^|&|\\?)vid=([^&]*)(&|$|#)"); var r = temp_u.match(reg); var vid= encodeURIComponent(r[2]); console.log(vid); //alert(vid); var video = new tvp.VideoInfo(); //向视频对象传入视频vid video.setVid(vid); //定义播放器对象 var player = new tvp.Player('100%', '100%'); //设置播放器初始化时加载的视频 player.setCurVideo(video); //设置精简皮肤,仅点播有效 //player.addParam("flashskin", "http://imgcache.qq.com/minivideo_v1/vd/res/skins/TencentPlayerMiniSkin.swf"); //输出播放器,参数就是上面div的id,希望输出到哪个HTML元素里,就写哪个元素的id player.addParam("autoplay","1"); player.addParam("wmode","transparent"); player.addParam("pic","http://vpic.video.qq.com/0/"+vid+"_160_90_3.jpg");//默认图片地址 //player.addParam("pic","http://img1.gtimg.com/ent/pics/hv1/75/182/1238/80547435.jpg"); player.write("mod_player_skin");

  

posted @ 2018-07-03 14:24  羽鱼  阅读(222)  评论(0编辑  收藏  举报