Example #1
0
 def play_video_callback(callback=None):
     if callback != "error":
         stop_etimer()
         download_obj[0].onFinishCB.remove(finish_download_callback)
         download_obj[0].onFinishCB.append(DownloadManagerMessages.finishDownloadCB)
         video_item = PVideo()
         video_item.name = item.name
         video_item.url = download_obj[0].local
         # TODO subs should point to local path download to path where is movie
         video_item.subs = item.subs
         self.player.play_item(video_item)
 def play_video_callback(callback=None):
     if callback != "error":
         stop_etimer()
         download_obj[0].onFinishCB.remove(finish_download_callback)
         download_obj[0].onFinishCB.append(DownloadManagerMessages.finishDownloadCB)
         video_item = PVideo()
         video_item.name = item.name
         video_item.url = download_obj[0].local
         # TODO subs should point to local path download to path where is movie
         video_item.subs = item.subs
         self.player.play_item(video_item)
Example #3
0
    def load_streams(self):
        groups = []
        self.stream_root = util.load_xml(self.streams_path)

        for group in self.stream_root.findall('group'):
            group_name = ''
            group_name = group.findtext('name')
            cat_channels = []

            for channel in group.findall('channel'):
                name = channel.findtext('name')
                stream_url = channel.findtext(
                    'stream_url') or channel.findtext('streamUrl')
                picon = channel.findtext('picon')
                app = channel.findtext('app')
                swf_url = channel.findtext('swfUrl')
                page_url = channel.findtext('pageUrl')
                playpath = channel.findtext('playpath')
                advanced = channel.findtext('advanced')
                live_stream = channel.findtext(
                    'liveStream') or channel.findtext('live_stream')
                player_buffer = channel.findtext(
                    'playerBuffer') or channel.findtext('player_buffer')
                rtmp_buffer = channel.findtext(
                    'rtmpBuffer') or channel.findtext('rtmp_buffer')
                play_delay = channel.findtext('playDelay') or channel.findtext(
                    'play_delay')
                rtmp_timeout = channel.findtext('timeout')

                if name is None or stream_url is None:
                    log.info('skipping stream, cannot find name or url')
                    continue
                if picon is None: pass
                if app is None: app = u''
                if playpath is None: playpath = u''
                if swf_url is None: swf_url = u''
                if page_url is None: page_url = u''
                if advanced is None: advanced = u''
                if live_stream is None: live_stream = True
                else: live_stream = not live_stream == 'False'
                if rtmp_buffer is None:
                    rtmp_buffer = int(config.plugins.archivCZSK.videoPlayer.
                                      liveBuffer.getValue())
                if rtmp_timeout is None:
                    rtmp_timeout = int(config.plugins.archivCZSK.videoPlayer.
                                       rtmpTimeout.getValue())
                if player_buffer is None:
                    player_buffer = int(config.plugins.archivCZSK.videoPlayer.
                                        bufferSize.getValue())
                if play_delay is None:
                    play_delay = int(config.plugins.archivCZSK.videoPlayer.
                                     playDelay.getValue())

                if stream_url.startswith('rtmp'):
                    stream = RtmpStream(stream_url, app, playpath, page_url,
                                        swf_url, advanced)
                    stream.buffer = int(rtmp_buffer)
                    stream.timeout = int(rtmp_timeout)
                else:
                    stream = Stream(stream_url)

                stream.picon = picon
                stream.playBuffer = int(player_buffer)
                stream.playDelay = int(play_delay)
                stream.live = live_stream

                it = PVideo()
                it.name = name
                it.url = stream_url
                it.live = live_stream
                it.stream = stream
                it.xml = channel
                it.root_xml = group
                cat_channels.append(it)

            playlist = PPlaylist()
            playlist.name = group_name
            playlist.playlist = cat_channels[:]
            #cat_channels.insert(0, playlist)
            it = PFolder()
            it.name = group_name
            it.xml = group
            it.channels = cat_channels
            groups.append(playlist)

        self.groups = groups
Example #4
0
    def load_streams(self):
        groups = []
        self.stream_root = util.load_xml(self.streams_path)

        for group in self.stream_root.findall('group'):
            group_name = ''
            group_name = group.findtext('name')
            cat_channels = []

            for channel in group.findall('channel'):
                name = channel.findtext('name')
                stream_url = channel.findtext('stream_url') or channel.findtext('streamUrl')
                picon = channel.findtext('picon')
                app = channel.findtext('app')
                swf_url = channel.findtext('swfUrl')
                page_url = channel.findtext('pageUrl')
                playpath = channel.findtext('playpath')
                advanced = channel.findtext('advanced')
                live_stream = channel.findtext('liveStream') or channel.findtext('live_stream')
                player_buffer = channel.findtext('playerBuffer') or channel.findtext('player_buffer')
                rtmp_buffer = channel.findtext('rtmpBuffer') or channel.findtext('rtmp_buffer')
                play_delay = channel.findtext('playDelay') or channel.findtext('play_delay')
                rtmp_timeout = channel.findtext('timeout')

                if name is None or stream_url is None:
                    log.info('skipping stream, cannot find name or url')
                    continue
                if picon is None: pass
                if app is None: app = u''
                if playpath is None: playpath = u''
                if swf_url is None: swf_url = u''
                if page_url is None: page_url = u''
                if advanced is None: advanced = u''
                if live_stream is None: live_stream = True
                else: live_stream = not live_stream == 'False'
                if rtmp_buffer is None: rtmp_buffer = int(config.plugins.archivCZSK.videoPlayer.liveBuffer.getValue())
                if rtmp_timeout is None: rtmp_timeout = int(config.plugins.archivCZSK.videoPlayer.rtmpTimeout.getValue())
                if player_buffer is None: player_buffer = int(config.plugins.archivCZSK.videoPlayer.bufferSize.getValue())
                if play_delay is None: play_delay = int(config.plugins.archivCZSK.videoPlayer.playDelay.getValue())


                if stream_url.startswith('rtmp'):
                    stream = RtmpStream(stream_url, app, playpath, page_url, swf_url, advanced)
                    stream.buffer = int(rtmp_buffer)
                    stream.timeout = int(rtmp_timeout)
                else:
                    stream = Stream(stream_url)

                stream.picon = picon
                stream.playBuffer = int(player_buffer)
                stream.playDelay = int(play_delay)
                stream.live = live_stream

                it = PVideo()
                it.name = name
                it.url = stream_url
                it.live = live_stream
                it.stream = stream
                it.xml = channel
                it.root_xml = group
                cat_channels.append(it)

            playlist = PPlaylist()
            playlist.name = group_name
            playlist.playlist = cat_channels[:]
            #cat_channels.insert(0, playlist)
            it = PFolder()
            it.name = group_name
            it.xml = group
            it.channels = cat_channels
            groups.append(playlist)

        self.groups = groups