2011-07-10 21:43:07 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
2012-12-11 19:55:47 +00:00
|
|
|
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
|
2011-07-10 21:43:07 +00:00
|
|
|
|
|
|
|
###############################################################################
|
|
|
|
# OpenLP - Open Source Lyrics Projection #
|
|
|
|
# --------------------------------------------------------------------------- #
|
2015-01-18 13:39:21 +00:00
|
|
|
# Copyright (c) 2008-2015 OpenLP Developers #
|
2011-07-10 21:43:07 +00:00
|
|
|
# --------------------------------------------------------------------------- #
|
|
|
|
# This program is free software; you can redistribute it and/or modify it #
|
|
|
|
# under the terms of the GNU General Public License as published by the Free #
|
|
|
|
# Software Foundation; version 2 of the License. #
|
|
|
|
# #
|
|
|
|
# This program is distributed in the hope that it will be useful, but WITHOUT #
|
|
|
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or #
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for #
|
|
|
|
# more details. #
|
|
|
|
# #
|
|
|
|
# You should have received a copy of the GNU General Public License along #
|
|
|
|
# with this program; if not, write to the Free Software Foundation, Inc., 59 #
|
|
|
|
# Temple Place, Suite 330, Boston, MA 02111-1307 USA #
|
|
|
|
###############################################################################
|
2013-02-02 06:32:29 +00:00
|
|
|
"""
|
|
|
|
The :mod:`~openlp.core.ui.media.vlcplayer` module contains our VLC component wrapper
|
|
|
|
"""
|
2012-04-28 12:27:18 +00:00
|
|
|
from datetime import datetime
|
2012-04-28 13:10:54 +00:00
|
|
|
from distutils.version import LooseVersion
|
2011-07-10 21:43:07 +00:00
|
|
|
import logging
|
2012-04-28 11:13:16 +00:00
|
|
|
import os
|
2014-05-07 22:52:06 +00:00
|
|
|
import threading
|
2012-04-28 11:13:16 +00:00
|
|
|
|
2012-12-30 08:33:42 +00:00
|
|
|
from PyQt4 import QtGui
|
2012-04-28 11:13:16 +00:00
|
|
|
|
2015-03-17 22:06:21 +00:00
|
|
|
from openlp.core.common import Settings, is_win, is_macosx, is_linux
|
2013-10-13 20:36:42 +00:00
|
|
|
from openlp.core.lib import translate
|
2014-03-04 22:33:50 +00:00
|
|
|
from openlp.core.ui.media import MediaState, MediaType
|
2012-09-09 06:06:44 +00:00
|
|
|
from openlp.core.ui.media.mediaplayer import MediaPlayer
|
2012-04-28 12:27:18 +00:00
|
|
|
|
|
|
|
log = logging.getLogger(__name__)
|
|
|
|
|
2012-04-28 11:13:16 +00:00
|
|
|
VLC_AVAILABLE = False
|
2011-07-10 21:43:07 +00:00
|
|
|
try:
|
2012-09-09 06:06:44 +00:00
|
|
|
from openlp.core.ui.media.vendor import vlc
|
2012-04-28 11:13:16 +00:00
|
|
|
VLC_AVAILABLE = bool(vlc.get_default_instance())
|
2012-06-14 21:20:55 +00:00
|
|
|
except (ImportError, NameError, NotImplementedError):
|
2012-04-28 11:13:16 +00:00
|
|
|
pass
|
2013-08-31 18:17:38 +00:00
|
|
|
except OSError as e:
|
2014-08-27 23:18:06 +00:00
|
|
|
if is_win():
|
2012-04-28 11:13:16 +00:00
|
|
|
if not isinstance(e, WindowsError) and e.winerror != 126:
|
2011-12-06 21:19:37 +00:00
|
|
|
raise
|
2014-10-30 22:53:06 +00:00
|
|
|
elif is_macosx():
|
|
|
|
pass
|
2011-12-06 21:19:37 +00:00
|
|
|
else:
|
|
|
|
raise
|
2011-07-10 21:43:07 +00:00
|
|
|
|
2012-04-28 12:27:18 +00:00
|
|
|
if VLC_AVAILABLE:
|
|
|
|
try:
|
2013-04-03 10:54:11 +00:00
|
|
|
VERSION = vlc.libvlc_get_version().decode('UTF-8')
|
2012-04-28 13:10:54 +00:00
|
|
|
except:
|
2013-08-31 18:17:38 +00:00
|
|
|
VERSION = '0.0.0'
|
2013-04-03 10:40:09 +00:00
|
|
|
# LooseVersion does not work when a string contains letter and digits (e. g. 2.0.5 Twoflower).
|
2013-03-26 20:22:15 +00:00
|
|
|
# http://bugs.python.org/issue14894
|
2013-04-03 10:39:42 +00:00
|
|
|
if LooseVersion(VERSION.split()[0]) < LooseVersion('1.1.0'):
|
|
|
|
VLC_AVAILABLE = False
|
2013-08-31 18:17:38 +00:00
|
|
|
log.debug('VLC could not be loaded, because the vlc version is too old: %s' % VERSION)
|
2015-03-17 22:06:21 +00:00
|
|
|
if is_linux():
|
|
|
|
import ctypes
|
|
|
|
try:
|
|
|
|
x11 = ctypes.cdll.LoadLibrary('libX11.so')
|
|
|
|
x11.XInitThreads()
|
|
|
|
except:
|
|
|
|
log.exception('Failed to XInitThreads(), VLC might not work properly!')
|
2011-07-10 21:43:07 +00:00
|
|
|
|
2013-08-31 18:17:38 +00:00
|
|
|
AUDIO_EXT = ['*.mp3', '*.wav', '*.wma', '*.ogg']
|
2011-11-02 20:27:53 +00:00
|
|
|
|
|
|
|
VIDEO_EXT = [
|
2013-08-31 18:17:38 +00:00
|
|
|
'*.3gp',
|
|
|
|
'*.asf', '*.wmv',
|
|
|
|
'*.au',
|
|
|
|
'*.avi',
|
2014-11-28 08:15:59 +00:00
|
|
|
'*.divx',
|
2013-08-31 18:17:38 +00:00
|
|
|
'*.flv',
|
|
|
|
'*.mov',
|
|
|
|
'*.mp4', '*.m4v',
|
|
|
|
'*.ogm', '*.ogv',
|
|
|
|
'*.mkv', '*.mka',
|
|
|
|
'*.ts', '*.mpg',
|
|
|
|
'*.mpg', '*.mp2',
|
|
|
|
'*.nsc',
|
|
|
|
'*.nsv',
|
|
|
|
'*.nut',
|
|
|
|
'*.ra', '*.ram', '*.rm', '*.rv', '*.rmbv',
|
|
|
|
'*.a52', '*.dts', '*.aac', '*.flac', '*.dv', '*.vid',
|
|
|
|
'*.tta', '*.tac',
|
|
|
|
'*.ty',
|
|
|
|
'*.dts',
|
|
|
|
'*.xa',
|
|
|
|
'*.iso',
|
|
|
|
'*.vob',
|
2014-11-28 08:15:59 +00:00
|
|
|
'*.webm',
|
|
|
|
'*.xvid'
|
2012-09-08 17:15:08 +00:00
|
|
|
]
|
2011-11-02 20:27:53 +00:00
|
|
|
|
|
|
|
|
2011-11-11 16:45:25 +00:00
|
|
|
class VlcPlayer(MediaPlayer):
|
2011-07-10 21:43:07 +00:00
|
|
|
"""
|
2013-07-18 14:19:01 +00:00
|
|
|
A specialised version of the MediaPlayer class, which provides a VLC display.
|
2011-07-10 21:43:07 +00:00
|
|
|
"""
|
2011-09-22 18:22:35 +00:00
|
|
|
|
2011-07-10 21:43:07 +00:00
|
|
|
def __init__(self, parent):
|
2013-02-02 06:32:29 +00:00
|
|
|
"""
|
|
|
|
Constructor
|
|
|
|
"""
|
2013-08-31 18:17:38 +00:00
|
|
|
super(VlcPlayer, self).__init__(parent, 'vlc')
|
|
|
|
self.original_name = 'VLC'
|
|
|
|
self.display_name = '&VLC'
|
2011-07-10 21:43:07 +00:00
|
|
|
self.parent = parent
|
2013-03-06 23:00:57 +00:00
|
|
|
self.can_folder = True
|
2011-11-02 20:27:53 +00:00
|
|
|
self.audio_extensions_list = AUDIO_EXT
|
|
|
|
self.video_extensions_list = VIDEO_EXT
|
2011-07-10 21:43:07 +00:00
|
|
|
|
|
|
|
def setup(self, display):
|
2013-02-02 06:32:29 +00:00
|
|
|
"""
|
|
|
|
Set up the media player
|
|
|
|
"""
|
2013-12-31 20:29:03 +00:00
|
|
|
display.vlc_widget = QtGui.QFrame(display)
|
|
|
|
display.vlc_widget.setFrameStyle(QtGui.QFrame.NoFrame)
|
2011-07-10 21:43:07 +00:00
|
|
|
# creating a basic vlc instance
|
2013-08-31 18:17:38 +00:00
|
|
|
command_line_options = '--no-video-title-show'
|
2013-03-06 22:54:16 +00:00
|
|
|
if not display.has_audio:
|
2013-08-31 18:17:38 +00:00
|
|
|
command_line_options += ' --no-audio --no-video-title-show'
|
|
|
|
if Settings().value('advanced/hide mouse') and display.controller.is_live:
|
|
|
|
command_line_options += ' --mouse-hide-timeout=0'
|
2013-12-31 20:29:03 +00:00
|
|
|
display.vlc_instance = vlc.Instance(command_line_options)
|
2011-07-10 21:43:07 +00:00
|
|
|
# creating an empty vlc media player
|
2013-12-31 20:29:03 +00:00
|
|
|
display.vlc_media_player = display.vlc_instance.media_player_new()
|
|
|
|
display.vlc_widget.resize(display.size())
|
|
|
|
display.vlc_widget.raise_()
|
|
|
|
display.vlc_widget.hide()
|
2012-10-27 14:52:51 +00:00
|
|
|
# The media player has to be 'connected' to the QFrame.
|
2011-07-10 21:43:07 +00:00
|
|
|
# (otherwise a video would be displayed in it's own window)
|
2012-10-27 14:52:51 +00:00
|
|
|
# This is platform specific!
|
|
|
|
# You have to give the id of the QFrame (or similar object)
|
|
|
|
# to vlc, different platforms have different functions for this.
|
2013-12-31 20:29:03 +00:00
|
|
|
win_id = int(display.vlc_widget.winId())
|
2014-08-27 23:18:06 +00:00
|
|
|
if is_win():
|
2013-12-31 20:29:03 +00:00
|
|
|
display.vlc_media_player.set_hwnd(win_id)
|
2014-08-27 23:18:06 +00:00
|
|
|
elif is_macosx():
|
2012-08-18 17:26:54 +00:00
|
|
|
# We have to use 'set_nsobject' since Qt4 on OSX uses Cocoa
|
|
|
|
# framework and not the old Carbon.
|
2013-12-31 20:29:03 +00:00
|
|
|
display.vlc_media_player.set_nsobject(win_id)
|
2012-03-13 19:54:16 +00:00
|
|
|
else:
|
2011-12-08 20:51:44 +00:00
|
|
|
# for Linux using the X Server
|
2013-12-31 20:29:03 +00:00
|
|
|
display.vlc_media_player.set_xwindow(win_id)
|
2013-03-06 22:54:16 +00:00
|
|
|
self.has_own_widget = True
|
2011-07-10 21:43:07 +00:00
|
|
|
|
|
|
|
def check_available(self):
|
2013-02-02 06:32:29 +00:00
|
|
|
"""
|
|
|
|
Return the availability of VLC
|
|
|
|
"""
|
2012-04-28 11:13:16 +00:00
|
|
|
return VLC_AVAILABLE
|
2011-07-10 21:43:07 +00:00
|
|
|
|
|
|
|
def load(self, display):
|
2013-02-02 06:32:29 +00:00
|
|
|
"""
|
|
|
|
Load a video into VLC
|
|
|
|
"""
|
2013-08-31 18:17:38 +00:00
|
|
|
log.debug('load vid in Vlc Controller')
|
2011-07-10 21:43:07 +00:00
|
|
|
controller = display.controller
|
|
|
|
volume = controller.media_info.volume
|
2012-05-19 15:41:05 +00:00
|
|
|
file_path = str(controller.media_info.file_info.absoluteFilePath())
|
2011-07-10 21:43:07 +00:00
|
|
|
path = os.path.normcase(file_path)
|
|
|
|
# create the media
|
2014-05-23 13:39:25 +00:00
|
|
|
if controller.media_info.media_type == MediaType.CD:
|
2014-10-31 22:44:22 +00:00
|
|
|
if is_win():
|
|
|
|
path = '/' + path
|
2014-05-23 13:39:25 +00:00
|
|
|
display.vlc_media = display.vlc_instance.media_new_location('cdda://' + path)
|
|
|
|
display.vlc_media_player.set_media(display.vlc_media)
|
|
|
|
display.vlc_media_player.play()
|
|
|
|
# Wait for media to start playing. In this case VLC actually returns an error.
|
|
|
|
self.media_state_wait(display, vlc.State.Playing)
|
|
|
|
# If subitems exists, this is a CD
|
|
|
|
audio_cd_tracks = display.vlc_media.subitems()
|
|
|
|
if not audio_cd_tracks or audio_cd_tracks.count() < 1:
|
|
|
|
return False
|
|
|
|
display.vlc_media = audio_cd_tracks.item_at_index(controller.media_info.title_track)
|
|
|
|
else:
|
|
|
|
display.vlc_media = display.vlc_instance.media_new_path(path)
|
2011-07-10 21:43:07 +00:00
|
|
|
# put the media in the media player
|
2013-12-31 20:29:03 +00:00
|
|
|
display.vlc_media_player.set_media(display.vlc_media)
|
2011-07-10 21:43:07 +00:00
|
|
|
# parse the metadata of the file
|
2013-12-31 20:29:03 +00:00
|
|
|
display.vlc_media.parse()
|
2011-07-10 21:43:07 +00:00
|
|
|
self.volume(display, volume)
|
2012-10-27 14:52:51 +00:00
|
|
|
# We need to set media_info.length during load because we want
|
|
|
|
# to avoid start and stop the video twice. Once for real playback
|
|
|
|
# and once to just get media length.
|
2012-12-05 21:10:20 +00:00
|
|
|
#
|
2012-10-27 14:52:51 +00:00
|
|
|
# Media plugin depends on knowing media length before playback.
|
2013-12-31 20:29:03 +00:00
|
|
|
controller.media_info.length = int(display.vlc_media_player.get_media().get_duration() / 1000)
|
2011-07-10 21:43:07 +00:00
|
|
|
return True
|
|
|
|
|
2013-03-23 07:07:06 +00:00
|
|
|
def media_state_wait(self, display, media_state):
|
2011-07-10 21:43:07 +00:00
|
|
|
"""
|
|
|
|
Wait for the video to change its state
|
2011-12-02 22:00:28 +00:00
|
|
|
Wait no longer than 60 seconds. (loading an iso file needs a long time)
|
2011-07-10 21:43:07 +00:00
|
|
|
"""
|
|
|
|
start = datetime.now()
|
2013-12-31 20:29:03 +00:00
|
|
|
while not media_state == display.vlc_media.get_state():
|
|
|
|
if display.vlc_media.get_state() == vlc.State.Error:
|
2011-07-10 21:43:07 +00:00
|
|
|
return False
|
2013-02-03 19:23:12 +00:00
|
|
|
self.application.process_events()
|
2011-12-02 22:00:28 +00:00
|
|
|
if (datetime.now() - start).seconds > 60:
|
2011-07-10 21:43:07 +00:00
|
|
|
return False
|
|
|
|
return True
|
|
|
|
|
|
|
|
def resize(self, display):
|
2013-02-02 06:32:29 +00:00
|
|
|
"""
|
|
|
|
Resize the player
|
|
|
|
"""
|
2013-12-31 20:29:03 +00:00
|
|
|
display.vlc_widget.resize(display.size())
|
2012-01-19 19:13:19 +00:00
|
|
|
|
2011-07-10 21:43:07 +00:00
|
|
|
def play(self, display):
|
2013-02-02 06:32:29 +00:00
|
|
|
"""
|
|
|
|
Play the current item
|
|
|
|
"""
|
2011-07-25 20:56:39 +00:00
|
|
|
controller = display.controller
|
|
|
|
start_time = 0
|
2014-03-04 22:33:50 +00:00
|
|
|
log.debug('vlc play')
|
2012-12-11 19:55:47 +00:00
|
|
|
if self.state != MediaState.Paused and controller.media_info.start_time > 0:
|
2011-07-25 20:56:39 +00:00
|
|
|
start_time = controller.media_info.start_time
|
2014-05-07 22:52:06 +00:00
|
|
|
threading.Thread(target=display.vlc_media_player.play).start()
|
2012-06-09 15:46:01 +00:00
|
|
|
if not self.media_state_wait(display, vlc.State.Playing):
|
2011-08-29 19:55:58 +00:00
|
|
|
return False
|
2014-03-04 22:33:50 +00:00
|
|
|
if self.state != MediaState.Paused and controller.media_info.start_time > 0:
|
|
|
|
log.debug('vlc play, starttime set')
|
|
|
|
start_time = controller.media_info.start_time
|
2014-04-22 20:42:07 +00:00
|
|
|
log.debug('mediatype: ' + str(controller.media_info.media_type))
|
2014-03-04 22:33:50 +00:00
|
|
|
# Set tracks for the optical device
|
|
|
|
if controller.media_info.media_type == MediaType.DVD:
|
|
|
|
log.debug('vlc play, playing started')
|
|
|
|
if controller.media_info.title_track > 0:
|
|
|
|
log.debug('vlc play, title_track set: ' + str(controller.media_info.title_track))
|
2014-03-04 22:50:24 +00:00
|
|
|
display.vlc_media_player.set_title(controller.media_info.title_track)
|
|
|
|
display.vlc_media_player.play()
|
2014-03-04 22:33:50 +00:00
|
|
|
if not self.media_state_wait(display, vlc.State.Playing):
|
|
|
|
return False
|
|
|
|
if controller.media_info.audio_track > 0:
|
2014-03-04 22:50:24 +00:00
|
|
|
display.vlc_media_player.audio_set_track(controller.media_info.audio_track)
|
2014-03-04 22:33:50 +00:00
|
|
|
log.debug('vlc play, audio_track set: ' + str(controller.media_info.audio_track))
|
|
|
|
if controller.media_info.subtitle_track > 0:
|
2014-03-04 22:50:24 +00:00
|
|
|
display.vlc_media_player.video_set_spu(controller.media_info.subtitle_track)
|
2014-03-04 22:33:50 +00:00
|
|
|
log.debug('vlc play, subtitle_track set: ' + str(controller.media_info.subtitle_track))
|
|
|
|
if controller.media_info.start_time > 0:
|
|
|
|
log.debug('vlc play, starttime set: ' + str(controller.media_info.start_time))
|
|
|
|
start_time = controller.media_info.start_time
|
2014-07-01 20:06:55 +00:00
|
|
|
controller.media_info.length = controller.media_info.end_time - controller.media_info.start_time
|
|
|
|
else:
|
|
|
|
controller.media_info.length = int(display.vlc_media_player.get_media().get_duration() / 1000)
|
2012-12-13 18:55:11 +00:00
|
|
|
self.volume(display, controller.media_info.volume)
|
2014-07-01 20:06:55 +00:00
|
|
|
if start_time > 0 and display.vlc_media_player.is_seekable():
|
|
|
|
display.vlc_media_player.set_time(int(start_time * 1000))
|
2013-03-23 07:28:24 +00:00
|
|
|
controller.seek_slider.setMaximum(controller.media_info.length * 1000)
|
2012-06-09 15:46:01 +00:00
|
|
|
self.state = MediaState.Playing
|
2013-12-31 20:29:03 +00:00
|
|
|
display.vlc_widget.raise_()
|
2012-06-09 15:46:01 +00:00
|
|
|
return True
|
2011-07-10 21:43:07 +00:00
|
|
|
|
|
|
|
def pause(self, display):
|
2013-02-02 06:32:29 +00:00
|
|
|
"""
|
|
|
|
Pause the current item
|
|
|
|
"""
|
2013-12-31 20:29:03 +00:00
|
|
|
if display.vlc_media.get_state() != vlc.State.Playing:
|
2011-07-18 21:25:10 +00:00
|
|
|
return
|
2013-12-31 20:29:03 +00:00
|
|
|
display.vlc_media_player.pause()
|
2011-08-29 19:55:58 +00:00
|
|
|
if self.media_state_wait(display, vlc.State.Paused):
|
2011-07-10 21:43:07 +00:00
|
|
|
self.state = MediaState.Paused
|
|
|
|
|
|
|
|
def stop(self, display):
|
2013-02-02 06:32:29 +00:00
|
|
|
"""
|
|
|
|
Stop the current item
|
|
|
|
"""
|
2014-05-07 22:52:06 +00:00
|
|
|
threading.Thread(target=display.vlc_media_player.stop).start()
|
2011-07-10 21:43:07 +00:00
|
|
|
self.state = MediaState.Stopped
|
|
|
|
|
|
|
|
def volume(self, display, vol):
|
2013-02-02 06:32:29 +00:00
|
|
|
"""
|
|
|
|
Set the volume
|
|
|
|
"""
|
2013-03-06 22:54:16 +00:00
|
|
|
if display.has_audio:
|
2013-12-31 20:29:03 +00:00
|
|
|
display.vlc_media_player.audio_set_volume(vol)
|
2011-07-10 21:43:07 +00:00
|
|
|
|
2013-03-23 07:28:24 +00:00
|
|
|
def seek(self, display, seek_value):
|
2013-02-02 06:32:29 +00:00
|
|
|
"""
|
|
|
|
Go to a particular position
|
|
|
|
"""
|
2014-07-01 20:06:55 +00:00
|
|
|
if display.controller.media_info.media_type == MediaType.CD \
|
|
|
|
or display.controller.media_info.media_type == MediaType.DVD:
|
|
|
|
seek_value += int(display.controller.media_info.start_time * 1000)
|
2013-12-31 20:29:03 +00:00
|
|
|
if display.vlc_media_player.is_seekable():
|
|
|
|
display.vlc_media_player.set_time(seek_value)
|
2011-07-10 21:43:07 +00:00
|
|
|
|
|
|
|
def reset(self, display):
|
2013-02-02 06:32:29 +00:00
|
|
|
"""
|
|
|
|
Reset the player
|
|
|
|
"""
|
2013-12-31 20:29:03 +00:00
|
|
|
display.vlc_media_player.stop()
|
|
|
|
display.vlc_widget.setVisible(False)
|
2011-07-10 21:43:07 +00:00
|
|
|
self.state = MediaState.Off
|
|
|
|
|
|
|
|
def set_visible(self, display, status):
|
2013-02-02 06:32:29 +00:00
|
|
|
"""
|
|
|
|
Set the visibility
|
|
|
|
"""
|
2013-03-06 22:54:16 +00:00
|
|
|
if self.has_own_widget:
|
2013-12-31 20:29:03 +00:00
|
|
|
display.vlc_widget.setVisible(status)
|
2011-07-10 21:43:07 +00:00
|
|
|
|
|
|
|
def update_ui(self, display):
|
2013-02-02 06:32:29 +00:00
|
|
|
"""
|
|
|
|
Update the UI
|
|
|
|
"""
|
2012-10-27 17:04:54 +00:00
|
|
|
# Stop video if playback is finished.
|
2013-12-31 20:29:03 +00:00
|
|
|
if display.vlc_media.get_state() == vlc.State.Ended:
|
2012-03-13 19:54:16 +00:00
|
|
|
self.stop(display)
|
2011-07-10 21:43:07 +00:00
|
|
|
controller = display.controller
|
2011-07-25 20:56:39 +00:00
|
|
|
if controller.media_info.end_time > 0:
|
2013-12-31 20:29:03 +00:00
|
|
|
if display.vlc_media_player.get_time() > controller.media_info.end_time * 1000:
|
2011-07-25 20:56:39 +00:00
|
|
|
self.stop(display)
|
|
|
|
self.set_visible(display, False)
|
2013-03-23 07:28:24 +00:00
|
|
|
if not controller.seek_slider.isSliderDown():
|
|
|
|
controller.seek_slider.blockSignals(True)
|
2014-07-01 20:06:55 +00:00
|
|
|
if display.controller.media_info.media_type == MediaType.CD \
|
|
|
|
or display.controller.media_info.media_type == MediaType.DVD:
|
|
|
|
controller.seek_slider.setSliderPosition(display.vlc_media_player.get_time() -
|
|
|
|
int(display.controller.media_info.start_time * 1000))
|
|
|
|
else:
|
|
|
|
controller.seek_slider.setSliderPosition(display.vlc_media_player.get_time())
|
2013-03-23 07:28:24 +00:00
|
|
|
controller.seek_slider.blockSignals(False)
|
2011-12-02 15:15:31 +00:00
|
|
|
|
2012-10-15 17:35:14 +00:00
|
|
|
def get_info(self):
|
2013-02-02 06:32:29 +00:00
|
|
|
"""
|
|
|
|
Return some information about this player
|
|
|
|
"""
|
2012-10-15 17:35:14 +00:00
|
|
|
return(translate('Media.player', 'VLC is an external player which '
|
2013-12-31 20:29:03 +00:00
|
|
|
'supports a number of different formats.') +
|
|
|
|
'<br/> <strong>' + translate('Media.player', 'Audio') +
|
|
|
|
'</strong><br/>' + str(AUDIO_EXT) + '<br/><strong>' +
|
|
|
|
translate('Media.player', 'Video') + '</strong><br/>' +
|
2014-03-20 19:10:31 +00:00
|
|
|
str(VIDEO_EXT) + '<br/>')
|