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 {
Label,
......@@ -51,12 +51,10 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni
@Input() sid;
showQuestion: boolean;
constructor(private appRef: ApplicationRef,
private changeDetectorRef: ChangeDetectorRef) {
private changeDetectorRef: ChangeDetectorRef) {
}
ngOnInit() {
this.data = {
contentObj: {
......@@ -73,17 +71,24 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni
if (data && typeof data === 'object') {
console.log(3333, data);
this.data = data;
console.log(4444, data);
this.audio.pause();
this.audio.currentTime = 0;
this.isPlaying = false;
if (this.data.contentObj && this.data.contentObj.audio_id ) {
this.audio.src = this.data.contentObj.audio_id;
this.audio.load();
}
this.showQuestion = false;
}
window["air"].hideAirClassLoading(this.saveKey, this.data);
console.log(4444, data);
this.audio.pause();
this.audio.currentTime = 0;
this.isPlaying = false;
if (this.data.contentObj && this.data.contentObj.audio_id ) {
this.audio.src = this.data.contentObj.audio_id;
this.audio.load();
}
this.showQuestion = false;
this.changeDetectorRef.markForCheck();
this.changeDetectorRef.detectChanges();
this.refresh();
if(window["air"]) {
window["air"].hideAirClassLoading(this.saveKey, this.data);
}
}, this.saveKey);
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