From 7c7cfc559244381e679c062f7c3740ecff8846d5 Mon Sep 17 00:00:00 2001 From: JP+ <63192177+joachimpoutaraud@users.noreply.github.com> Date: Wed, 8 Jun 2022 17:23:10 +0200 Subject: [PATCH] Update _show.py --- musicalgestures/_show.py | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/musicalgestures/_show.py b/musicalgestures/_show.py index 4c44391..6cd8331 100644 --- a/musicalgestures/_show.py +++ b/musicalgestures/_show.py @@ -4,9 +4,7 @@ from matplotlib import pyplot as plt from IPython.display import Image, display # try: -# from IPython.display import Video -from IPython.display import HTML -from base64 import b64encode +from IPython.display import Video # except: # from IPython.core.display import Video # from base64 import b64encode @@ -91,30 +89,13 @@ def show(file, width=640, height=480, mode='windowed', title='Untitled', parent= if file_dir == cwd: video_to_display = os.path.relpath( video_to_display, os.getcwd()).replace('\\', '/') - - mp4 = open(video_to_display,'rb').read() - data_url = "data:video/mp4;base64," + b64encode(mp4).decode() - HTML(f""" - - """ % data_url) - # display(Video(video_to_display, - # width=video_width, height=video_height)) + display(Video(video_to_display, + width=video_width, height=video_height)) else: video_to_display = os.path.relpath( video_to_display, os.getcwd()).replace('\\', '/') - - mp4 = open(video_to_display,'rb').read() - data_url = "data:video/mp4;base64," + b64encode(mp4).decode() - HTML(f""" - - """ % data_url) - - # display(Video(video_to_display, width=video_width, - # height=video_height)) + display(Video(video_to_display, width=video_width, + height=video_height)) else: print(