~raoul-snyman/openlp/fix-macos-pdf-test

« back to all changes in this revision

Viewing changes to openlp/core/ui/media/mediacontroller.py

  • Committer: Raoul Snyman
  • Date: 2019-02-14 07:04:30 UTC
  • mfrom: (2766.3.118 webengine-migrate)
  • Revision ID: raoul@snyman.info-20190214070430-nxe1vaeaapq3ult5
Migration from WebKit to Webengine. Also introduced reveal.js for slide rendering, new screen setup dialogs and many other changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
from openlp.core.ui.media.vlcplayer import VlcPlayer, get_vlc
51
51
from openlp.core.widgets.toolbar import OpenLPToolbar
52
52
 
 
53
 
53
54
log = logging.getLogger(__name__)
54
55
 
55
56
TICK_TIME = 200
381
382
        log.debug('video mediatype: ' + str(controller.media_info.media_type))
382
383
        # dont care about actual theme, set a black background
383
384
        if controller.is_live and not controller.media_info.is_background:
384
 
            display.frame.evaluateJavaScript('show_video("setBackBoard", null, null,"visible");')
 
385
            display.frame.runJavaScript('show_video("setBackBoard", null, null,"visible");')
385
386
        # now start playing - Preview is autoplay!
386
387
        autoplay = False
387
388
        # Preview requested
451
452
        # When called from mediaitem display is None
452
453
        if display is None:
453
454
            display = controller.preview_display
454
 
        self.vlc_player.load(display)
 
455
        self.vlc_player.load(display, filename)
455
456
        self.resize(display, self.vlc_player)
456
457
        self.current_media_players[controller.controller_type] = self.vlc_player
457
458
        if audio_track == -1 and subtitle_track == -1:
533
534
            self.media_volume(controller, controller.media_info.volume)
534
535
        if first_time:
535
536
            if not controller.media_info.is_background:
536
 
                display.frame.evaluateJavaScript('show_blank("desktop");')
 
537
                display.frame.runJavaScript('show_blank("desktop");')
537
538
            self.current_media_players[controller.controller_type].set_visible(display, True)
538
539
            controller.mediabar.actions['playbackPlay'].setVisible(False)
539
540
            controller.mediabar.actions['playbackPause'].setVisible(True)
653
654
        display = self._define_display(controller)
654
655
        if controller.controller_type in self.current_media_players:
655
656
            if not looping_background:
656
 
                display.frame.evaluateJavaScript('show_blank("black");')
 
657
                display.frame.runJavaScript('show_blank("black");')
657
658
            self.current_media_players[controller.controller_type].stop(display)
658
659
            self.current_media_players[controller.controller_type].set_visible(display, False)
659
660
            controller.seek_slider.setSliderPosition(0)
724
725
            display.override = {}
725
726
            self.current_media_players[controller.controller_type].reset(display)
726
727
            self.current_media_players[controller.controller_type].set_visible(display, False)
727
 
            display.frame.evaluateJavaScript('show_video("setBackBoard", null, null, "hidden");')
 
728
            display.frame.runJavaScript('show_video("setBackBoard", null, null, "hidden");')
728
729
            del self.current_media_players[controller.controller_type]
729
730
 
730
731
    def media_hide(self, msg):