Skip to main content
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

NameTypeDescription
widthintDisplay width in pixels. -1 for auto. Default -1.
heightintDisplay height in pixels. -1 for auto. Default -1.
typestringMIME type of the video. Default “video/mp4”.
srcstringSource URL or data URI of the video. Default None.