<video
autoplay
:key="videoRenderKey"
:title="'第'+videoListConfig.episodeId +'集'"
class="video"
id="myVideo"
:controls="true"
:poster="videoInfo.coverUrl"
:src="videoInfo.videoUrl"
@timeupdate="onTimeUpdate"
@ended="videoPlayEnd"
></video>
videoPlayEnd(e) {
const currentId = this.videoListConfig.episodeId;
const isAsc = this.videoListConfig.sortOrder === 'asc';
const sortedList = isAsc ? this.videoListConfig.videoList : [...this.videoListConfig.videoList].reverse();
const currentIndex = sortedList.findIndex(item => item.episodeId === currentId);
// 计算下一个索引
let nextIndex = isAsc ? currentIndex + 1 : currentIndex - 1;
// 边界判断:根据升序/倒序使用不同条件
const hasNext = isAsc
? nextIndex < sortedList.length
: nextIndex >= 0;
if (hasNext) {
const nextEpisode = sortedList[nextIndex];
this.videoInfo.videoUrl = nextEpisode.videoUrl;
this.videoListConfig.episodeId = nextEpisode.episodeId;
this.historyEpisodeId.push(nextEpisode.episodeId)
const groupIndex = Math.floor(nextIndex / 32);
this.videoListConfig.currentGroupIndex = groupIndex;
this.$nextTick(() => {
this.resetProgressTriggers()
// const videoCtx = uni.createVideoContext('myVideo', this);
// videoCtx.play();
});
} else {
uni.showToast({
title: '已经是最后一集了',
icon: 'none'
});
}
},

- 发布:2025-06-10 10:00
- 更新:2025-06-10 10:00
- 阅读:23
产品分类: uniapp/App
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: 5.3.1 (24D70)
HBuilderX类型: 正式
HBuilderX版本号: 4.66
手机系统: iOS
手机系统版本号: iOS 16
手机厂商: 苹果
手机机型: 13 pro max
页面类型: vue
vue版本: vue3
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
在全屏模式下播放,动态src异常切换后视频异常
在全屏模式下播放,动态src异常切换后视频异常
预期结果:
正常全屏显示
正常全屏显示
实际结果:
退出全屏后,整个横向显示
退出全屏后,整个横向显示
bug描述:
video 播放器在结束播放的时候我动态切换了src视频源,在非全屏状态下正常,在全屏状态下会出现异常显示如图:

