ProgressItem

data-variant=info
data-slots=text
UXP for Adobe Media Encoder is in public beta. This reference is being written, and the supported API surface may change before general availability.

Since: 27.0

A ProgressItem represents a single item of progress within a ProgressCategory, such as one render job's progress within the global render category. ProgressItem instances are not constructed directly; obtain one from ProgressCategory.createProgressItem, createProgressItemWithReferenceId, or getProgressItemFromReferenceID.

const app = require("mediaencoder");
const item = category.createProgressItem("Encoding job 1");

Constants

PROGRESS_STATE_NORMAL

Normal progress state. Returned by getProgressState and accepted by setProgressState / pauseOrResumeProgress.

Type: number (readonly, class)

Since: 27.0

PROGRESS_STATE_PAUSED

Paused progress state.

Type: number (readonly, class)

Since: 27.0

PROGRESS_STATE_RESUMED

Resumed progress state.

Type: number (readonly, class)

Since: 27.0

PROGRESS_STATE_WAITING

Waiting progress state.

Type: number (readonly, class)

Since: 27.0

PROGRESS_STATE_FAILED

Failed progress state.

Type: number (readonly, class)

Since: 27.0

PROGRESS_STATE_CANCELLED

Cancelled progress state.

Type: number (readonly, class)

Since: 27.0

EVENT_PROGRESS_ITEM_VALUE_CHANGED

Event ID fired when the progress item's value changes. The event carries progressItem, status, and value properties.

Type: string (readonly, class)

Since: 27.0

EVENT_PROGRESS_ITEM_CANCELLED

Event ID fired when the progress item is cancelled. The event carries a progressItem property.

Type: string (readonly, class)

Since: 27.0

EVENT_PROGRESS_ITEM_TITLE_CHANGED

Event ID fired when the progress item's title changes. The event carries progressItem and title properties.

Type: string (readonly, class)

Since: 27.0

Properties

referenceId

The reference ID the item was created with, if any.

Type: object (readonly)

Since: 27.0

creationTime

The time the progress item was created.

Type: string (readonly)

Since: 27.0

Methods

getValue

Gets the current progress value.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
value
number
The current progress value
const app = require("mediaencoder");
item.getValue();

getMaxValue

Gets the maximum progress value.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
maxValue
number
The maximum progress value
const app = require("mediaencoder");
item.getMaxValue();

getStatusMessage

Gets the current status message.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
statusMessage
string
The current status message
const app = require("mediaencoder");
item.getStatusMessage();

getTitle

Gets the title of the progress item.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
title
string
The title of the progress item
const app = require("mediaencoder");
item.getTitle();

getProgressState

Gets the current progress state.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
state
number
One of the PROGRESS_STATE_* constants
const app = require("mediaencoder");
item.getProgressState();

isComplete

Checks whether the progress item is complete.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
result
boolean
true if the item is complete
const app = require("mediaencoder");
item.isComplete();

isInProgress

Checks whether the progress item is currently in progress.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
result
boolean
true if the item is in progress
const app = require("mediaencoder");
item.isInProgress();

isIndeterminateProgress

Checks whether the progress item has been configured as unknown (indeterminate) progress.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
result
boolean
true if the item reports unknown progress
const app = require("mediaencoder");
item.isIndeterminateProgress();

isPending

Checks whether the progress item is pending.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
result
boolean
true if the item is pending
const app = require("mediaencoder");
item.isPending();

supportsCancellation

Checks if the progress item can be cancelled.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
result
boolean
true if the item supports cancellation
const app = require("mediaencoder");
item.supportsCancellation();

supportsPauseAndResume

Checks if the progress item can be paused and resumed.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
result
boolean
true if the item supports pause and resume
const app = require("mediaencoder");
item.supportsPauseAndResume();

cancelProgress

Cancels this progress item.

Since: 27.0

Parameters

none

Returns

Name
Type
Description
result
boolean
true on success
const app = require("mediaencoder");
await item.cancelProgress();

