def repr_video(fname, mimetype):
    """Load the video in the file `fname`, with given mimetype,
    and display as HTML5 video.
    """
    try:
        from IPython.display import HTML
    except ImportError:
        raise ImportError('This feature requires IPython.')
    video_encoded = open(fname, 'rb').read().encode('base64')
    video_tag = (
        """<video controls>
<source alt="test" src="data:video/{0};base64,{1}" type="video/webm">
Use Google Chrome browser.</video>"""
        .format(mimetype, video_encoded))
    return HTML(data=video_tag)
