use .webm instead of .mp4 for spectacle videos

This commit is contained in:
Seaswimmer 2024-11-22 10:15:16 -05:00
parent 87a4206717
commit 3d9c6cbade
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087

View file

@ -24,10 +24,8 @@ def spectacle_screenshot(
) )
if not file_path: if not file_path:
# Spectacle actually defaults to .webm for video recordings,
# but Zipline doesn't behave well with .webm files so we use .mp4 instead.
use_temp_file = True use_temp_file = True
suffix = ".mp4" if record else ".png" suffix = ".webm" if record else ".png"
temp_file = tempfile.NamedTemporaryFile(delete=False, suffix=suffix) temp_file = tempfile.NamedTemporaryFile(delete=False, suffix=suffix)
file_path = temp_file.name file_path = temp_file.name
temp_file.close() temp_file.close()