from IPython.display import HTMLfrom base64 import b64encodevideo_path = "/content/test.mp4"mp4 = open(video_path, "rb").read()data_url = "data:video/mp4;base64," + b64encode(mp4).decode()HTML(f"""<video width=400 controls> <source src="{data_url}" type="video/mp4"></video>""")
NOTE: If the video fail to play, you might need to convert the video format. I supposed there is a size limit as well.