一、引入播放器 index.html

<  rel=\"stylesheet\" href=\"//g.alicdn.com/de/prismp /2.7.2/skins/default/alip -min.css\" />
 <  type=\"text/ \" charset=\"utf-8\" src=\"//g.alicdn.com/de/prismp /2.7.2/alip -min.js\"></ >

二、项目中使用

<div class=\"prism-p \" id=\"J_prismP \" style=\"position: absolute\"></div>



// 
getInit(){
				let p  = new Alip ({
					id: \'J_prismP \',
					width: \'100%\',
					height:\'60vh\',
					autoplay: true,
					prismType: 2,
					vid: \'\',
					accId: \'\',
					accSecret: \'\',
					apiKey: \'\',
					source: this.address,  //视频地址
					showBarTime: 3000000,
					// cover: \'http://liveroom-img.oss-cn-qingdao.aliyuncs.com/logo.png\'
				});
			},

this.address 为请求接口后台返回给我的直播地址
项目经历
移动端直播使用推流rtmp不行,播放rtmp的需要flash播放器,而手机上浏览器很少支持flash(我的理解,欢迎指正),除非是特定的,这不符合项目要求,使用m3u8
播放器视频格式

收藏 打印