Skip to content

Video

Overview

Video is the equivalent of an <video> HTML element. Video displays the browser's native video controls.

Examples

import mesop as me


def load(e: me.LoadEvent):
  me.set_theme_mode("system")


@me.page(
  on_load=load,
  security_policy=me.SecurityPolicy(
    allowed_iframe_parents=["https://google.github.io"]
  ),
  path="/video",
)
def app():
  with me.box(style=me.Style(margin=me.Margin.all(15))):
    me.video(
      src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm",
      style=me.Style(height=300, width=300),
    )

API

video

Creates a video.

PARAMETER DESCRIPTION
src

URL of the video source

TYPE: str

style

The style to apply to the image, such as width and height.

TYPE: Style | None DEFAULT: None