Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaces VLC with Qt #1930

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
15 changes: 7 additions & 8 deletions viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,14 +373,11 @@ def view_video(uri, duration):

view_image('null')

try:
while media_player.is_playing():
watchdog()
sleep(1)
except sh.ErrorReturnCode_1:
logging.info('Resource URI is not correct, remote host is not responding or request was rejected.')
if browser is None or not browser.process.alive:
load_browser()

media_player.stop()
browser_bus.loadVideo(uri)
logging.info('Current url is {0}'.format(uri))


def load_settings():
Expand Down Expand Up @@ -417,8 +414,10 @@ def asset_loop(scheduler):
else:
logging.error('Unknown MimeType %s', mime)

if 'image' in mime or 'web' in mime:
if any(mimetype for mimetype in ['image', 'web', 'video']):
duration = int(asset['duration'])
if 'video' in mime:
duration += 0.5 # Add a 500-ms delay to avoid cross-playback.
nicomiguelino marked this conversation as resolved.
Show resolved Hide resolved
logging.info('Sleeping for %s', duration)
sleep(duration)

Expand Down
Loading