platypush/plugins/media/mpv/__init__.py
def status(self):
        """
        Get the current player state.

        :returns: A dictionary containing the current state.

        Example::

            output = {
                "filename": "filename or stream URL",
                "state": "play"  # or "stop" or "pause"
            }
        """
        if not self._player or not hasattr(self._player, 'pause'):
            return {'state': PlayerState.STOP.value}

        return {
            'audio_channels': getattr(self._player, 'audio_channels'),
            'audio_codec': getattr(self._player, 'audio_codec_name'),
            'delay': getattr(self._player, 'delay'),
            'duration': getattr(self._player, 'playback_time', 0) + getattr(self._player, 'playtime_remaining', 0)
            if getattr(self._player, 'playtime_remaining') else None,
            'filename': getattr(self._player, 'filename'),
            'file_size': getattr(self._player, 'file_size'),
            'fullscreen': getattr(self._player, 'fs'),
            'mute': getattr(self._player, 'mute'),
            'name': getattr(self._player, 'name'),
            'pause': getattr(self._player, 'pause'),
            'percent_pos': getattr(self._player, 'percent_pos'),
            'position': getattr(self._player, 'playback_time'),
            'seekable': getattr(self._player, 'seekable'),
            'state': (PlayerState.PAUSE.value if self._player.pause else PlayerState.PLAY.value),
            'title': getattr(self._player, 'media_title') or getattr(self._player, 'filename'),
            'url': self._get_current_resource(),
            'video_codec': getattr(self._player, 'video_codec'),
            'video_format': getattr(self._player, 'video_format'),
            'volume': getattr(self._player, 'volume'),
            'volume_max': getattr(self._player, 'volume_max'),
            'width': getattr(self._player, 'width'),
        }

        Get the current player state.

        :returns: A dictionary containing the current state.

        Example::

            output = {
                "filename": "filename or stream URL",
                "state": "play"  # or "stop" or "pause"
            }
        
Get the current player state.
Get the current player state .
def status(self):
        if not self._player or not hasattr(self._player, 'pause'):
            return {'state': PlayerState.STOP.value}
        return {
            'audio_channels': getattr(self._player, 'audio_channels'),
            'audio_codec': getattr(self._player, 'audio_codec_name'),
            'delay': getattr(self._player, 'delay'),
            'duration': getattr(self._player, 'playback_time', 0) + getattr(self._player, 'playtime_remaining', 0)
            if getattr(self._player, 'playtime_remaining') else None,
            'filename': getattr(self._player, 'filename'),
            'file_size': getattr(self._player, 'file_size'),
            'fullscreen': getattr(self._player, 'fs'),
            'mute': getattr(self._player, 'mute'),
            'name': getattr(self._player, 'name'),
            'pause': getattr(self._player, 'pause'),
            'percent_pos': getattr(self._player, 'percent_pos'),
            'position': getattr(self._player, 'playback_time'),
            'seekable': getattr(self._player, 'seekable'),
            'state': (PlayerState.PAUSE.value if self._player.pause else PlayerState.PLAY.value),
            'title': getattr(self._player, 'media_title') or getattr(self._player, 'filename'),
            'url': self._get_current_resource(),
            'video_codec': getattr(self._player, 'video_codec'),
            'video_format': getattr(self._player, 'video_format'),
            'volume': getattr(self._player, 'volume'),
            'volume_max': getattr(self._player, 'volume_max'),
            'width': getattr(self._player, 'width'),
        }
def status ( self ) : if not self . _player or not hasattr ( self . _player , 'pause' ) : return { 'state' : PlayerState . STOP . value } return { 'audio_channels' : getattr ( self . _player , 'audio_channels' ) , 'audio_codec' : getattr ( self . _player , 'audio_codec_name' ) , 'delay' : getattr ( self . _player , 'delay' ) , 'duration' : getattr ( self . _player , 'playback_time' , 0 ) + getattr ( self . _player , 'playtime_remaining' , 0 ) if getattr ( self . _player , 'playtime_remaining' ) else None , 'filename' : getattr ( self . _player , 'filename' ) , 'file_size' : getattr ( self . _player , 'file_size' ) , 'fullscreen' : getattr ( self . _player , 'fs' ) , 'mute' : getattr ( self . _player , 'mute' ) , 'name' : getattr ( self . _player , 'name' ) , 'pause' : getattr ( self . _player , 'pause' ) , 'percent_pos' : getattr ( self . _player , 'percent_pos' ) , 'position' : getattr ( self . _player , 'playback_time' ) , 'seekable' : getattr ( self . _player , 'seekable' ) , 'state' : ( PlayerState . PAUSE . value if self . _player . pause else PlayerState . PLAY . value ) , 'title' : getattr ( self . _player , 'media_title' ) or getattr ( self . _player , 'filename' ) , 'url' : self . _get_current_resource ( ) , 'video_codec' : getattr ( self . _player , 'video_codec' ) , 'video_format' : getattr ( self . _player , 'video_format' ) , 'volume' : getattr ( self . _player , 'volume' ) , 'volume_max' : getattr ( self . _player , 'volume_max' ) , 'width' : getattr ( self . _player , 'width' ) , }
Get the current player state.
Get the current player state .
"""
        Get the current player state.

        :returns: A dictionary containing the current state.

        Example::

            output = {
                "filename": "filename or stream URL",
                "state": "play"  # or "stop" or "pause"
            }
        """
A dictionary containing the current state.
Example:.

output = {
"filename": "filename or stream URL",
"state": "play"  # or "stop" or "pause"
}
A dictionary containing the current state . Example : . output = { " filename " : " filename or stream URL " " state " : " play " # or " stop " or " pause " }
self