This commit is contained in:
2024-10-16 16:53:39 +08:00
parent c1f78fe598
commit ac451d6403
28 changed files with 4148 additions and 607 deletions

View File

@@ -116,11 +116,13 @@ export default {
},
},
//
mounted() { this.platform = this.$platform;
this.show = false;
if (uni.getStorageSync("videoOssList")) {
this.videoOssList = JSON.parse(uni.getStorageSync("videoOssList"));
}},
mounted() {
this.platform = this.$platform;
this.show = false;
if (uni.getStorageSync("videoOssList")) {
this.videoOssList = JSON.parse(uni.getStorageSync("videoOssList"));
}
},
//子组件销毁前
beforeDestroy() {
this.handleEnd();
@@ -132,7 +134,6 @@ export default {
// console.log("触发了更新");
},
methods: {
emitDispose1(status) {
this.$emit("handleSuccessDispose", status);
},
@@ -176,6 +177,15 @@ export default {
//播放结束
async handleEnd() {
// uni.showModal({
// title: "更新提示",
// content: "新版本已经准备好,是否重启应用?",
// success(res) {
// if (res.confirm) {
// }
// },
// });
this.setVideoTime();
},
//存播放进度
@@ -416,11 +426,20 @@ export default {
initAliyunPlayer() {
console.log("实例创建中 at line 436:", "实例创建中");
$("#url-player-test").empty();
// const saveTime = function (memoryVideo,currentTime) {
// console.log(memoryVideo, currentTime)
// }
// const getTime = function (memoryVideo) {
// /* return返回的是自定义起播时间 */
// return 20
// }
var components = [
{
name: "RateComponent", //倍速组件
type: AliPlayerComponent.RateComponent,
},
];
if (this.platform != "ios") {
var fullScreenButtonComponent = Aliplayer.Component({
@@ -443,6 +462,8 @@ export default {
name: "adComponent", //自定义全屏组件
type: fullScreenButtonComponent,
},
];
}
@@ -477,9 +498,17 @@ export default {
if (this.platform == "ios") {
this.player.one("canplay", () => {
this.player.seek(this.firstTime);
// uni.showToast({
// title: '已为您定位至上次观看位置'
// })
});
} else {
this.player.seek(this.firstTime);
// uni.showToast({
// title: '已为您定位至上次观看位置'
// })
}
this.player.one("timeupdate", () => {
@@ -527,6 +556,7 @@ export default {
},
//调用 handleEnd 存储视频播放信息
endEmitData(event, ownerInstance) {
ownerInstance.callMethod("handleEnd");
},

View File

@@ -0,0 +1,413 @@
<template>
<view
class="container playerBox"
id="playerBox"
style="
background-color: #fff;
width: 100%;
height: 200px;
padding: 20rpx;
box-sizing: border-box;
position: relative;
"
>
<cx-audio :list="list" ref="cxaudio" :autoplays="true" @curTime="recordTime" :firstTime="firstTime">
<template slot="title" slot-scope="slotProps">
<view style="color: #fff; text-align: center;font-size: 36rpx;"
>{{ curriculumData.title }}
</view>
<view style="color: #fff; text-align: center;font-size: 28rpx;margin-top: 10px;"
>音频
{{ Number(currentVideoIndex+1)>10? Number(currentVideoIndex+1):'0'+ Number(currentVideoIndex+1) }}
</view>
</template>
</cx-audio>
</view>
</template>
<script>
import cxAudio from "./cx-audio-play.vue";
import store from "@/store/index.js";
import $http from "@/config/requestConfig.js";
import { mapState, mapMutations } from "vuex";
export default {
components: {
cxAudio,
},
props: {
videoData: {
type: Object,
default: {},
},
curriculumData: {
type: Object,
default: {},
},
videoInfo: {
type: Object,
default: {},
},
firstTime: {
type: Number,
default: 0,
},
currentVideoIndex: {
type: Number,
default: 0,
},
},
data() {
return {
list: [],
show: false, //视频提示显示
isDipose: false, //视频提示显示
content: "此设备暂不支持观看当前视频,请移步到安卓手机进行学习!",
platform: null, //设备类型
isFullScreen: false, //当前是否是全屏模式
isOnLoad: false, //是否刷新
isChange: false, //是否切换播放源
videoList: [], //视频列表
videoOssList: [], //本地视频列表
options: {}, //父组件传参
currentTime: "", //当前播放时间
isSetFirstTime: false, //是否获取到初始播放时间
urlList: {
checkVideo: "sociology/course/checkVideo",
},
};
},
computed: {
// ...mapState(["videoOssList"]),
},
watch: {
timer(newValue) {
this.$emit("child-event", newValue);
},
videoOssList: {
immediate: true,
handler(newValue) {
if (this.videoOssList.length > 0) {
uni.setStorageSync("videoOssList", JSON.stringify(this.videoOssList));
}
},
},
},
//
created() {
this.platform = this.$platform;
this.show = false;
if (uni.getStorageSync("videoOssList")) {
this.videoOssList = JSON.parse(uni.getStorageSync("videoOssList"));
}
this.list=[this.videoData.source]
},
mounted(){
this.init();
},
//子组件销毁前
beforeDestroy() {
this.handleEnd();
clearInterval(this.$store.state.videoTimer);
plus.screen.lockOrientation("portrait-primary");
},
updated() {
// console.log("触发了更新");
},
methods: {
init() {
console.log("at line 101:", "初始化");
console.log('this.list.push at line 127:', this.list)
this.$nextTick(() => {
this.$refs.cxaudio.init();
});
},
emitDispose1(status) {
this.$emit("handleSuccessDispose", status);
},
destory() {
// this.isDipose = true;
},
//ios不能播放私有加密提示信息
openShow() {
this.show = true;
},
changeVideoData() {
this.show = false;
this.isChange = false;
},
screenChange(data) {
this.isFullScreen = !data.status;
this.$emit("changeScreen", this.isFullScreen);
},
calcTimer(time){
console.log('time at line 111111111111111151:', time)
},
//当前播放时间 存本地
recordTime(time) {
this.currentTime = time;
var list = [...this.videoOssList];
var index = list.findIndex((e) => e.id == this.currentVideoId);
var setData = {
id: this.currentVideoId,
vid: this.videoData.vid,
time: time,
};
if (list.length > 0 && index >= 0) {
list[index] = setData;
} else {
list.push(setData);
}
this.videoOssList = list;
if (this.currentTime % 60 == 0) {
this.setVideoTime();
}
},
//播放结束
async handleEnd() {
this.setVideoTime();
},
//存播放进度
setVideoTime() {
console.log('存播放进度',this.currentTime)
if (!this.videoData.id) {
return false;
}
var data = {
videoId: this.videoData.id,
position: this.currentTime ? this.currentTime : 0, //秒数
loadAnimate: "none",
};
$http
.request({
url: `sociology/course/saveCoursePosition`,
method: "Post",
data,
header: {
"Content-Type": "application/json",
},
})
.then((res) => {});
},
//定时器 存播放进度
async setVideoFirtsetTime() {
this.setVideoTime();
},
},
};
</script>
<style>
.container {
width: 100vw;
height: auto;
/deep/.pause {
width: 60rpx !important;
height: 60rpx !important;
}
}
.fds {
background-color: blue;
height: 600rpx;
position: fixed;
top: 60rpx;
}
.returnBack {
flex-direction: row;
justify-content: flex-start;
align-items: center;
height: 88rpx;
padding-left: 20rpx;
}
.txt {
color: #fff;
}
.right_title {
background: #000;
height: 96rpx;
justify-content: space-between;
flex-direction: row;
align-items: center;
margin-left: auto;
}
.return {
flex-direction: row;
align-items: center;
color: #fff;
}
.right_handle {
width: 200rpx;
flex-direction: row;
justify-content: flex-end;
padding-right: 20rpx;
}
cover-view {
display: block;
line-height: 1.2;
overflow: hidden;
white-space: nowrap;
pointer-events: auto;
}
cover-view {
visibility: visible !important;
}
cover-image {
visibility: visible !important;
}
.fullScreenButton-container {
color: #fff;
float: right;
height: 35px;
margin-top: 6px;
margin-right: 5px;
display: flex;
align-items: center;
position: relative;
i {
color: #fff;
display: inline-block;
font-size: 22px;
display: block;
margin-top: 7px;
cursor: pointer;
& + i {
margin-left: 3px;
}
@media (min-width: 768px) {
&:hover + .player-tooltip {
display: block;
}
}
}
.player-tooltip {
&.prev {
left: -10px;
}
&.list {
left: 5px;
}
&.next {
right: -12px;
}
}
}
.playlist-content {
position: absolute;
right: 0;
width: 0px;
padding-bottom: 48px;
box-sizing: border-box;
height: 100%;
transition: all 0.38s ease-in-out;
overflow: hidden;
.list {
background-color: #000;
background-color: rgba(0, 0, 0, 0.3);
height: 100%;
overflow: auto;
.video-item {
color: #fff;
padding: 0px 10px;
line-height: 35px;
font-size: 14px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
&.active {
background-color: #000;
color: #00ddff;
}
@media (min-width: 768px) {
&:hover {
background-color: #000;
color: #00ddff;
}
}
}
}
}
.player-tooltip {
position: absolute;
display: none;
font-size: 12px;
color: #fff;
line-height: 28px;
letter-spacing: 0;
text-align: center;
background: #3c3c3c;
box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.1);
height: 28px;
top: -48px;
padding: 0 5px;
white-space: nowrap;
}
.playlist-skip-tip {
padding: 5px 15px;
position: absolute;
top: 50%;
left: 50%;
z-index: 30;
line-height: 30px;
font-size: 14px;
border-radius: 4px;
background: rgba(255, 255, 255, 0.8);
color: #000;
text-align: center;
transform: translate(-50%, -50%);
}
#rotating-div {
width: 100vw;
height: 100vh;
background-color: #3498db;
transform: rotate(90deg);
/* 旋转90度 */
transform-origin: center center;
/* 设置旋转中心点在div中心 */
position: fixed;
/* 固定定位,全屏显示 */
left: 0;
top: 0;
bottom: 0;
right: 0;
}
.playerBox {
}
</style>

View File

@@ -0,0 +1,620 @@
<template>
<!--音频组件-->
<view
class="boxShadow"
style="
width: 100%;
border-radius: 40rpx;
height: 100%;
padding: 40rpx 0;
box-sizing: border-box;
background-image: linear-gradient(80deg, #959698 0%, #808183 100%);
"
>
<view class="bgfff">
<view>
<slot name="title"></slot>
<view class="audo-video">
<view class="slider-box">
<text class="mm">{{ timer }}</text>
<slider
style="width: calc(100% - 280rpx)"
@change="sliderChange"
@changing="sliderChanging"
class="audio-slider"
block-size="16"
:min="0"
:max="duration"
:value="currentTime"
activeColor="#FF8849"
@touchstart="lock = true"
@touchend="lock = false"
/>
<text class="ss" v-if="overTimer != 'NaN:NaN'">{{
overTimer
}}</text>
<text class="ss" v-else>00.00</text>
</view>
<!--音频播放按钮处-->
<view class="audo-top">
<!--上一首-->
<!-- <image
src="./icon/xys.png"
style="width: 40rpx; height: 40rpx; transform: rotate(180deg)"
mode="aspectFill"
@click="upper(1)"
></image> -->
<!--上一首-->
<!--快退-->
<image
src="./icon/kt.png"
style="width: 40rpx; height: 40rpx"
mode="widthFix"
@click="jump('kt')"
></image>
<!--快退-->
<!--播放-->
<image
src="./icon/kt.png"
style="width: 100rpx; height: 100rpx"
mode="widthFix"
@click="plays()"
></image>
<!--播放-->
<!--快进-->
<image
src="./icon/kj.png"
style="width: 40rpx; height: 40rpx"
mode="widthFix"
@click="jump('kj')"
></image>
<!--快进-->
<!--下一首-->
<!-- <image
src="./icon/xys.png"
style="width: 40rpx; height: 40rpx"
mode="aspectFill"
@click="upper(2)"
></image> -->
<!--下一首-->
<view class="audo-a" style="">
<!--进度条-->
<!--进度条-->
<!--倍数-->
<view
class="beishu"
style="border: 1rpx solid #e1dbf2"
@click="beishu"
>{{ BsNav[bsindex].bs }} X
</view>
<view class="absolute" style="right: 0; top: 80rpx" v-if="shows">
<!-- <u-transition :show="show" mode="slide-right" duration="300"> -->
<view
class="beishu-a"
style="border: 1rpx solid #fff"
v-if="show"
>
<view
v-for="(item, index) in BsNav"
:key="index"
@click="setRate(index, item)"
class="title beishuItem"
:style="{ color: bsid == item.id ? '#9461EB' : '' }"
>
{{ item.bs }} X
</view>
</view>
<!-- </u-transition> -->
</view>
<!--倍数-->
</view>
</view>
<!--音频播放按钮处-->
<!--音频api处[视频代替音频-实现倍数功能]-->
<video
id="myVideo"
ref="myVideo"
:src="recorPath"
class="hidden"
@timeupdate="timeupdate"
:autoplay="autoplays"
@loadedmetadata="loadedmetadata"
@ended="next"
controls
style="width: 10rpx; height: 10rpx"
></video>
<!--音频api处[视频代替音频-实现倍数功能]-->
</view>
</view>
</view>
<!--占位-->
</view>
<!--音频组件 wx:cxalq8-24 Author:chenxin-->
</template>
<script>
/*
list -- 音频数据: 数组格式/不传无法播放
Seconds -- 快进快退秒数: 默认15秒
autoNext -- 是否自动播放下一首
autoplays -- 进入页面是否自动播放 - 默认false
slideYes -- 滑动进度条时是否开启播放 - 默认false
switAud -- 切换上下音频是否开启播放 - 默认true
BsNav -- 倍数数据传入/数组形式
图片功能样式,如想改动请在组件内部修改,页面中已注释 -- 逻辑根据自己需求改
目前只测试 微信小程序和H5和APP -- 其他平台未知
[Author:chenxin 交流vx:cxalq8-24]
*/
export default {
name: "cx-audio-play",
props: {
list: {
//音频数据
Type: Array,
default: () => [],
},
Seconds: {
//快进快退 - 秒数
Type: Number,
default: 15,
},
firstTime: {
//快进快退 - 秒数
Type: Number,
default: 0,
},
autoNext: {
//是否自动播放下一首
Type: Boolean,
default: false,
},
autoplays: {
//是否开启自动播放
Type: Boolean,
default: false,
},
slideYes: {
//滑动进度条 - 是否开启播放
Type: Boolean,
default: false,
},
switAud: {
Type: Boolean, //切换上下音频 - 是否开启播放
default: true,
},
BsNav: {
//倍数-传入
Type: Array,
default: () => [
{
id: 1.0,
bs: "1.0",
},
{
id: 1.5,
bs: "1.5",
},
{
id: 2.0,
bs: "2.0",
},
],
},
},
data() {
return {
shows: false, //倍数弹框
show: true, //倍数弹框动画默认开启
succes: false, //播放按钮
bsid: "", //倍数默认显示第一个
bsindex: 0, //倍数默认显示第一个
num: 0,
current: 0, //当前选中的索引
recorPath: "", //音频播放地址
lock: false, // 锁
currentTime: 0, //当前进度
duration: 100, // 总进度
videoContext: null,
loading: true, //锁 加载
curTime: null, //锁 加载
};
},
onReady() {},
onShow() {},
mounted() {
//初始化音频api
},
updated() {},
onLoad() {},
onHide() {
//监听页面离开 - 销毁音频
this.stop_();
this.$emit("curTime", this.curTime);
},
onUnload() {
//监听页面卸载 - 销毁音频
this.stop_();this.$emit("curTime", this.curTime);
},
destroyed() {
// this.innerAudioContext.stop();
},
computed: {
timer() {
this.curTime = this.currentTime;
return calcTimer(this.currentTime);
},
overTimer() {
this.curTime = this.duration;
return calcTimer(this.duration);
},
},
methods: {
init() {
this.currentTime=this.firstTime;
this.videoContext = uni.createVideoContext("myVideo", this);
//默认播放第一个
if (this.list.length != 0) {
this.recorPath = this.list[0];
if (this.autoplays) {
this.succes = true;
}
} else {
this.duration = 0;
}
//倍数默认选择第一个
if (this.BsNav.length != 0) {
this.bsid = this.BsNav[0].id;
this.playbackRate(); //倍数
}
this.seek(this.firstTime);
this.curTime = this.currentTime
},
//没有音频数据
noUrl() {
if (this.list.length == 0) {
uni.showToast({
title: "请先传入音频数据哦~",
icon: "none",
});
return false;
}
return true;
},
//播放暂停
plays() {
if (!this.noUrl()) {
return;
}
this.playLoading();
this.succes = !this.succes;
this.succes ? this.play_() : this.pause_();
},
//上下首切换
upper(num) {
if (!this.noUrl()) {
return;
}
let that = this;
if (num == 1) {
//上一首
if (this.num == 0) {
this.upperToast(num); //提示
return;
}
this.num -= 1;
} else {
//下一首
if (this.num + 1 == this.list.length) {
this.upperToast(num); //提示
return;
}
this.num += 1;
}
this.recorPath = this.list[this.num];
if (this.switAud) {
// 切换时是否开启播放
this.succes = true;
this.play_();
} else {
this.succes = false;
}
this.playbackRate(); //倍数
console.log("当前音频:", this.recorPath);
},
//快进快退
jump(e) {
if (!this.noUrl()) {
return;
}
var num;
if (e == "kt") {
num = (this.currentTime - Math.floor(this.Seconds % 60)).toFixed(0); //当前时间-15秒
} else {
num = (this.currentTime + Math.floor(this.Seconds % 60)).toFixed(0); //当前时间+15秒
}
this.seek(num);
},
seek(num) {
this.$nextTick(() => {
//#ifdef H5
this.$refs.myVideo.seek(num);
//#endif
//#ifndef H5
this.videoContext.seek(num);
//#endif
});
},
//倍速弹框
beishu() {
this.shows = !this.shows;
},
// 倍速
setRate(index, item) {
this.bsid = item.id;
this.bsindex = index;
this.shows = false;
this.playbackRate();
},
// 更新进度条
timeupdate(event) {
if (this.lock) return; // 锁
var currentTime, duration;
if (event.detail.detail) {
currentTime = event.detail.detail.currentTime;
duration = event.detail.detail.duration;
} else {
currentTime = event.detail.currentTime;
duration = event.detail.duration;
}
this.currentTime = currentTime;
this.duration = duration;
},
// 拖动进度条
sliderChange(data) {
if (!this.noUrl()) {
return;
}
//此处滑动进度条--开始播放
if (this.slideYes && !this.succes) {
this.play_();
this.succes = true;
}
//#ifdef H5
this.$refs.myVideo.seek(data.detail.value); //获取秒数
//#endif
//#ifndef H5
this.videoContext.seek(data.detail.value); //获取秒数
//#endif
},
//拖动中
sliderChanging(data) {
if (data.detail.value == 0) {
this.succes = false;
this.pause_();
}
this.currentTime = data.detail.value;
},
// 视频加载完成
loadedmetadata(data) {
this.duration = data.detail.duration;
},
//音频结束触发
next(data) {
this.succes = false;
if (this.autoNext) {
//自动播放下一首
this.upper(2);
}
},
// 各平台播放_暂停
play_() {
this.$nextTick(() => {
//#ifdef H5
this.$refs.myVideo.play();
//#endif
//#ifndef H5
this.videoContext.play();
//#endif
});
},
pause_() {
this.$nextTick(() => {
//#ifdef H5
this.$refs.myVideo.pause();
//#endif
//#ifndef H5
this.videoContext.pause();
//#endif
});
},
//离开页面暂停播放
stop_() {
this.$nextTick(() => {
//#ifdef H5
this.$refs.myVideo.stop();
//#endif
//#ifndef H5
this.videoContext.stop();
//#endif
});
},
//提示
upperToast(num) {
num == 1
? uni.showToast({
title: "到头了~",
icon: "none",
})
: uni.showToast({
title: "没有更多了~",
icon: "none",
});
},
//音频倍数
playbackRate() {
this.$nextTick(() => {
//#ifdef H5
this.$refs.myVideo.playbackRate(this.bsid);
//#endif
//#ifndef H5
this.videoContext.playbackRate(this.bsid);
//#endif
});
},
//加载框--封
playLoading() {
if (this.loading && !this.succes) {
uni.showLoading({
title: "音频加载中...",
});
this.loading = false;
}
setTimeout(() => {
uni.hideLoading();
}, 1500);
},
},
watch: {
//播放器当前播放进度
curTime(val) {
if (this.curTime !== null) {
console.log("timer at line 495:", this.curTime);
this.$emit("curTime", this.curTime);
}
},
},
};
//时间换算
function calcTimer(timer) {
console.log('timer at line 514:', timer)
if (timer === 0 || typeof timer !== "number") {
return "00:00";
}
let mm = Math.floor(timer / 60);
let ss = Math.floor(timer % 60);
if (mm < 10) {
mm = "0" + mm;
}
if (ss < 10) {
ss = "0" + ss;
}
return mm + ":" + ss;
}
</script>
<style lang="scss" scoped>
page {
background-color: #f8f8f8;
}
/* #video {
width: 100%;
} */
.audo-video {
margin-top: 0rpx;
color: #fff;
.beishuItem {
color: #999;
}
}
.slider-box {
display: flex;
align-items: center;
justify-content: center;
font-size: 27rpx;
// color: #fff;
}
button {
display: inline-block;
width: 100rpx;
background-color: #fff;
font-size: 24rpx;
color: #000;
padding: 0;
}
.hidden {
position: fixed;
top: 0;
left: -10rpx;
z-index: -1;
width: 1rpx;
height: 1rpx;
}
.audo-top {
padding: 20rpx 0;
display: flex;
justify-content: space-around;
align-items: center;
image {
width: 45rpx;
height: 45rpx;
}
}
.audo-a {
display: flex;
justify-content: space-between;
align-items: center;
width: auto;
position: relative;
z-index: 9;
margin-right: -20rpx;
}
.beishu {
position: relative;
width: 100rpx;
padding-top: 5rpx;
padding-bottom: 5rpx;
text-align: center;
border-radius: 25rpx;
font-size: 28rpx;
}
.absolute {
position: absolute;
.beishu-a {
width: 200rpx;
border-radius: 20rpx;
text-align: center;
line-height: 90rpx;
background: #fff;
.title {
pdding-left: 30rpx;
}
}
}
</style>

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@@ -29,16 +29,32 @@
此设备暂不支持观看当前视频<br />请移步到安卓手机进行学习
</view>
<view v-else>
<common-list-aliyun
id="AliPlayer"
:showAliYunPlayer="showAliYunPlayer"
@handleSuccessDispose="handleSuccessDispose"
ref="commonVideoAliyun"
v-if="showAliYunPlayer"
:videoData="videoData"
:firstTime="firstTime"
>
</common-list-aliyun>
<template v-if="showAliYunPlayer">
<common-list-audio
id="commonAudio"
:showAliYunPlayer="showAliYunPlayer"
@handleSuccessDispose="handleSuccessDispose"
ref="commonVideoAliyun1"
v-if="videoInfo.type == 2"
:videoData="videoData"
:currentVideoIndex="currentVideoIndex"
:videoInfo="videoInfo"
:curriculumData="curriculumData"
:firstTime="firstTime"
>
</common-list-audio>
<common-list-aliyun
id="AliPlayer"
:showAliYunPlayer="showAliYunPlayer"
@handleSuccessDispose="handleSuccessDispose"
ref="commonVideoAliyun"
v-if="videoInfo.type != 2"
:videoData="videoData"
:firstTime="firstTime"
>
</common-list-aliyun>
</template>
<view v-else style="height: 200px"> </view>
</view>
</view>
@@ -54,6 +70,18 @@ export default {
type: Number,
default: null,
},
currentVideoIndex: {
type: Number,
default: null,
},
curriculumData: {
type: Object,
default: {},
},
secondCountDown: {
type: Number,
default: null,
},
isfresh: {
type: Boolean,
default: false,
@@ -61,6 +89,8 @@ export default {
},
data() {
return {
showCountDown: false,
playEndBlank: false,
flag: false, //视频提示显示
show: false, //视频提示显示
// isfresh: false, //视频提示显示
@@ -75,6 +105,7 @@ export default {
options: {}, //父组件传参
currentTime: "", //当前播放时间
videoData: {}, //获取当前的播放信息playAuthm3u8url
videoInfo: {}, //获取当前的播放信息playAuthm3u8url
isSetFirstTime: false, //是否获取到初始播放时间
firstTime: 0, //初始播放时间
@@ -136,6 +167,11 @@ export default {
},
beforeUpdate() {},
methods: {
hideNextVideo() {
this.showCountDown = false;
this.playEndBlank = false;
this.$emit("hideNextVideo");
},
destory() {
if (this.showAliYunPlayer) {
this.$nextTick(() => {
@@ -182,10 +218,13 @@ export default {
},
})
.then(async (res) => {
console.log("res at line 204:", res.video);
var that = this;
this.videoInfo=res.video
that.videoData = {
id: that.currentVideoId,
vid: res.video.video,
};
if (res.video.type == 1) {
@@ -225,7 +264,9 @@ export default {
that.firstTime = list[index].time ? list[index].time : 0;
}
}
if (res.video.duration - that.firstTime <= 2) {
that.firstTime = 0;
}
that.videoOssList = [...list];
}
@@ -238,6 +279,7 @@ export default {
<script module="renderScript" lang="renderjs">
import $ from "jquery";
export default {
data() {
return {
@@ -322,4 +364,24 @@ export default {
height: 60rpx !important;
}
}
.showCountDownd {
box-sizing: border-box;
height: 100%;
width: 100%;
background-color: rgba(0, 0, 0, 0.6);
display: flex;
align-items: center;
justify-content: flex-end;
color: #fff;
font-size: 38rpx;
text-align: center;
position: absolute;
top: 0;
right: 10rpx;
z-index: 4;
text {
}
}
</style>

View File

@@ -374,6 +374,7 @@ export default {
this.timer = null;
await this.setVideoTime();
},
setVideoTime(time) {
var data = {};