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
ContentLoader.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录