當前位置: 首頁>>代碼示例>>Python>>正文


Python xbmc.PLAYLIST_VIDEO屬性代碼示例

本文整理匯總了Python中xbmc.PLAYLIST_VIDEO屬性的典型用法代碼示例。如果您正苦於以下問題:Python xbmc.PLAYLIST_VIDEO屬性的具體用法?Python xbmc.PLAYLIST_VIDEO怎麽用?Python xbmc.PLAYLIST_VIDEO使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在xbmc的用法示例。


在下文中一共展示了xbmc.PLAYLIST_VIDEO屬性的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_video_playlist

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import PLAYLIST_VIDEO [as 別名]
def get_video_playlist(self, new=False):
        '''
        Convenience method to return a video :class:`xbmc.Playlist` object.
        
        .. seealso::
        
            :meth:`get_playlist`
        
        Kwargs:
            new (bool): If ``False`` (default), get the current video 
            :class:`xbmc.Playlist` object. If ``True`` then return a new blank
            video :class:`xbmc.Playlist`.
            
        Returns:
            A :class:`xbmc.Playlist` object.
        '''
        self.get_playlist(xbmc.PLAYLIST_VIDEO, new) 
開發者ID:iwannabelikemike,項目名稱:plugin.video.sparkle,代碼行數:19,代碼來源:addon.py

示例2: direct_play

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import PLAYLIST_VIDEO [as 別名]
def direct_play(url):
    _log("direct_play ["+url+"]")

    title = ""

    try:
        xlistitem = xbmcgui.ListItem( title, iconImage="DefaultVideo.png", path=url)
    except:
        xlistitem = xbmcgui.ListItem( title, iconImage="DefaultVideo.png", )
    xlistitem.setInfo( "video", { "Title": title } )

    playlist = xbmc.PlayList( xbmc.PLAYLIST_VIDEO )
    playlist.clear()
    playlist.add( url, xlistitem )

    player_type = xbmc.PLAYER_CORE_AUTO
    xbmcPlayer = xbmc.Player( player_type )
    xbmcPlayer.play(playlist) 
開發者ID:tvalacarta,項目名稱:tvalacarta,代碼行數:20,代碼來源:plugintools.py

示例3: get_video_playlist

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import PLAYLIST_VIDEO [as 別名]
def get_video_playlist(self, new=False):
        '''
        Convenience method to return a video :class:`xbmc.Playlist` object.

        .. seealso::

            :meth:`get_playlist`

        Kwargs:
            new (bool): If ``False`` (default), get the current video
            :class:`xbmc.Playlist` object. If ``True`` then return a new blank
            video :class:`xbmc.Playlist`.

        Returns:
            A :class:`xbmc.Playlist` object.
        '''
        self.get_playlist(xbmc.PLAYLIST_VIDEO, new) 
開發者ID:mrknow,項目名稱:filmkodi,代碼行數:19,代碼來源:addon.py

示例4: get_playlist

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import PLAYLIST_VIDEO [as 別名]
def get_playlist(self, pl_type, new=False):
        '''
        Return a :class:`xbmc.Playlist` object of the specified type.
        
        The available playlist types are defined in the :mod:`xbmc` module and 
        are currently as follows::
        
            xbmc.PLAYLIST_MUSIC = 0
            xbmc.PLAYLIST_VIDEO = 1
            
        .. seealso::
            
            :meth:`get_music_playlist`, :meth:`get_video_playlist`
            
        Args:
            pl_type (int): The type of playlist to get.
            
            new (bool): If ``False`` (default), get the current 
            :class:`xbmc.Playlist` object of the type specified. If ``True`` 
            then return a new blank :class:`xbmc.Playlist`.

        Returns:
            A :class:`xbmc.Playlist` object.
        '''
        pl = xbmc.PlayList(pl_type)
        if new:
            pl.clear()
        return pl 
開發者ID:iwannabelikemike,項目名稱:plugin.video.sparkle,代碼行數:30,代碼來源:addon.py

示例5: get_next

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import PLAYLIST_VIDEO [as 別名]
def get_next(self):
        playlist = PlayList(PLAYLIST_VIDEO)
        position = playlist.getposition()
        # A playlist with only one element has no next item and PlayList().getposition() starts counting from zero
        if playlist.size() > 1 and position < (playlist.size() - 1):
            return self.api.get_next_in_playlist(position)
        return False 
