Playing video in colab

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

I tried using IPython.display.video, 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()
HTML("""

“”" % data_url)

Original answer: https://stackoverflow.com/questions/57377185/how-play-mp4-video-in-google-colab

ohhh. Thank you very much.