Skip to main content

Media

Media are the images, videos and sounds in the streamer's library. A media field stores a media ID; use these functions to load the file behind it. Results are cached for the lifetime of the widget.

getMedia​

breezy.getMedia(id: ID): Promise<Media | null>
let field = breezy.getField('alertSound')
let media = await breezy.getMedia(field.selection)

new Audio(media.url).play()

getMedias​

breezy.getMedias(ids: Array<ID>): Promise<Array<Media>>

Loads several media in one request. The results are returned in the same order as ids.

Media​

type Media = {
id: ID
url: string
date: string
mimetype: string
filename: string
filesize: string
thumbnail: MediaThumbnail
thumbnails: Array<MediaThumbnail>
attributes: Array<MediaAttribute>
}

type MediaThumbnail = {
id: ID
url: string
mimetype: string
filename: string
filesize: number
size: Size
}

type MediaAttribute = {
id: ID
type: string
data: any
}