VideoWidget

VideoWidget

Description

The VideoWidget allows for displaying a video within your DSL app. You can display an video in a view by utilising an external url or displaying a previously uploaded video via a blob.

Attributes

url: String | null - External video url (EG: https://videos.pexels.com/video-files/20755531/20755531-uhd_2560_1440_24fps.mp4)

mimeType: String - Video mimeType (EG: video/mp4)

blobData: Base64 String - Blob data

width: Number | String | null - Width of the video (EG: 100 | '100%')

height: Number | String | null - Height of the video (EG: 100 | '100%')

Example

<raw type="VideoWidget" cols-xs="12" cols-md="6"> <content variable="rawVideoContent" /> </raw>
json rawVideoContent; void init() { rawVideoContent = /% { "url": null, "mimeType": null, "blobData": null, "width": "100%", "height": null } %/; // Get the first video blob from the database Video_File[] videos = sql:query("SELECT encode(filevalueblob, 'base64') as file_value_blob, filevalueblob_mtype__ as file_value_blob_mtype__ FROM videofile WHERE _id_ = 'b685a7f5-f06c-40b5-a5b4-0d2c56263bef'"); if (videos.length() > 0) { Video_File firstVideo = videos.first(); rawVideoContent.jsonPut("blobData", firstVideo.file_value_blob); rawVideoContent.jsonPut("mimeType", firstVideo.file_value_blob_mtype__); } }