We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.

Only Essential Cookies
Accept All
ReferencesVideo Editor KitAndroidUI SDKcom.huawei.hms.videoeditor.ui.apiClass SummaryMediaApplication

MediaApplication

Expand

Class Info

public class MediaApplication

UI SDK class that is used to globally call APIs.

Public Field Summary

Expand

Qualifier and Type

Field and Description

static final String

AUTH_ERROR

Authentication failure.

static final String

DAY_REQUEST_OVER_LIMIT

The number of requests for the License ID for a day reaches the limit.

static final String

PARAM_ERROR

Invalid parameter.

static final int

START_MODE_IMPORT_FROM_DRAFT

Mode for starting the Video Editor Kit UI through a draft.

static final int

START_MODE_IMPORT_FROM_MEDIA

Mode for starting the Video Editor Kit UI by importing a video or image.

Public Constructor Summary

Expand

Constructor Name

MediaApplication()

UI SDK class that is used to globally call APIs.

Public Method Summary

Expand

Qualifier and Type

Method Name and Description

int

deleteDrafts(List<String> draftIds)

Deletes a draft using its ID.

List<DraftInfo>

getDraftList()

Obtains the draft list.

static MediaApplication

getInstance()

Obtains a singleton of the MediaApplication class.

void

launchEditorActivity(Context context, VideoEditorLaunchOption option)

Sets the mode for starting the Video Editor Kit UI.

void

setAccessToken(String accessToken)

Sets an access token for your app.

void

setApiKey(String apiKey)

Sets an API key for your app.

void

setLicenseId(String licenseId)

Sets a License ID. You're advised to ensure this ID is unique.

void

setLicenseErrorMessage(Map<String, Integer> messageIds)

Sets License ID error messages.

void

setOnMediaExportCallBack(MediaExportCallBack callBack)

Sets the callback for video export.

Public Fields

AUTH_ERROR

Expand

Field

public static final String AUTH_ERROR

Authentication failure.

Constant value: "10103"

DAY_REQUEST_OVER_LIMIT

Expand

Field

public static final String DAY_REQUEST_OVER_LIMIT

The number of requests for the License ID for a day reaches the limit.

Constant value: "10108"

PARAM_ERROR

Expand

Field

public static final String PARAM_ERROR

Invalid parameter.

Constant value: "10104"

START_MODE_IMPORT_FROM_DRAFT

Expand

Field

public static final int START_MODE_IMPORT_FROM_DRAFT

Mode for starting the Video Editor Kit UI through a draft.

Constant value: 2

START_MODE_IMPORT_FROM_MEDIA

Expand

Field

public static final int START_MODE_IMPORT_FROM_MEDIA

Mode for starting the Video Editor Kit UI by importing a video or image.

Constant value: 1

Public Constructors

MediaApplication

Expand

Constructor

public MediaApplication()

UI SDK class that is used to globally call APIs.

Public Methods

deleteDrafts

Expand

Method

public int deleteDrafts(List<String> draftIds)

Deletes a draft using its ID.

Parameters
Expand

Name

Description

draftIds

List of drafts to be deleted.

Returns
Expand

Type

Description

int

Number of drafts that are successfully deleted.

getDraftList

Expand

Method

public List<DraftInfo> getDraftList()

Obtains the draft list.

Returns
Expand

Type

Description

List<DraftInfo>

Draft list.

getInstance

Expand

Method

public static MediaApplication getInstance()

Obtains a singleton of the MediaApplication class.

Returns
Expand

Type

Description

MediaApplication

Instance of the MediaApplication class.

launchEditorActivity

Expand

Method

public void launchEditorActivity(Context context, VideoEditorLaunchOption option)

Sets the mode for starting the Video Editor Kit UI.

Parameters

Expand

Name

Description

context

Context.

option

Option of the start mode.

setAccessToken

Expand

Method

public void setAccessToken(String accessToken)

Sets an access token for your app.

Parameters
Expand

Name

Description

accessToken

Access token of your app.

setApiKey

Expand

Method

public void setApiKey(String apiKey)

Sets an API key for your app.

Parameters
Expand

Name

Description

apiKey

API key of your app.

setLicenseId

Expand

Method

public void setLicenseId(String licenseId)

Sets a License ID. You're advised to ensure this ID is unique.

Parameters
Expand

Name

Description

licenseId

Unique License ID.

setLicenseErrorMessage

Expand

Method

public void setLicenseErrorMessage(Map<String, Integer> messageIds)

Sets License ID error messages by using the following result codes as keys and message resource IDs as values:

Parameters
Expand

Name

Description

messageIds

Message resource IDs.

setOnMediaExportCallBack

Expand

Method

public void setOnMediaExportCallBack(MediaExportCallBack callBack)

Sets the callback for video export.

Parameters
Expand

Name

Description

callBack

Instance of the callback for video export.

Search in References
Enter a keyword.