開發者ID:im85288,項目名稱:service.upnext,代碼行數:9,代碼來源:playitem.py

示例6: playMedia

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import PLAYLIST_VIDEO [as 別名]
def playMedia(url,title='',thumb='',description='',playlist_type=xbmc.PLAYLIST_VIDEO):
    common.log('Play media: ' + url)

    li = xbmcgui.ListItem(label=title,label2=description,iconImage=thumb,thumbnailImage=thumb)
    li.setPath(url)
    li.setInfo('video',{'title':title,'tagline':description})
    pl = xbmc.PlayList(playlist_type)
    pl.clear()
    pl.add(url,li)
    xbmc.Player().play(pl) 
開發者ID:elbowz,項目名稱:xbmc.service.pushbullet,代碼行數:12,代碼來源:pushhandler.py

示例7: get_playlist

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import PLAYLIST_VIDEO [as 別名]
def get_playlist(self, pl_type, new=False):
        '''
        Return a :class:`xbmc.Playlist` object of the specified type.

        The available playlist types are defined in the :mod:`xbmc` module and
        are currently as follows::

            xbmc.PLAYLIST_MUSIC = 0
            xbmc.PLAYLIST_VIDEO = 1

        .. seealso::

            :meth:`get_music_playlist`, :meth:`get_video_playlist`

        Args:
            pl_type (int): The type of playlist to get.

            new (bool): If ``False`` (default), get the current
            :class:`xbmc.Playlist` object of the type specified. If ``True``
            then return a new blank :class:`xbmc.Playlist`.

        Returns:
            A :class:`xbmc.Playlist` object.
        '''
        pl = xbmc.PlayList(pl_type)
        if new:
            pl.clear()
        return pl 
開發者ID:mrknow,項目名稱:filmkodi,代碼行數:30,代碼來源:addon.py

示例8: handlePush

# 需要導入模塊: import xbmc [as 別名]
# 或者: from xbmc import PLAYLIST_VIDEO [as 別名]
def handlePush(data,from_gui=False):
    if not from_gui and checkForWindow(): #Do nothing if the window is open
        return False
    if data.get('type') == 'link':
        url = data.get('url','')
        if StreamExtractor.mightHaveVideo(url):
            vid = StreamExtractor.getVideoInfo(url)
            if vid:
                if vid.hasMultipleStreams():
                    vlist = []
                    for info in vid.streams():
                        vlist.append(info['title'] or '?')
                    idx = xbmcgui.Dialog().select(common.localise(32091),vlist)
                    if idx < 0: return
                    vid.selectStream(idx)
                playMedia(vid.streamURL(),vid.title,vid.thumbnail,vid.description)
                return True
        if canPlayURL(url):
            handleURL(url)
            return True
        media = getURLMediaType(url)
        if media == 'video' or media == 'audio':
            url += '|' + urllib.urlencode({'User-Agent':getURLUserAgent(url)})
            playMedia(url,playlist_type='video' and xbmc.PLAYLIST_VIDEO or xbmc.PLAYLIST_MUSIC)
            return True
        elif media == 'image':
            import gui
            gui.showImage(url)
            return True
    elif data.get('type') == 'file':
        if data.get('file_type','').startswith('image/'):
            import gui
            gui.showImage(data.get('file_url',''))
            return True
        elif data.get('file_type','').startswith('video/') or data.get('file_type','').startswith('audio/'):
            playMedia(data.get('file_url',''))
            return True
    elif data.get('type') == 'note':
        import gui
        gui.showNote(data.get('body',''))
        return True
    elif data.get('type') == 'list':
        import gui
        gui.showList(data)
        return True
    elif data.get('type') == 'address':
        cmd = 'XBMC.RunScript({0},MAP,{1},None,)'.format(common.__addonid__,urllib.quote(data.get('address','')))
        xbmc.executebuiltin(cmd)
        return True

    return False 
開發者ID:elbowz,項目名稱:xbmc.service.pushbullet,代碼行數:53,代碼來源:pushhandler.py


注:本文中的xbmc.PLAYLIST_VIDEO屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。