|
@@ -16,14 +16,6 @@ class AudioWareFullScreenScene extends scene {
|
|
|
audioPlayControl(eventId) {
|
|
|
let targetAudio = document.getElementById('courseware-audio');
|
|
|
if (!targetAudio) { return; }
|
|
|
- const changeContent = () => {
|
|
|
- // 更换图片
|
|
|
- let imgDom = document.getElementById('img-wrapper');
|
|
|
- let curAudio = this.curAudioList[this.curAudioIndex];
|
|
|
- const { bgUrl, playUrl } = curAudio;
|
|
|
- let newImg = `<img src="${Consts.IMG_PATH}/${bgUrl}" />`
|
|
|
- imgDom.innerHTML = newImg;
|
|
|
- }
|
|
|
switch (eventId) {
|
|
|
case 'audio-play':
|
|
|
let playBtn = document.querySelector('#audio-play');
|
|
@@ -49,12 +41,16 @@ class AudioWareFullScreenScene extends scene {
|
|
|
if (this.curAudioIndex < this.curAudioList.length -1) {
|
|
|
this.curAudioIndex += 1;
|
|
|
this.renderAudioView();
|
|
|
+ } else {
|
|
|
+ this.keyRightHandler();
|
|
|
}
|
|
|
break;
|
|
|
case 'audio-last':
|
|
|
if (this.curAudioIndex > 0) {
|
|
|
this.curAudioIndex -= 1;
|
|
|
this.renderAudioView();
|
|
|
+ } else {
|
|
|
+ this.keyLeftHandler();
|
|
|
}
|
|
|
break;
|
|
|
default:
|
|
@@ -229,18 +225,17 @@ class AudioWareFullScreenScene extends scene {
|
|
|
}
|
|
|
|
|
|
onKeydown(e) {
|
|
|
+ let curFocusedLeaf = FocusEngine.getFocusedLeaf();
|
|
|
switch (e.keyCode) {
|
|
|
//左键
|
|
|
case 37:
|
|
|
- // 如当前光标在控制按钮上,阻止向左
|
|
|
- if (!FocusEngine.getFocusedLeaf().id.startsWith('audio')) {
|
|
|
+ if (!curFocusedLeaf.id.startsWith('audio')) {
|
|
|
this.keyLeftHandler();
|
|
|
}
|
|
|
break;
|
|
|
//右键
|
|
|
case 39:
|
|
|
- // 如当前光标在控制按钮上,阻止向右
|
|
|
- if (!FocusEngine.getFocusedLeaf().id.startsWith('audio')) {
|
|
|
+ if (!curFocusedLeaf.id.startsWith('audio')) {
|
|
|
this.keyRightHandler();
|
|
|
}
|
|
|
break;
|