Fixes #107 This fixes an issue where loading a new media URL while the player was paused would keep playback paused, causing Music Assistant to show the player as playing while no audio was audible. The mpv pause state is now always set explicitly when starting playback, ensuring deterministic behavior
26 lines
424 B
Python
26 lines
424 B
Python
from abc import ABC, abstractmethod
|
|
from .state import PlayerState
|
|
|
|
|
|
class AudioPlayer(ABC):
|
|
|
|
@abstractmethod
|
|
def play(self, url: str) -> None:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def pause(self) -> None:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def resume(self) -> None:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def stop(self) -> None:
|
|
pass
|
|
|
|
@abstractmethod
|
|
def state(self) -> PlayerState:
|
|
pass
|