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");
},