ContentLoader.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:plugin.video.telekom-sport 作者: asciidisco 项目源码 文件源码
def play(self, video_id):
        """
        Plays a video by Video ID

        :param target: Video ID
        :type target: string
        """
        self.utils.log('Play video: ' + str(video_id))
        use_inputstream = self.utils.use_inputstream()
        self.utils.log('Using inputstream: ' + str(use_inputstream))
        streams = self.get_stream_urls(video_id)
        for stream in streams:
            play_item = xbmcgui.ListItem(
                path=self.get_m3u_url(streams.get(stream)))
            if use_inputstream is True:
                # pylint: disable=E1101
                play_item.setContentLookup(False)
                play_item.setMimeType('application/vnd.apple.mpegurl')
                play_item.setProperty(
                    'inputstream.adaptive.stream_headers',
                    'user-agent=' + self.utils.get_user_agent())
                play_item.setProperty(
                    'inputstream.adaptive.manifest_type', 'hls')
                play_item.setProperty('inputstreamaddon',
                                      'inputstream.adaptive')
            return xbmcplugin.setResolvedUrl(
                self.plugin_handle,
                True,
                play_item)
        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号