Bladeren bron

:twisted_rightwards_arrows: Merge branch 'dev_audio' into online_weichuang

zhanghe 6 jaren geleden
bovenliggende
commit
72803c6065
2 gewijzigde bestanden met toevoegingen van 8 en 4 verwijderingen
  1. 4 2
      src/stage/index/scene/AudioWareFullScreenScene.js
  2. 4 2
      src/stage/index/scene/LessonScene.js

+ 4 - 2
src/stage/index/scene/AudioWareFullScreenScene.js

@@ -96,9 +96,11 @@ class AudioWareFullScreenScene extends scene {
             // 监听onended事件
             let audioDom = document.getElementById('courseware-audio');
             if (audioDom) {
-                audioDom.onended = function () {
+                audioDom.addEventListener('ended', function () {
+                    TVUtil.Toast.show('播放结束', 1500);
                     document.getElementById('audio-play').classList.add('paused');
-                }
+                    audioDom.currentTime = 0;
+                }, false);
             }
             // 指定光标位置
             if (focusTarget && this.moye.root.getWidgetById(focusTarget)) {

+ 4 - 2
src/stage/index/scene/LessonScene.js

@@ -256,9 +256,11 @@ class LessonScene extends scene {
             // 监听onended事件
             let audioDom = document.getElementById('courseware-audio');
             if (audioDom) {
-                audioDom.onended = function () {
+                audioDom.addEventListener('ended', function () {
+                    TVUtil.Toast.show('播放结束', 1500);
                     document.getElementById('audio-play').classList.add('paused');
-                }
+                    audioDom.currentTime = 0;
+                }, false);
             }
             // 指定光标位置
             if (focusTarget && this.moye.root.getWidgetById(focusTarget)) {