Media class

Media object returned by the select Media API

Extends

@microsoft/teams-js.@microsoft.teams-js.media.File

Constructors

Media(Media)

Properties

preview

A preview of the file which is a lightweight representation. * In case of images this will be a thumbnail/compressed image in base64 encoding.

Inherited Properties

content

Content of the file. When format is Base64, this is the base64 content. When format is ID, this is id mapping to the URI. When format is base64 and app needs to use this directly in HTML tags, it should convert this to dataUrl.

format

Format of the content

mimeType

* MIME type. This can be used for constructing a dataUrl, if needed.

name

* Optional: Name of the file

size

* Size of the file in KB

Methods

getMedia((error: SdkError, blob: Blob) => void)

Gets the media in chunks irrespecitve of size, these chunks are assembled and sent back to the webapp as file/blob.

Constructor Details

Media(Media)

new Media(that?: Media)

Parameters

that

@microsoft/teams-js.@microsoft.teams-js.media.Media

Property Details

preview

A preview of the file which is a lightweight representation. * In case of images this will be a thumbnail/compressed image in base64 encoding.

preview: string

Property Value

string

Inherited Property Details

content

Content of the file. When format is Base64, this is the base64 content. When format is ID, this is id mapping to the URI. When format is base64 and app needs to use this directly in HTML tags, it should convert this to dataUrl.

content: string

Property Value

string

Inherited From File.content

format

Format of the content

format: FileFormat

Property Value

@microsoft/teams-js.@microsoft.teams-js.media.FileFormat

Inherited From File.format

mimeType

* MIME type. This can be used for constructing a dataUrl, if needed.

mimeType: string

Property Value

string

Inherited From File.mimeType

name

* Optional: Name of the file

name?: string

Property Value

string

Inherited From File.name

size

* Size of the file in KB

size: number

Property Value

number

Inherited From File.size

Method Details

getMedia((error: SdkError, blob: Blob) => void)

Gets the media in chunks irrespecitve of size, these chunks are assembled and sent back to the webapp as file/blob.

function getMedia(callback: (error: SdkError, blob: Blob) => void)

Parameters

callback

(error: SdkError, blob: Blob) => void

returns blob of media