Example #1
0
    def playVideo(self, play_version=False):
        if not self.video.available():
            util.messageDialog(T(32312, 'Unavailable'),
                               T(32313, 'This item is currently unavailable.'))
            return

        if play_version:
            if not preplayutils.chooseVersion(self.video):
                return
        else:
            preplayutils.resetVersion(self.video)

        resume = False
        if self.video.viewOffset.asInt():
            button = optionsdialog.show(T(32314, 'In Progress'),
                                        T(32315, 'Resume playback?'),
                                        T(32316, 'Resume'),
                                        T(32317, 'Play From Beginning'))

            if button is None:
                return

            resume = (button == 0)

        self.processCommand(videoplayer.play(video=self.video, resume=resume))
Example #2
0
    def episodeListClicked(self, play_version=False):
        mli = self.episodeListControl.getSelectedItem()
        if not mli:
            return

        episode = mli.dataSource

        if not episode.available():
            util.messageDialog(T(32312, 'unavailable'),
                               T(32332, 'This item is currently unavailable.'))
            return

        if play_version:
            if not preplayutils.chooseVersion(episode):
                return
        else:
            preplayutils.resetVersion(episode)

        resume = False
        if episode.viewOffset.asInt():
            button = optionsdialog.show(T(32314, 'In Progress'),
                                        T(32315, 'Resume playback?'),
                                        T(32316, 'Resume'),
                                        T(32317, 'Play From Beginning'))

            if button is None:
                return

            resume = (button == 0)

        pl = playlist.LocalPlaylist(self.show_.all(), self.show_.getServer())
        if len(pl):  # Don't use playlist if it's only this video
            pl.setCurrent(episode)
            self.processCommand(videoplayer.play(play_queue=pl, resume=resume))
            return

        self.processCommand(videoplayer.play(video=episode, resume=resume))