|
@@ -36,7 +36,6 @@
|
|
|
:currentIndex="course.key || ''"
|
|
:currentIndex="course.key || ''"
|
|
|
@timeUpdate="handleVideoTimeUpdate"
|
|
@timeUpdate="handleVideoTimeUpdate"
|
|
|
@videoEnded="handleVideoEnded"
|
|
@videoEnded="handleVideoEnded"
|
|
|
- @switchVideo="switchVideo"
|
|
|
|
|
/>
|
|
/>
|
|
|
<!-- 图片 -->
|
|
<!-- 图片 -->
|
|
|
<ImageView v-if="course.courseContentType === 'image'" :imagePath="course.courseImagePath" altText="课程图片"></ImageView>
|
|
<ImageView v-if="course.courseContentType === 'image'" :imagePath="course.courseImagePath" altText="课程图片"></ImageView>
|
|
@@ -186,22 +185,6 @@ const blocklyDataScope = ref([])
|
|
|
// 测试账号禁用视频
|
|
// 测试账号禁用视频
|
|
|
const isDisabled = ref(false)
|
|
const isDisabled = ref(false)
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-// 视频切换事件处理函数
|
|
|
|
|
-const switchVideo = (index) => {
|
|
|
|
|
- // 根据索引切换视频
|
|
|
|
|
- if (videoPathMap.value[index]) {
|
|
|
|
|
- course.value = videoPathMap.value[index]
|
|
|
|
|
- courseId.value = course.value.id
|
|
|
|
|
- console.log("课程id:",courseId.value)
|
|
|
|
|
- } else {
|
|
|
|
|
- //视频不存在
|
|
|
|
|
- Message().notifyWarning('视频不存在!', true)
|
|
|
|
|
- }
|
|
|
|
|
- //测试账号禁用视频
|
|
|
|
|
- if (disableVideo(index)) return
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
// 展平所有菜单项索引
|
|
// 展平所有菜单项索引
|
|
|
const flattenMenuItems = () => {
|
|
const flattenMenuItems = () => {
|
|
|
const indices = []
|
|
const indices = []
|
|
@@ -269,40 +252,8 @@ const handleVideoEnded = () => {
|
|
|
)
|
|
)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 如果是图片类型,不需要自动播放下一个
|
|
|
|
|
- if (course.value.courseContentType === 'video') {
|
|
|
|
|
- const allIndices = flattenMenuItems()
|
|
|
|
|
- const currentIndexInList = allIndices.indexOf(course.value.key)
|
|
|
|
|
- if (currentIndexInList !== -1 && currentIndexInList < allIndices.length - 1) {
|
|
|
|
|
- const nextIndex = allIndices[currentIndexInList + 1]
|
|
|
|
|
- if (videoPathMap.value[nextIndex]) {
|
|
|
|
|
- course.value = videoPathMap.value[nextIndex]
|
|
|
|
|
- courseId.value = course.value.id
|
|
|
|
|
- console.log("课程id:",courseId.value)
|
|
|
|
|
- //测试账号禁用视频
|
|
|
|
|
- if (disableVideo(nextIndex)) return
|
|
|
|
|
- } else {
|
|
|
|
|
- //视频不存在
|
|
|
|
|
- Message().notifyWarning('视频不存在!', true)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const allIndices = flattenMenuItems()
|
|
|
|
|
- const currentIndexInList = allIndices.indexOf(course.value.key)
|
|
|
|
|
- if (currentIndexInList !== -1 && currentIndexInList < allIndices.length - 1) {
|
|
|
|
|
- const nextIndex = allIndices[currentIndexInList + 1]
|
|
|
|
|
- if (videoPathMap.value[nextIndex]) {
|
|
|
|
|
- course.value = videoPathMap.value[nextIndex]
|
|
|
|
|
- courseId.value = course.value.id
|
|
|
|
|
- console.log("课程id:",courseId.value)
|
|
|
|
|
- //测试账号禁用视频
|
|
|
|
|
- if (disableVideo(nextIndex)) return
|
|
|
|
|
- } else {
|
|
|
|
|
- //视频不存在
|
|
|
|
|
- Message().notifyWarning('视频不存在!', true)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 自动播放下一个
|
|
|
|
|
+ playNextVideo();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// 禁用视频
|
|
// 禁用视频
|