阿里云播放器重写....未完成

This commit is contained in:
@fawn-nine
2024-08-02 16:26:50 +08:00
parent 7ee7b52c93
commit f726ecf29a
3 changed files with 28 additions and 10 deletions

View File

@@ -48,7 +48,6 @@ export default {
},
handleClick(data) {
console.log("data at line 35:", data);
this.$emit("open", data);
},

View File

@@ -126,11 +126,13 @@
this.isChange = false;
},
async changeVideo(data) {
console.log('changeVideo',);
this.currentTime = "";
this.firstTime = 0;
this.isSetFirstTime = false;
this.isChange = false;
await this.init(data, true);
this.getLive(true, this.currentVideo)
// await this.init(data, true);
},
screenChange(data) {
console.log(
@@ -232,13 +234,17 @@
uni.setStorageSync("videoOssList", JSON.stringify(list));
},
// 获取播放凭证
async getLive(isChange) {
async getLive(isChange,newVideoData) {
var that = this;
this.isfresh = false;
var data = {
...this.options,
};
if(isChange && newVideoData){
data = {
...newVideoData,
};
}
await $http
.request({
url: `sociology/course/checkVideo`,
@@ -358,7 +364,7 @@
var _seconds = 0
var curStatus = null
var diff = 0
var myplayer = undefined
import $ from 'jquery'
export default {
components: {
@@ -654,7 +660,9 @@
}
var player = new Aliplayer(playerOptions, function(player) {});
this.player = player;
this.player = player;
myplayer = player;
console.log('myplayer------------',myplayer);
console.log('是否拿到第一次初始值呢', this.platform, typeof this.firstTime, this.firstTime)
player.on('ready', function() {
@@ -747,6 +755,15 @@
receiveMsg(newValue, oldValue, ownerVm, vm) {
//数据变化
videoData = newValue
if(videoData){
if(videoData.type == 1){
if(videoData.m3u8Url != '' && videoData.m3u8Url != null){
// myplayer.source(videoData.m3u8Url)
console.log('走了吗?');
}
}
}
console.log('可能是切换视频',myplayer,videoData,);
},
receiveWinWidth(newValue, oldValue, ownerVm, vm) {
//数据变化