platypush/plugins/media/gstreamer/__init__.py
def status(self) -> dict:
        """
        Get the current player state.
        """
        if not self._player:
            return {'state': PlayerState.STOP.value}

        pos = self._player.get_position()
        length = self._player.get_duration()

        return {
            'duration': length,
            'filename': self._resource[7:] if self._resource.startswith('file://') else self._resource,
            'mute': self._player.is_muted(),
            'name': self._resource,
            'pause': self._player.is_paused(),
            'percent_pos':  pos / length if pos is not None and length is not None and pos >= 0 and length > 0 else 0,
            'position': pos,
            'seekable': length is not None and length > 0,
            'state': self._gst_to_player_state(self._player.get_state()).value,
            'url': self._resource,
            'volume': self._player.get_volume() * 100,
        }

        Get the current player state.
        
Get the current player state.
Get the current player state .
def status(self) -> dict:
        if not self._player:
            return {'state': PlayerState.STOP.value}
        pos = self._player.get_position()
        length = self._player.get_duration()
        return {
            'duration': length,
            'filename': self._resource[7:] if self._resource.startswith('file://') else self._resource,
            'mute': self._player.is_muted(),
            'name': self._resource,
            'pause': self._player.is_paused(),
            'percent_pos':  pos / length if pos is not None and length is not None and pos >= 0 and length > 0 else 0,
            'position': pos,
            'seekable': length is not None and length > 0,
            'state': self._gst_to_player_state(self._player.get_state()).value,
            'url': self._resource,
            'volume': self._player.get_volume() * 100,
        }
def status ( self ) -> dict : if not self . _player : return { 'state' : PlayerState . STOP . value } pos = self . _player . get_position ( ) length = self . _player . get_duration ( ) return { 'duration' : length , 'filename' : self . _resource [ 7 : ] if self . _resource . startswith ( 'file://' ) else self . _resource , 'mute' : self . _player . is_muted ( ) , 'name' : self . _resource , 'pause' : self . _player . is_paused ( ) , 'percent_pos' : pos / length if pos is not None and length is not None and pos >= 0 and length > 0 else 0 , 'position' : pos , 'seekable' : length is not None and length > 0 , 'state' : self . _gst_to_player_state ( self . _player . get_state ( ) ) . value , 'url' : self . _resource , 'volume' : self . _player . get_volume ( ) * 100 , }
Get the current player state.
Get the current player state .
"""
        Get the current player state.
        """
self