Sharedtemp.ipynbOpen in CoCalc
from IPython.display import HTML


import io
import base64
from IPython.display import HTML

video = io.open('MDP.mp4', 'r+b').read()

encoded = base64.b64encode(video)
HTML(data='''<video alt="test" controls>
                <source src="data:video/mp4;base64,{0}" type="video/mp4" />
             </video>'''.format(encoded.decode('ascii')))
WARNING: Some output was deleted.
%%HTML
<!-- TODO -->
<div id="15110421761413674"><script type="text/JavaScript" src="https://www.aparat.com/embed/4psO7?data[rnddiv]=15110421761413674&data[responsive]=yes"></script></div>
%%HTML
<video width="320" height="240" controls>
  <source src="Final2.mp4" type="video/mp4">
</video>