From 6fae1a56b7a755cd6cd97e43987be257cd86df34 Mon Sep 17 00:00:00 2001 From: nicomiguelino Date: Thu, 25 Apr 2024 11:39:16 -0700 Subject: [PATCH] fix: fix viewer to support RTSP playback * A workaround is implemented during the asset check. --- lib/utils.py | 7 ++----- viewer.py | 5 +++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/utils.py b/lib/utils.py index 915b87c44..44ca0cd21 100644 --- a/lib/utils.py +++ b/lib/utils.py @@ -250,11 +250,8 @@ def url_fails(url): If it is streaming """ if urlparse(url).scheme in ('rtsp', 'rtmp'): - run_mplayer = mplayer('-identify', '-frames', '0', '-nosound', url) - for line in run_mplayer.split('\n'): - if 'Clip info:' in line: - return False - return True + # @TODO: Do further validation on the asset before returning. + return False """ Try HEAD and GET for URL availability check. diff --git a/viewer.py b/viewer.py index ffbea0f3e..108d3b9d8 100755 --- a/viewer.py +++ b/viewer.py @@ -372,10 +372,15 @@ def view_video(uri, duration): view_image('null') + timeout = 0 + try: while media_player.is_playing(): watchdog() sleep(1) + timeout += 1 + if timeout > int(duration): + break except sh.ErrorReturnCode_1: logging.info('Resource URI is not correct, remote host is not responding or request was rejected.')