fix(player): fix player not being destroyed, fix ios player styles

This commit is contained in:
Dmitry Nehaychik 2017-09-19 19:29:47 +03:00
parent a2eff95eb1
commit 28a230d5a0
2 changed files with 10 additions and 3 deletions

View file

@ -242,8 +242,9 @@
width: calc(100% - 6rem);
align-self: flex-start;
position: absolute;
left: 0;
margin-top: calc(-0.75rem + 1px);
margin-left: $player-height;
margin-left: calc(#{$player-height} + 0.75rem);
}
.timing {

View file

@ -1,4 +1,4 @@
import { Component, HostBinding, Input } from '@angular/core';
import { Component, HostBinding, Input, OnDestroy } from '@angular/core';
import { PlayerService, Track } from '../../../../@core/data/player.service';
@Component({
@ -6,7 +6,7 @@ import { PlayerService, Track } from '../../../../@core/data/player.service';
styleUrls: ['./player.component.scss'],
templateUrl: './player.component.html',
})
export class PlayerComponent {
export class PlayerComponent implements OnDestroy {
@Input()
@HostBinding('class.collapsed')
collapsed: boolean;
@ -20,6 +20,12 @@ export class PlayerComponent {
this.createPlayer();
}
ngOnDestroy() {
this.player.pause();
this.player.src = '';
this.player.load();
}
prev() {
if (!this.player.loop) {
if (this.shuffle) {