This commit is contained in:
@fawn-nine
2024-07-23 17:05:19 +08:00
parent dfaa65c7a2
commit 172e0fa2be
2 changed files with 7 additions and 190 deletions

View File

@@ -1,21 +1,5 @@
<template> <template>
<view class="container" style="background-color: #000; position: relative"> <view class="container" style="background-color: #000; position: relative">
<!-- <u-modal :show="show" :title="videoTitle" :content='content'></u-modal> -->
<!-- <u-icon
@click="goBack"
name="arrow-left"
color="#3ab3ae"
size="20"
:style="`display: inline-block; position: absolute; top: ${
statusBarHeight + 2
}px; left: ${10}px;z-index: 999;`"
></u-icon>-->
<!-- <zhimi_aliplayer_view
ref="playerView"
style="width: 100%; height: 300px"
></zhimi_aliplayer_view>
<button type="primary" @click="start()">开始</button>
<button type="primary" @click="pause()">暂停</button> -->
<view style="width: 100%; height: 200px"> <view style="width: 100%; height: 200px">
<view v-if="show" style="height: 100%;display: flex;align-items:center;justify-content:center;color: #fff;font-size: 38rpx;text-align: center;"> <view v-if="show" style="height: 100%;display: flex;align-items:center;justify-content:center;color: #fff;font-size: 38rpx;text-align: center;">
此设备暂不支持观看当前视频<br/>请移步到安卓手机进行学习 此设备暂不支持观看当前视频<br/>请移步到安卓手机进行学习
@@ -168,7 +152,7 @@
const ctx = this.$refs.myVideo; const ctx = this.$refs.myVideo;
ctx.exitFullScreen(); ctx.exitFullScreen();
}, },
// // 播放器初始化
async init(data, isChange) { async init(data, isChange) {
this.show = false; this.show = false;
this.platform = this.$platform; this.platform = this.$platform;
@@ -183,61 +167,6 @@
console.log("这是苹果视屏id", this.videoId); console.log("这是苹果视屏id", this.videoId);
await this.getLive(isChange); await this.getLive(isChange);
}, },
async getVideo() {
var data = {};
var that = this;
$http
.request({
url: `sociology/course/ttt`,
method: "Post", // POST、GET、PUT、DELETE具体说明查看官方文档
data,
header: {
//默认 无 说明:请求头
"Content-Type": "application/json",
},
})
.then(async (res) => {
console.log(" 视频播放11111111111:", res);
var credentials = res.result.credentials;
that.$refs.playerView.setVidSts({
vid: this.videoData.video,
accessKeyId: credentials.accessKeyId,
securityToken: credentials.securityToken,
accessKeySecret: credentials.accessKeySecret,
expireTime: credentials.expireTime,
Region: "cn-shanghai",
});
let isFullScreen = true;
// fixed fullscreen play on android
if (plus.os.name.toLowerCase() === "android") {
plus.key.addEventListener("backbutton", (e) => {
if (isFullScreen) {
that.$refs.playerView.changeScreenMode(0, false);
isFullScreen = false;
} else {
// 这里由于安卓无法监听返回按键这里只能通过plus监听然后自己模拟退回
uni.navigateBack();
}
});
}
that.$refs.playerView.setPlayerCallBack(({
type,
data
}) => {
switch (type) {
case "isFullScreen":
isFullScreen = Boolean(data);
break;
default:
console.log({
type,
data,
});
}
});
});
},
// 配置播放项 // 配置播放项
async getData(data, isChange) { async getData(data, isChange) {
var that = this; var that = this;
@@ -524,6 +453,7 @@
var that = this; var that = this;
ownerInstance.callMethod('handleEnd', ) ownerInstance.callMethod('handleEnd', )
}, },
// renderjs阿里云播放器引入与配置
getLive() { getLive() {
console.log('这是这只只是666666:', this.firstTime, this.videoData) console.log('这是这只只是666666:', this.firstTime, this.videoData)
if (this.player) { if (this.player) {
@@ -800,6 +730,7 @@
// //数据变化 // //数据变化
console.log('currentVideoListcurrentVideoListcurrentVideoList', newValue) console.log('currentVideoListcurrentVideoListcurrentVideoList', newValue)
}, },
// 监听视频参数变化,并赋值给常量
receiveMsg(newValue, oldValue, ownerVm, vm) { receiveMsg(newValue, oldValue, ownerVm, vm) {
//数据变化 //数据变化
videoData = newValue videoData = newValue
@@ -819,7 +750,6 @@
this.checkValue(); this.checkValue();
}, 1000); }, 1000);
} else { } else {
console.log('这是这只只是594:', this.firstTime, this.videoData) console.log('这是这只只是594:', this.firstTime, this.videoData)
this.getLive(); this.getLive();
} }

View File

@@ -395,16 +395,6 @@ export default {
8888888888888888888888888 8888888888888888888888888
); );
// var result = await this.$commonJS.getCheckCourseStatus({
// oid: v.courseOid,
// });
// console.log("result at line 364:", result);
// if (result.buyFlg == 0 && v.conditions != "01") {
// this.$commonJS.showToast("请先购买课程");
// return;
// }
if ( if (
this.cateList[this.currentCateIndex].isBuy == 1 || this.cateList[this.currentCateIndex].isBuy == 1 ||
v.isAudition == 1 || v.isAudition == 1 ||
@@ -460,33 +450,6 @@ export default {
} }
console.log("data at line 380111111111111111111:", data.type); console.log("data at line 380111111111111111111:", data.type);
// var mynavData = JSON.stringify(data); // 这里转换成 字符串
// if (data.type == 0 || data.type == 2) {
// //1 mp4 2 mp3
// uni.navigateTo({
// url: `/pages/curriculum/order/curriculum/videoDetail?data=${mynavData}`,
// });
// } else if (data.type == 1) {
// //视频云点播
// uni.navigateTo({
// url: `/pages/curriculum/order/curriculum/videoDetailOss?data=${mynavData}`,
// });
// }
// else if (data.type == 2) {
// //mp3
// this.isOpenMp3 = true;
// this.$nextTick(() => {
// this.$refs.mp3Detail.init({ data: mynavData });
// });
// }
// uni.navigateTo({
// // url: '../bookShop/commodityDetail?id=' + item.id
// url: `/pages/curriculum/order/curriculum/detail?navTitle=${v.title}&title=${v.title}&oid=${v.oid}`,
// });
}, },
hancleModalCancel() { hancleModalCancel() {
this.show = false; this.show = false;
@@ -566,85 +529,9 @@ export default {
this.currentVideo = that.videoArray[that.currentCateIndex]; this.currentVideo = that.videoArray[that.currentCateIndex];
this.initVideo(); this.initVideo();
} }
// if (res.obj.correlatedList && res.obj.correlatedList.length > 0) {
// this.relatedCoursesList =
// res.obj.correlatedList && res.obj.correlatedList.length > 0
// ? res.obj.correlatedList
// : [];
// this.medicalCasesList =
// res.obj.dataList && res.obj.dataList.length > 0
// ? res.obj.dataList
// : [];
// this.commentLst =
// res.obj.commentLst && res.obj.commentLst.length > 0
// ? res.obj.commentLst
// : [];
// this.praise = res.obj.praise
// ? res.obj.praise
// .split("")
// .filter((e) => e != "")
// .join("")
// : "";
// this.reward = res.obj.reward
// ? res.obj.reward
// .split("")
// .filter((e) => e != "")
// .join("")
// : "";
// correlatedListEl.innerHTML = courseDot(ret.correlatedList);
// }
var videoArray = []; var videoArray = [];
var videoArrayHW = []; var videoArrayHW = [];
// break;
// switch (that.curriculumData.videoType) {
// case "01":
// // allDataList
// // voices
// that.videoArray = res.obj.videos.split(",");
// that.videoArrayHW = res.obj.videos.split(",");
// if (res.obj.dataLst && res.obj.dataLst.length > 0) {
// // dataGrid.innerHTML = dot(ret.dataLst);
// }
// break;
// case "02":
// that.videoArray = res.obj.videoId.split(",");
// if (res.obj.dataLst && res.obj.dataLst.length > 0) {
// // res.obj.dataLst
// console.log("res.obj.dataLst at line 436:", res.obj.dataLst);
// }
// break;
// // console.log(this.dataList.length, 6666666)
// break;
// }
// if (res.obj.w_videoIds != "") {
// // 海外视频
// // $mars.initAVDataHW(ret.oid,'1', 'videoHW', ret.w_videoIds, 'taiHuClass/');
// that.videoArrayHW = res.obj.w_videoIds.split(",");
// // if (ret.dataLst && ret.dataLst.length > 0) {
// // dataGrid.innerHTML = dot(ret.dataLst);
// // }
// // if (ret.correlatedList && ret.correlatedList.length > 0) {
// // correlatedListEl.innerHTML = courseDot(ret.correlatedList);
// // }
// }
// that.cateList = res.obj.courseTabs
// that.relatedCoursesList = res.obj.correlatedList
// await that.handleselectCate({ ...this.cateList[0], index: 0 })
// socket.init();
}); });
}, },
getPriceData() { getPriceData() {