This control is view-only. It is not interactive.
Video(width=-1, height=-1, type="video/mp4", src=None)
Example
from mirmod.controls import Video
from mirmod import miranda
import json
@wob.receiver("state","video",control=Video(width=640, height=480),hidden=True,connectable=False)
def get_video(self, video_data):
pass
@wob.execute()
def execute(self):
# Video source can be a URL or base64 data URI
video_url = "https://example.com/video.mp4"
ecx = miranda.get_execution_context()
ob = ecx.get_current_wob()
sc = ecx.get_security_context()
miranda.update_api(
sc, ob,
"RECEIVER", "video", "state",
value=video_url, connectable=False, hidden=True
)
miranda.notify_gui(sc, json.dumps({
"action": "update[VIEW]",
"data": { "id": ob.id, "metadata_id" : ob.metadata_id }
}))
Parameters
| Name | Type | Description |
|---|
| width | int | Display width in pixels. -1 for auto. Default -1. |
| height | int | Display height in pixels. -1 for auto. Default -1. |
| type | string | MIME type of the video. Default “video/mp4”. |
| src | string | Source URL or data URI of the video. Default None. |