pauseOrResumeProgress

Pauses or resumes this progress item.

Since: 27.0

Parameters

Name
Type
Description
inProgresState
number
One of PROGRESS_STATE_PAUSED / PROGRESS_STATE_RESUMED

Returns

Name
Type
Description
result
boolean
true on success
const app = require("mediaencoder");
await item.pauseOrResumeProgress(app.ProgressItem.PROGRESS_STATE_PAUSED);

setProgressStatus

Sets the current progress value and max value.

Since: 27.0

Parameters

Name
Type
Description
value
number
The current progress value
maxValue
number
The maximum progress value

Returns

Name
Type
Description
result
boolean
true on success
const app = require("mediaencoder");
await item.setProgressStatus(50, 100);

setProgressStatusAndToolTip

Sets the current progress value, max value, status message, and tooltip.

Since: 27.0

Parameters

Name
Type
Description
value
number
The current progress value
maxValue
number
The maximum progress value
statusMessage
string
The status message to display
toolTip
string
The tooltip to display

Returns

Name
Type
Description
result
boolean
true on success
const app = require("mediaencoder");
await item.setProgressStatusAndToolTip(50, 100, "Encoding...", "Job 1 of 4");

setUnknownProgress

Marks the progress item as having unknown (indeterminate) progress.

Since: 27.0

Parameters

Name
Type
Description
statusMessage
string
The status message to display

Returns

Name
Type
Description
result
boolean
true on success
const app = require("mediaencoder");
await item.setUnknownProgress("Analyzing...");

setToolTip

Sets the tooltip for the progress item.

Since: 27.0

Parameters

Name
Type
Description
toolTip
string
The tooltip to display

Returns

Name
Type
Description
result
boolean
true on success
const app = require("mediaencoder");
await item.setToolTip("Job 1 of 4");

setStatusMessage

Sets the status message for the progress item.

Since: 27.0

Parameters

Name
Type
Description
statusMessage
string
The status message to display

Returns

Name
Type
Description
result
boolean
true on success
const app = require("mediaencoder");
await item.setStatusMessage("Encoding...");

setTitle

Sets the title of the progress item.

Since: 27.0

Parameters

Name
Type
Description
title
string
The new title to set

Returns

Name
Type
Description
result
boolean
true on success
const app = require("mediaencoder");
await item.setTitle("Encoding job 1 (retry)");

setProgressState

Sets the progress state.

Since: 27.0

Parameters

Name
Type
Description
state
number
One of the PROGRESS_STATE_* constants

Returns

Name
Type
Description
result
boolean
true on success
const app = require("mediaencoder");
await item.setProgressState(app.ProgressItem.PROGRESS_STATE_CANCELLED);

setCancelToolTip

Sets the tooltip shown for the cancel action on this progress item.

Since: 27.0

Parameters

Name
Type
Description
toolTip
string
The tooltip to display for cancel

Returns

Name
Type
Description
result
boolean
true on success
const app = require("mediaencoder");
await item.setCancelToolTip("Cancel this job");

subscribeToEvent

Registers a subscription to a specific event on this progress item.

Note: addEventListener() is required after a subscribeToEvent() call in order to actually react to an event, the same pattern used by RenderQueueInstance.

Since: 27.0

Parameters

Name
Type
Description
eventKey
string
The event ID to subscribe to, one of EVENT_PROGRESS_ITEM_VALUE_CHANGED, EVENT_PROGRESS_ITEM_CANCELLED, EVENT_PROGRESS_ITEM_TITLE_CHANGED

Returns

Name
Type
Description
success
boolean
Returns true if subscription was successful
const app = require("mediaencoder");
const event = app.ProgressItem.EVENT_PROGRESS_ITEM_VALUE_CHANGED;
item.subscribeToEvent(event); // true
const callback = (event) => {
  console.log("Progress value changed", event.value);
};
item.addEventListener(event, callback);