lex hace 1 año
padre
commit
1bb0267698

+ 6 - 2
src/views/attend-class/component/video-play.tsx

@@ -237,13 +237,17 @@ export default defineComponent({
           }}>
           <div class={styles.actions}>
             <div class={styles.actionWrap}>
-              <button class={styles.actionBtn} onClick={onToggleVideo}>
+              <div
+                class={styles.actionBtn}
+                onClick={() => {
+                  onToggleVideo();
+                }}>
                 {videoFroms.paused ? (
                   <img class={styles.playIcon} src={iconplay} />
                 ) : (
                   <img class={styles.playIcon} src={iconpause} />
                 )}
-              </button>
+              </div>
             </div>
             <div class={styles.time}>
               <div

+ 3 - 1
src/views/attend-class/component/video.module.less

@@ -22,6 +22,7 @@
     display: flex;
     align-items: center;
     transition: all 0.301s;
+
     .time {
       display: flex;
       justify-content: space-between;
@@ -68,6 +69,7 @@
       height: 60px;
       padding: 4px 0;
       background: transparent;
+      cursor: pointer;
 
       &>img {
         width: 100%;
@@ -253,4 +255,4 @@
 //       }
 //     }
 //   }
-// }
+// }

+ 10 - 1
src/views/attend-class/index.tsx

@@ -496,12 +496,20 @@ export default defineComponent({
           activeItem.iframeRef?.handleChangeAudio('pause');
         }
 
+        console.log(activeItem.type, 'activeItem.type');
         if (activeItem.type === 'RHYTHM') {
           activeItem.iframeRef?.contentWindow?.postMessage(
             { api: 'setPlayState', data: false },
             '*'
           );
         }
+
+        if (activeItem.type === 'LISTEN') {
+          activeItem.iframeRef?.contentWindow?.postMessage(
+            { api: 'setPlayState' },
+            '*'
+          );
+        }
       }
     };
     // 切换素材
@@ -894,7 +902,8 @@ export default defineComponent({
         handlePreAndNext('down');
       } else if (e.code === 'Space') {
         // const activeItem = data.itemList[popupData.activeIndex];
-        // // // 暂停视频和曲谱的播放
+        // console.log(activeItem, activeItem.videoEle);
+        // // 暂停视频和曲谱的播放
         // if (activeItem.type === 'VIDEO' && activeItem.videoEle) {
         //   activeItem.videoEle?.play();
         // }