222
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<view class="container" style="background-color: #000; position: relative">
|
||||
<u-modal :show="show" :title="title" :content='content'></u-modal>
|
||||
<!-- <u-icon
|
||||
@click="goBack"
|
||||
name="arrow-left"
|
||||
@@ -40,6 +41,9 @@
|
||||
<div @tap="renderScript.emitSetData" ref="videoContent4" v-show="false">
|
||||
监听切换视频方法
|
||||
</div>
|
||||
<div @tap="renderScript.emitopenShow" ref="videoContent5" v-show="false">
|
||||
打开视频提示
|
||||
</div>
|
||||
<div class="fullScreenButton-container">
|
||||
<div :class="`prism-fullscreen-btn ${isFullScreen ? 'fullscreen' : ''}`"
|
||||
@tap="renderScript.changeVideoScreen"></div>
|
||||
@@ -75,6 +79,8 @@
|
||||
props: ["currentVideo", "currentVideoList"],
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
content: "此设备暂不支持观看当前视频,请移步到安卓手机进行学习!",
|
||||
platform: null,
|
||||
//当前是否是全屏模式
|
||||
isFullScreen: false,
|
||||
@@ -166,6 +172,9 @@
|
||||
},
|
||||
|
||||
methods: {
|
||||
openShow() {
|
||||
this.show = true;
|
||||
},
|
||||
start() {
|
||||
// var playerView = this.$refs.playerView;
|
||||
this.$refs.playerView.start();
|
||||
@@ -175,6 +184,7 @@
|
||||
this.$refs.playerView.pause();
|
||||
},
|
||||
changeVideoData() {
|
||||
this.show = false;
|
||||
this.isChange = false;
|
||||
},
|
||||
async changeVideo(data) {
|
||||
@@ -221,6 +231,7 @@
|
||||
});
|
||||
},
|
||||
async init(data, isChange) {
|
||||
this.show = false;
|
||||
this.platform = this.$platform;
|
||||
this.isfresh = true;
|
||||
console.log("at line 59:", "是否先走init这里", this.platform);
|
||||
@@ -601,6 +612,9 @@
|
||||
ownerInstance.callMethod('setVideoFirtsetTime')
|
||||
|
||||
},
|
||||
emitopenShow(event, ownerInstance) {
|
||||
ownerInstance.callMethod('openShow')
|
||||
},
|
||||
changeVideoScreen(event, ownerInstance) {
|
||||
var that = this;
|
||||
// this.$emit('changeScreenLoading',true)
|
||||
@@ -871,39 +885,31 @@
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (this.videoData.type == 1) {
|
||||
// if(this.$platform=='ios'){
|
||||
//标准加密
|
||||
// playerOptions = {
|
||||
|
||||
|
||||
// ...playerOptions,
|
||||
// source: this.videoData.m3u8Url,
|
||||
// // ...playerOptions,
|
||||
// // source: this.videoData.m3u8Url,
|
||||
// // "playauth": this.videoData.playAuth, // 必选参数,参数值可通过调用GetVideoPlayAuth接口获取。
|
||||
// format:'m3u8',
|
||||
// // // "encryptType": 1, // 必选参数,当播放私有加密流时需要设置本参数值为1。其它情况无需设置。
|
||||
// // "playConfig": {
|
||||
// // "EncryptType": 'HLSEncryption',
|
||||
// // "MtsHlsUriToken": this.videoData.mtsHlsUriToken,
|
||||
|
||||
// // },
|
||||
|
||||
// }
|
||||
// }else{
|
||||
//私有加密
|
||||
playerOptions = {
|
||||
...playerOptions,
|
||||
"playauth": this.videoData.playAuth, // 必选参数,参数值可通过调用GetVideoPlayAuth接口获取。
|
||||
|
||||
"encryptType": 1, // 必选参数,当播放私有加密流时需要设置本参数值为1。其它情况无需设置。
|
||||
"playConfig": {
|
||||
"EncryptType": 'AliyunVoDEncryption'
|
||||
},
|
||||
|
||||
// }
|
||||
if (this.videoData.m3u8Url == null || this
|
||||
.videoData.m3u8Url == '') {
|
||||
//console.log('这是私有加密的视频');
|
||||
if (this.$platform == 'ios') {
|
||||
this.$refs.videoContent5.click()
|
||||
} else {
|
||||
playerOptions = {
|
||||
...playerOptions,
|
||||
"playauth": this.videoData.playAuth, // 必选参数,参数值可通过调用GetVideoPlayAuth接口获取。
|
||||
"encryptType": 1, // 必选参数,当播放私有加密流时需要设置本参数值为1。其它情况无需设置。
|
||||
"playConfig": {
|
||||
"EncryptType": 'AliyunVoDEncryption'
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (this.videoData.m3u8Url != null || this.videoData.m3u8Url != '') {
|
||||
playerOptions = {
|
||||
...playerOptions,
|
||||
source: this.videoData.m3u8Url,
|
||||
playConfig: {
|
||||
"EncryptType": 'HLSEncryption'
|
||||
}
|
||||
}
|
||||
console.log('这是标准加密的视频');
|
||||
}
|
||||
|
||||
|
||||
@@ -912,6 +918,31 @@
|
||||
...playerOptions,
|
||||
source: this.videoData.videoUrl
|
||||
}
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user