Commit 53a1587e authored by liujiangnan's avatar liujiangnan

fix: 播放问题

parent 4b441059
import { Component, ElementRef, ViewChild, OnInit, Input, OnDestroy, HostListener, OnChanges, AfterViewInit } from '@angular/core'; import { Component, ElementRef, ApplicationRef, ChangeDetectorRef, ViewChild, OnInit, Input, OnDestroy, HostListener, OnChanges, AfterViewInit } from '@angular/core';
import * as _ from 'lodash'; import * as _ from 'lodash';
...@@ -29,7 +29,10 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni ...@@ -29,7 +29,10 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni
touchSeeking = false; touchSeeking = false;
initCover = false; initCover = false;
isPlayStarted = false; isPlayStarted = false;
constructor() {
constructor(private appRef: ApplicationRef,
public changeDetectorRef: ChangeDetectorRef) {
} }
ngOnInit() { ngOnInit() {
...@@ -47,6 +50,11 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni ...@@ -47,6 +50,11 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni
} }
this.hasVideo = !!this.data.contentObj.video_url this.hasVideo = !!this.data.contentObj.video_url
window["air"].hideAirClassLoading(this.saveKey, this.data); window["air"].hideAirClassLoading(this.saveKey, this.data);
setTimeout(() => {
this.refresh();
}, 1000);
}, this.saveKey); }, this.saveKey);
} }
...@@ -127,5 +135,11 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni ...@@ -127,5 +135,11 @@ export class PlayComponent implements OnInit, OnDestroy, OnChanges, AfterViewIni
this.player.currentTime = this.player.duration * offsetX / target.clientWidth; this.player.currentTime = this.player.duration * offsetX / target.clientWidth;
} }
refresh() {
setTimeout(() => {
this.appRef.tick();
}, 1);
}
} }
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