Commit bac31e7e authored by liujiaxin's avatar liujiaxin

222

parent 18c897cd
import { Component, ElementRef, ViewChild, OnInit, Input, OnDestroy, HostListener, OnChanges, AfterViewInit, ApplicationRef, ChangeDetectorRef } from '@angular/core'; import { ApplicationRef, ChangeDetectorRef, Component, ElementRef, ViewChild, OnInit, Input, OnDestroy, HostListener, OnChanges, AfterViewInit } from '@angular/core';
import * as _ from 'lodash'; import * as _ from 'lodash';
import { import {
Label, Label,
...@@ -51,12 +51,10 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni ...@@ -51,12 +51,10 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni
@Input() sid; @Input() sid;
showQuestion: boolean; showQuestion: boolean;
constructor(private appRef: ApplicationRef, constructor(private appRef: ApplicationRef,
private changeDetectorRef: ChangeDetectorRef) { private changeDetectorRef: ChangeDetectorRef) {
} }
ngOnInit() { ngOnInit() {
this.data = { this.data = {
contentObj: { contentObj: {
...@@ -73,6 +71,8 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni ...@@ -73,6 +71,8 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni
if (data && typeof data === 'object') { if (data && typeof data === 'object') {
console.log(3333, data); console.log(3333, data);
this.data = data; this.data = data;
}
console.log(4444, data); console.log(4444, data);
this.audio.pause(); this.audio.pause();
this.audio.currentTime = 0; this.audio.currentTime = 0;
...@@ -82,8 +82,13 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni ...@@ -82,8 +82,13 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni
this.audio.load(); this.audio.load();
} }
this.showQuestion = false; this.showQuestion = false;
} this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
this.refresh();
if(window["air"]) {
window["air"].hideAirClassLoading(this.saveKey, this.data); window["air"].hideAirClassLoading(this.saveKey, this.data);
}
}, this.saveKey); }, this.saveKey);
this.audio.onended = () => { this.audio.onended = () => {
......
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