Commit fd6c1e79 authored by Chen Jiping's avatar Chen Jiping

fix:修复音频播放问题

parent 04dd7a05
...@@ -95,6 +95,10 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -95,6 +95,10 @@ export class PlayComponent implements OnInit, OnDestroy {
bigCardRenderArr = []; bigCardRenderArr = [];
pic;
richText;
@HostListener('window:resize', ['$event']) @HostListener('window:resize', ['$event'])
onResize(event) { onResize(event) {
this.winResizeEventStream.next(); this.winResizeEventStream.next();
...@@ -919,6 +923,16 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -919,6 +923,16 @@ export class PlayComponent implements OnInit, OnDestroy {
callback(target); callback(target);
return; return;
} }
if(this.pic && this.checkClickTarget(this.pic)){
this.playAudio(this.curExercises.audioUrl, true);
return;
}
if(this.richText && this.checkClickTarget(this.richText)){
this.playAudio(this.curExercises.audioUrl, true);
return;
}
} }
mapMove(event) { mapMove(event) {
...@@ -1213,7 +1227,7 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1213,7 +1227,7 @@ export class PlayComponent implements OnInit, OnDestroy {
let scale = Math.min(mW / pic.width, mH / pic.height); let scale = Math.min(mW / pic.width, mH / pic.height);
pic.setScaleXY(scale); pic.setScaleXY(scale);
this.pic = pic;
this.renderArr.push(pic); this.renderArr.push(pic);
let richText = new RichText(); let richText = new RichText();
...@@ -1235,6 +1249,8 @@ export class PlayComponent implements OnInit, OnDestroy { ...@@ -1235,6 +1249,8 @@ export class PlayComponent implements OnInit, OnDestroy {
this.canTouch = true; this.canTouch = true;
}); });
this.richText = richText;
this.picBtn.visible = false;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment