标准加密

This commit is contained in:
2024-07-23 13:02:00 +08:00
parent 15c357c5b5
commit 52eeb475f0

View File

@@ -910,6 +910,7 @@ export default {
} else {
playerOptions = {
...playerOptions,
vid:this.videoData.videoId,
"playauth": this.videoData.playAuth, // 必选参数参数值可通过调用GetVideoPlayAuth接口获取。
"encryptType": 1, // 必选参数当播放私有加密流时需要设置本参数值为1。其它情况无需设置。
"playConfig": {
@@ -921,9 +922,10 @@ export default {
playerOptions = {
...playerOptions,
source: this.videoData.m3u8Url,
playConfig: {
"EncryptType": 'HLSEncryption'
}
// playConfig: {
// "EncryptType": 'HLSEncryption',
// 'MtsHlsUriToken':this.videoData.mtsHlsUriToken
// }
}
console.log('这是标准加密的视频');
}
@@ -937,29 +939,7 @@ export default {
console.log('这是没有加密的视频');
}
if (this.videoData.type == 1 && this.videoData.m3u8Url == null || this.videoData.type == 1 && this
.videoData.m3u8Url == '') {
playerOptions = {
...playerOptions,
"playauth": this.videoData.playAuth, // 必选参数参数值可通过调用GetVideoPlayAuth接口获取。
"encryptType": 1, // 必选参数当播放私有加密流时需要设置本参数值为1。其它情况无需设置。
"playConfig": {
"EncryptType": 'AliyunVoDEncryption'
}
}
console.log('这是私有加密的视频');
} else if (this.videoData.type == 1 && this.videoData.m3u8Url != null && this.videoData.type == 1 && this
.videoData.m3u8Url != '') {
playerOptions = {
...playerOptions,
source: this.videoData.m3u8Url,
playConfig: {
"EncryptType": 'HLSEncryption'
}
}
console.log('这是标准加密的视频');
}
var player = new Aliplayer(playerOptions, function(player) {});
this.player = player;
console.log('是否拿到第一次初始值呢', this.platform, typeof this.firstTime, this.firstTime)