コード例 #1
0
ファイル: VLCWrapper.py プロジェクト: Anaconda84/Anaconda
    def _init_vlc(self):
        """
        To avoid a bug on Ubuntu Intrepid and Jaunty that causes the
        GUI to instantly exit, we need to delay importing vlc and
        seting the window.
        """
        import vlc
        from Tribler.Video.VideoServer import VideoRawVLCServer

        # avoid another init
        self.initialized = True

        self.vlc = vlc
    
        #
        # With VLC 0.9.x came changes to the MediaControl API. In particular,
        # there is no longer a concept of a playlist. The VLCWrapper can now
        # deal with both versions of the API.
        #
        try:
            vlc.Instance
            self.VLC_MEDIACONTROL_API_VERSION = "0.2"
        except:
            # print_exc()
            self.VLC_MEDIACONTROL_API_VERSION = "0.1"

        self.media = self.get_vlc_mediactrl()
        self.videorawserv = VideoRawVLCServer.getInstance()

        if not self.window is None:
            self.set_window(self.window)
コード例 #2
0
ファイル: VLCWrapper.py プロジェクト: zzmjohn/tribler
    def _init_vlc(self):
        """
        To avoid a bug on Ubuntu Intrepid and Jaunty that causes the
        GUI to instantly exit, we need to delay importing vlc and
        setting the window.
        """
        try:
            if False and sys.platform == "darwin":
                oldpath = os.getcwd()
                os.chdir(os.path.join(self.installdir, 'vlc', 'lib'))
                import vlc.lib.vlc as vlc
                os.chdir(oldpath)
            else:
                import Tribler.vlc as vlc
        except:
            print_stack()
            print_exc()
        from Tribler.Video.VideoServer import VideoRawVLCServer

        # avoid another init
        self.initialized = True

        self.vlc = vlc

        #
        # With VLC 0.9.x came changes to the MediaControl API. In particular,
        # there is no longer a concept of a playlist. The VLCWrapper can now
        # deal with both versions of the API.
        #
        # VLC 1.1.x has new python bindings that expose the full libVLC API:
        # http://wiki.videolan.org/LibVLC
        # http://wiki.videolan.org/Python_bindings
        #
        try:
            vlc.libvlc_media_player_play
            self.VLC_MEDIACONTROL_API_VERSION = "0.3"
        except:
            try:
                vlc.Instance
                self.VLC_MEDIACONTROL_API_VERSION = "0.2"
            except:
                # print_exc()
                self.VLC_MEDIACONTROL_API_VERSION = "0.1"

        self.media = self.get_vlc_mediactrl()
        self.videorawserv = VideoRawVLCServer.getInstance()

        print >> sys.stderr, "VLCWrapper is using API %s" % self.VLC_MEDIACONTROL_API_VERSION

        if not self.window is None:
            self.set_window(self.window)
コード例 #3
0
ファイル: VLCWrapper.py プロジェクト: duy/tribler
    def _init_vlc(self):
        """
        To avoid a bug on Ubuntu Intrepid and Jaunty that causes the
        GUI to instantly exit, we need to delay importing vlc and
        setting the window.
        """
        try:
            if False and sys.platform == "darwin":
                oldpath = os.getcwd()
                os.chdir(os.path.join(self.installdir,'vlc','lib'))
                import vlc.lib.vlc as vlc
                os.chdir(oldpath)
            else:
                import Tribler.vlc as vlc
        except:
            print_stack()
            print_exc()
        from Tribler.Video.VideoServer import VideoRawVLCServer

        # avoid another init
        self.initialized = True

        self.vlc = vlc
    
        #
        # With VLC 0.9.x came changes to the MediaControl API. In particular,
        # there is no longer a concept of a playlist. The VLCWrapper can now
        # deal with both versions of the API. 
        #
        # VLC 1.1.x has new python bindings that expose the full libVLC API:
        # http://wiki.videolan.org/LibVLC
        # http://wiki.videolan.org/Python_bindings 
        #
        try:
            vlc.libvlc_media_player_play
            self.VLC_MEDIACONTROL_API_VERSION = "0.3"
        except:
            try:
                vlc.Instance
                self.VLC_MEDIACONTROL_API_VERSION = "0.2"
            except:
                # print_exc()
                self.VLC_MEDIACONTROL_API_VERSION = "0.1"

        self.media = self.get_vlc_mediactrl()
        self.videorawserv = VideoRawVLCServer.getInstance()
        
        print >> sys.stderr, "VLCWrapper is using API %s"%self.VLC_MEDIACONTROL_API_VERSION

        if not self.window is None:
            self.set_window(self.window)
コード例 #4
0
ファイル: VideoPlayer.py プロジェクト: Anaconda84/Anaconda
    def __init__(self,httpport=6880):
        if VideoPlayer.__single:
            raise RuntimeError, "VideoPlayer is singleton"
        VideoPlayer.__single = self
        self.videoframe = None
        self.extprogress = None
        self.vod_download = None
        self.playbackmode = None
        self.preferredplaybackmode = None
        self.vod_postponed_downloads = []
        self.other_downloads = None
        self.closeextplayercallback = None

        self.videohttpservport = httpport
        self.videohttpserv = None
        # Must create the instance here, such that it won't get garbage collected
        self.videorawserv = VideoRawVLCServer.getInstance()
コード例 #5
0
    def __init__(self, httpport=6880):
        if VideoPlayer.__single:
            raise RuntimeError("VideoPlayer is singleton")
        VideoPlayer.__single = self
        self.videoframe = None
        self.extprogress = None
        self.vod_download = None
        self.playbackmode = None
        self.preferredplaybackmode = None
        self.closeextplayercallback = None

        self.videohttpservport = httpport
        self.videohttpserv = None
        # Must create the instance here, such that it won't get garbage collected
        self.videorawserv = VideoRawVLCServer.getInstance()

        self.resume_by_system = 0
        self.user_download_choice = None