播放器微调
This commit is contained in:
@@ -579,7 +579,7 @@
|
||||
},
|
||||
// renderjs阿里云播放器引入与配置
|
||||
getLive() {
|
||||
console.log('这是这只只是666666:', this.firstTime, this.videoData)
|
||||
console.log('阿里云播放器引入与配置:', this.firstTime, videoData)
|
||||
|
||||
$('#url-player-test').empty();
|
||||
|
||||
@@ -715,18 +715,17 @@
|
||||
|
||||
}
|
||||
|
||||
if (this.videoData.type == 1) {
|
||||
if (this.videoData.m3u8Url == null || this.videoData.m3u8Url == '') {
|
||||
if (videoData.type == 1) {
|
||||
if (videoData.m3u8Url == null || videoData.m3u8Url == '') {
|
||||
console.log('这是私有加密的视频');
|
||||
if (this.$platform == 'ios') {
|
||||
this.$refs.videoContent5.click()
|
||||
} else {
|
||||
playerOptions = {
|
||||
...playerOptions,
|
||||
"vid": this.videoData
|
||||
.videoId, // 必选参数,可以通过点播控制台(路径:媒资库>音/视频)查询。示例:1e067a2831b641db90d570b6480f****。
|
||||
"vid": videoData.videoId, // 必选参数,可以通过点播控制台(路径:媒资库>音/视频)查询。示例:1e067a2831b641db90d570b6480f****。
|
||||
|
||||
"playauth": this.videoData.playAuth, // 必选参数,参数值可通过调用GetVideoPlayAuth接口获取。
|
||||
"playauth": videoData.playAuth, // 必选参数,参数值可通过调用GetVideoPlayAuth接口获取。
|
||||
"encryptType": 1, // 必选参数,当播放私有加密流时需要设置本参数值为1。其它情况无需设置。
|
||||
"playConfig": {
|
||||
"EncryptType": 'AliyunVoDEncryption'
|
||||
@@ -734,19 +733,19 @@
|
||||
}
|
||||
console.log('这是私有加密的视频');
|
||||
}
|
||||
} else if (this.videoData.m3u8Url != null || this.videoData.m3u8Url != '') {
|
||||
} else if (videoData.m3u8Url != null || videoData.m3u8Url != '') {
|
||||
playerOptions = {
|
||||
...playerOptions,
|
||||
source: this.videoData.m3u8Url,
|
||||
source: videoData.m3u8Url,
|
||||
// "playConfig": {"EncryptType": "HLSEncryption"}
|
||||
}
|
||||
console.log('这是标准加密的视频', this.videoData.id, this.videoData.m3u8Url);
|
||||
console.log('这是标准加密的视频', videoData.id, videoData.m3u8Url);
|
||||
}
|
||||
|
||||
} else {
|
||||
playerOptions = {
|
||||
...playerOptions,
|
||||
source: this.videoData.videoUrl
|
||||
source: videoData.videoUrl
|
||||
}
|
||||
console.log('这是没有加密的视频');
|
||||
}
|
||||
@@ -874,25 +873,8 @@
|
||||
// 监听视频参数变化,并赋值给常量
|
||||
receiveMsg(newValue, oldValue, ownerVm, vm) {
|
||||
//数据变化
|
||||
videoData = newValue
|
||||
if (videoData) {
|
||||
return
|
||||
console.log('切换后的播放数据videoData', videoData.type);
|
||||
if (videoData.type == 1) {
|
||||
if (videoData.m3u8Url != '' && videoData.m3u8Url != null) {
|
||||
// myplayer.source(videoData.m3u8Url)
|
||||
myplayer.loadByUrl(videoData.m3u8Url)
|
||||
console.log('切换走了吗?m3u8');
|
||||
} else {
|
||||
myplayer.replayByVidAndPlayAuth(videoData.videoId, videoData.playAuth)
|
||||
console.log('切换走了吗?私有加密');
|
||||
}
|
||||
} else {
|
||||
myplayer.loadByUrl(videoData.videoUrl)
|
||||
console.log('切换常规视频');
|
||||
}
|
||||
}
|
||||
// console.log('可能是切换视频', videoData, );
|
||||
videoData = newValue
|
||||
|
||||
},
|
||||
receiveWinWidth(newValue, oldValue, ownerVm, vm) {
|
||||
//数据变化
|
||||
@@ -904,8 +886,8 @@
|
||||
},
|
||||
// 检测是否传入播放参数
|
||||
checkValue() {
|
||||
console.log(this.videoId, this.authId, this.videoData, "1111888888")
|
||||
if ((!this.videoData.playAuth || !this.currentVideoList)) {
|
||||
console.log(this.videoId, this.authId, videoData, "1111888888")
|
||||
if ((!videoData.playAuth || !this.currentVideoList)) {
|
||||
setTimeout(() => {
|
||||
this.checkValue();
|
||||
}, 1000);
|
||||
|
||||
Reference in New Issue
Block a user