wangguoyu 7 месяцев назад
Родитель
Сommit
bc323bd09a
1 измененных файлов с 66 добавлено и 22 удалено
  1. 66 22
      pages/study/lookShipin.vue

+ 66 - 22
pages/study/lookShipin.vue

@@ -67,17 +67,16 @@
 			}
 		},
 		onLoad(options) {
-			// let data = JSON.parse(options.studyData)
-			// console.log(data);
-			// this.pageData = {
-			// 	...data
-			// }
-			// console.log(this.pageData);
-			// this.videoId = data.videoId
-			// this.jieName = data.jieName
-			// this.progressMarkers = data.progressMarkers
-			// this.getLive(); //获取播放凭证
-			//uni.$on('playEnd', this.playEnd);
+			let data = JSON.parse(options.studyData)
+			console.log(data);
+			this.pageData = {
+				...data
+			}
+			console.log(this.pageData);
+			this.videoId = data.videoId
+			this.jieName = data.jieName
+			this.progressMarkers = data.progressMarkers
+			this.getLive(); //获取播放凭证
 		},
 		onHide() {
 			console.log('onHideonHideonHideonHide');
@@ -171,8 +170,8 @@
 				}
 			},
 			hideFlagFun(newValue, oldValue, ownerInstance, instance) {
-				if(this.player){
-						this.player.pause()
+				if (this.player) {
+					this.player.pause()
 				}
 			},
 			progressMarkersMsg(newValue, oldValue, ownerInstance, instance) {
@@ -222,14 +221,59 @@
 			playAli() {
 				let that = this
 				//配置播放器
-				var player = new Aliplayer({
-					id: "wgy-player-test",
-					width: "100%",
-					source: "  https://media.w3.org/2010/05/sintel/trailer.mp4",
-				    height: "500px",
-				    autoplay: false,
-				    preload: false,
-				    isLive: false
+			var player = new Aliplayer({
+				id: "wgy-player-test",
+				"vid": this.videoId,
+				"playauth": this.playAuth,
+				// "playConfig": {
+				// 	"EncryptType": 'AliyunVoDEncryption'
+				// },
+				"skinLayout": [{
+						"name": "bigPlayButton",
+						"align": "blabs",
+						"x": 30,
+						"y": 80
+					},
+					{
+						"name": "controlBar",
+						"align": "blabs",
+						"x": 0,
+						"y": 0,
+						"children": [{
+								"name": "progress",
+								"align": "blabs",
+								"x": 0,
+								"y": 44
+							},
+							{
+								"name": "playButton",
+								"align": "tl",
+								"x": 15,
+								"y": 12
+							},
+							{
+								"name": "fullScreenButton",
+								"align": "tr",
+								"x": 10,
+								"y": 12
+							}
+						]
+					}
+				],
+				"qualitySort": "asc",
+				"format": "mp4",
+				"mediaType": "video",
+				"encryptType": 1,
+				"progressMarkers": this.progressMarkers,
+				"width": '100%',
+				"height": '500px',
+				"autoplay": false,
+				"isLive": false,
+				"rePlay": false,
+				"playsinline": true,
+				"preload": false,
+				"controlBarVisibility": "hover",
+				"useH5Prism": true
 
 				}, function(player) {});
 				this.player = player;
@@ -256,7 +300,7 @@
 					s_tag.src = 'https://g.alicdn.com/de/prismplayer/2.9.6/aliplayer-min.js';
 					s_tag.charset = 'utf-8';
 					s_tag.onload = () => {
-						this.playAli()
+					//	this.playAli()
 						resolve();
 					}
 					document.body.appendChild(s_tag);