当前位置: 首页>>代码示例>>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;未经允许,请勿转载。