本文整理汇总了Python中common.DataObjects.ListItem.get_moving_data()['audioStreamUrl']方法的典型用法代码示例。如果您正苦于以下问题:Python ListItem.get_moving_data()['audioStreamUrl']方法的具体用法?Python ListItem.get_moving_data()['audioStreamUrl']怎么用?Python ListItem.get_moving_data()['audioStreamUrl']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common.DataObjects.ListItem
的用法示例。
在下文中一共展示了ListItem.get_moving_data()['audioStreamUrl']方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: playRawAudio
# 需要导入模块: from common.DataObjects import ListItem [as 别名]
# 或者: from common.DataObjects.ListItem import get_moving_data()['audioStreamUrl'] [as 别名]
def playRawAudio(request_obj, response_obj):
pbType = int(Container().getAddonContext().addon.getSetting('playbacktype'))
Container().ga_client.reportAction('audio')
if XBMCInterfaceUtils.isPlayingVideo():
response_obj.addServiceResponseParam("status", "error")
response_obj.addServiceResponseParam("title", "Stop active video!")
response_obj.addServiceResponseParam("message", "Note: XBMC cannot play audio when video playback is in progress.")
item = ListItem()
item.set_next_action_name('respond')
response_obj.addListItem(item)
elif pbType == 2 and XBMCInterfaceUtils.isPlaying():
response_obj.addServiceResponseParam("status", "error")
response_obj.addServiceResponseParam("title", "XBMC is already playing.")
response_obj.addServiceResponseParam("message", "Check PlayIt Service add-on settings. Your this request is ignored.")
item = ListItem()
item.set_next_action_name('respond')
response_obj.addListItem(item)
else:
if pbType == 0:
XBMCInterfaceUtils.stopPlayer()
if not XBMCInterfaceUtils.isPlaying():
XBMCInterfaceUtils.clearPlayList(list_type="audio")
response_obj.addServiceResponseParam("message", "Enjoy your music!")
else:
response_obj.addServiceResponseParam("title", "Request Enqueued!")
response_obj.addServiceResponseParam("message", "Your request has been added to player queue.")
item = ListItem()
item.get_moving_data()['audioStreamUrl'] = request_obj.get_data()['track_link']
item.set_next_action_name('Play')
xbmcListItem = xbmcgui.ListItem(label=request_obj.get_data()['track_title'], iconImage=request_obj.get_data()['track_artwork_url'], thumbnailImage=request_obj.get_data()['track_artwork_url'])
xbmcListItem.setInfo('music', {'title':request_obj.get_data()['track_title']})
item.set_xbmc_list_item_obj(xbmcListItem)
response_obj.addListItem(item)
response_obj.addServiceResponseParam("status", "success")