refactor to define helper service more accurately

This commit is contained in:
itzMiney committed 2026-03-17 23:21:12 +01:00
1 parent 5527acfb6a
commit 7618e4bf5d
28 files changed
+78 -403

No files matched your search

@@ -1,4 +1,4 @@
<div class="audio-player" [ngClass]="{ mobile: isMobile }">
<div class="audio-player" [ngClass]="{ mobile: isNarrow }">
<div id="youtube-player"></div>
<h3>{{ nowPlayingTitle() }}</h3>
<div class="controls">
@@ -1,5 +1,5 @@
import {Component, AfterViewInit, signal, OnInit} from '@angular/core';
import {DeviceDetectorService} from '../services/device-detector.service';
import {ViewportService} from '../services/viewport.service';
import {NgClass} from '@angular/common';
@@ -19,17 +19,17 @@ declare global {
styleUrl: './audio-player.component.css'
})
export class AudioPlayerComponent implements AfterViewInit, OnInit {
isMobile: boolean = false;
isNarrow: boolean = false;
private player: any;
isPlayerReady = signal(false);
isPlaying = signal(false);
nowPlayingTitle = signal<string>('');
constructor(private deviceService: DeviceDetectorService) {}
constructor(private deviceService: ViewportService) {}
ngOnInit() {
this.isMobile = this.deviceService.isMobile;
this.isNarrow = this.deviceService.isNarrow;
}
ngAfterViewInit() {