platypush/plugins/media/kodi/__init__.py
def play(self, resource, *args, **kwargs):
        """
        Open and play the specified file or URL

        :param resource: URL or path to the media to be played
        """

        youtube_id = self.get_youtube_id(resource)
        if youtube_id:
            try:
                resource = self.get_youtube_url(youtube_id).output
            except Exception as e:
                self.logger.warning('youtube-dl error, falling back to Kodi YouTube plugin: {}'.format(str(e)))
                resource = 'plugin://plugin.video.youtube/?action=play_video&videoid=' + youtube_id

        if resource.startswith('file://'):
            resource = resource[7:]

        result = self._get_kodi().Player.Open(item={'file': resource})
        if self.volume:
            self.set_volume(volume=int(self.volume))

        return self._build_result(result)

        Open and play the specified file or URL

        :param resource: URL or path to the media to be played
        
Open and play the specified file or URL
Open and play the specified file or URL
def play(self, resource, *args, **kwargs):
        youtube_id = self.get_youtube_id(resource)
        if youtube_id:
            try:
                resource = self.get_youtube_url(youtube_id).output
            except Exception as e:
                self.logger.warning('youtube-dl error, falling back to Kodi YouTube plugin: {}'.format(str(e)))
                resource = 'plugin://plugin.video.youtube/?action=play_video&videoid=' + youtube_id
        if resource.startswith('file://'):
            resource = resource[7:]
        result = self._get_kodi().Player.Open(item={'file': resource})
        if self.volume:
            self.set_volume(volume=int(self.volume))
        return self._build_result(result)
def play ( self , resource , * args , ** kwargs ) : youtube_id = self . get_youtube_id ( resource ) if youtube_id : try : resource = self . get_youtube_url ( youtube_id ) . output except Exception as e : self . logger . warning ( 'youtube-dl error, falling back to Kodi YouTube plugin: {}' . format ( str ( e ) ) ) resource = 'plugin://plugin.video.youtube/?action=play_video&videoid=' + youtube_id if resource . startswith ( 'file://' ) : resource = resource [ 7 : ] result = self . _get_kodi ( ) . Player . Open ( item = { 'file' : resource } ) if self . volume : self . set_volume ( volume = int ( self . volume ) ) return self . _build_result ( result )
Open and play the specified file or URL
Open and play the specified file or URL
"""
        Open and play the specified file or URL

        :param resource: URL or path to the media to be played
        """
self
resource
URL or path to the media to be played
URL or path to the media to be played