Render Queue Instance
The Media Encoder Queue Instance API is the used for up to date methods on the Render Queue.
data-variant=info
data-slots=text
getStatus
Provides the current status of the rendering queue, represented as an enumeration.
The possible states are: Stopped = 0, Paused = 1, Running = 2, Stopping = 3, InvalidState = 4
Compare the returned status against the RENDER_QUEUE_* constants on RenderQueue, for example app.RenderQueue.RENDER_QUEUE_RUNNING.
Since: 27.0
Parameters
none
Returns
const app = require("mediaencoder");
const status = app.RenderQueue.getInstance().getStatus();
status; // 0 | 1 | 2 | 3 | 4
subscribeToEvent
Registers a subscription to a specific application event on a render queue instance object.
Note: addEventLister() is required after a subscribeToEvent() call in order to actually react to an event
Since: 27.0
Parameters
Returns
true if subscription was successfulconst app = require("mediaencoder");
const instance = app.RenderQueue.getInstance();
const event = app.RenderQueue.AUDIO_PREPROGRESS_VALUE_CHANGED;
// First Subscribe to the Event
instance.subscribeToEvent(event); // true
const callback = (value) => {
console.log("Audio Preprogress Value Changed", value);
};
// Then Add an Event Listener to the Event
instance.addEventListener(event, callback, false);
addEventListener
Listens for an application-level events and triggers a callback.
Note: subscribeToEvent() is required at least once for each event time before running addEventListener()
Since: 27.0
Parameters
Returns
none
const app = require("mediaencoder");
const instance = app.RenderQueue.getInstance();
const event = app.RenderQueue.AUDIO_PREPROGRESS_VALUE_CHANGED;
// First Subscribe to the Event
instance.subscribeToEvent(event); // true
const callback = (value) => {
console.log("Audio Preprogress Value Changed", value);
};
// Then Add an Event Listener to the Event
instance.addEventListener(event, callback, false);
removeEventListener
Removes an event listener from an application-level event.
Since: 27.0
Parameters
Returns
none
const app = require("mediaencoder");
const instance = app.RenderQueue.getInstance();
const event = app.RenderQueue.AUDIO_PREPROGRESS_VALUE_CHANGED;
// First Subscribe to the Event
instance.subscribeToEvent(event); // true
const callback = (value) => {
console.log("Audio Preprogress Value Changed", value);
};
// Then Add an Event Listener to the Event
instance.addEventListener(event, callback, false);
// Finally Remove the Event Listener
instance.removeEventListener(event, callback);