main.py 文件源码

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

项目:YoutubeTV 作者: dude56987 项目源码 文件源码
def play_all(arrayOfObjects):
    # create the playlist
    playlist= xbmc.PlayList(xbmc.PLAYLIST_VIDEO)
    index=1
    # for each item in the playlist
    for item in arrayOfObjects:
        path=item['video']
        # the path to let videos be played by the youtube plugin
        youtubePath='plugin://plugin.video.youtube/?action=play_video&videoid='
        # remove the full webaddress to make youtube plugin work correctly
        path=path.replace('https://youtube.com/watch?v=','')
        # also check for partial webaddresses we only need the video id
        path=path.replace('watch?v=','')
        # add youtube path to path to make videos play with the kodi youtube plugin
        path=youtubePath+path
        # create listitem to insert in the playlist
        list_item = xbmcgui.ListItem(label=item['name'])
        #list_item.setInfo('video', {'title':title , 'genre':'menu' })
        list_item.setInfo('video', item)
        list_item.setArt(item)
        list_item.setProperty('IsPlayable', 'true')
        # add item to the playlist
        playlist.add(path,list_item,index)
        # increment the playlist index
        index+=1
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号