Playing video in colab

Does anyone know how to play .mp4s, or .avis in colab?

I tried using, or IPython.display.HTML. Both led to runtime restarts. Though the video is pulled up, I can’t play it.

Any ideas.

Use this
from IPython.display import HTML
from base64 import b64encode
mp4 = open(‘video.mp4’,‘rb’).read()
data_url = “data:video/mp4;base64,” + b64encode(mp4).decode()

“”" % data_url)

Original answer:

ohhh. Thank you very much.