Video Functions
To manage video call recordings, use the functions exported by the Video adapter.
Importing the adapter
import { videoAdapter } from 'epicenter-libs';
The videoAdapter namespace exports functions that make calls to the Video API.
For descriptions of the objects used by the Video adapter functions, read Video Entities.
Get
Query videos
To perform an open search for video objects, use the query() function.
Permissions
Requires a role of ANONYMOUS or higher.
Function description
- Constructs a
GETrequest to the/video/searchendpoint. - Supports filtering, sorting, and pagination through
GenericSearchOptions. - Returns a paginated list of video objects.
export async function query(
searchOptions: GenericSearchOptions,
optionals: RoutingOptions = {},
): Promise<Page<VideoReadOutView>>
Parameters
searchOptions(GenericSearchOptions) – Search criteria for querying videosfilter?(string[]) – A list of filter expressionssort?(string[]) – Sorting criteria (joined into a semicolon‑delimited string)first?(number) – Index from which to begin returning resultsmax?(number) – Maximum number of videos to return
optionals(Type:RoutingOptions, optional) - Additional routing options to override default network call behavior.
Return value
A promise that resolves to a Page<VideoReadOutView> object containing a paginated list of videos.
Usage example
import { videoAdapter } from 'epicenter-libs';
const videos = await videoAdapter.query({
filter: [
'affiliate=DAILY',
'episodeName=myEpisode',
'created>=2022-01-03T20:30:53.054Z',
],
sort: ['+video.created'],
first: 0,
max: 25,
});
Get video directory URL
To retrieve the directory URL and metadata for a video file, use the getDirectoryURL() function.
Permissions
Requires a role of ANONYMOUS or higher.
Function description
- Constructs a
GETrequest to either:/video/dir/{VIDEO_KEY}, or/video/dir/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{AFFILIATE}/{FAMILY}
- Returns a video object containing file listings and metadata.
export async function getDirectoryURL(
optionals: {
scope?: { userKey?: string } & GenericScope;
affiliate?: Affiliate;
family?: string;
videoKey?: string;
} & RoutingOptions = {},
): Promise<VideoReadOutView>
Parameters
optionals(Type:{ scope?: { userKey?: string } & GenericScope; affiliate?: Affiliate; family?: string; videoKey?: string } & RoutingOptions, optional) – Arguments for selecting the video directory andRoutingOptionsfor overriding routing behavior.scope?({ userKey?: string } & GenericScope) – Scope used to locate the videoscopeBoundary– Scope entityscopeKey(string) – Unique identifier for the scopeuserKey?(string) – User attached to the scope, if applicable
affiliate?(Affiliate) – Affiliate providing the resource (e.g.,'DAILY')family?(string) – The set of media files related to the same video conference recordingvideoKey?(string) – Key of the video object to retrieve
Return value
A promise that resolves to a VideoReadOutView object containing directory metadata and file listings.
Usage example
import { videoAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';
// Get using video key
videoAdapter.getDirectoryURL({
videoKey: '0000017e31bb902cfe17615867d5005c5d5f',
});
// Get using scope/affiliate/family
videoAdapter.getDirectoryURL({
scope: {
scopeBoundary: SCOPE_BOUNDARY.GROUP,
scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',
},
affiliate: 'DAILY',
family: 'archiveName',
});
Get video file URL
To retrieve the download URL for a specific video file, use the getURL() function.
Permissions
Requires a role of ANONYMOUS or higher.
Function description
- Constructs a
GETrequest to either:/video/url/{VIDEO_KEY}/{FILE}, or/video/url/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{AFFILIATE}/{FAMILY}/{FILE}
- Returns the direct URL string for the requested video file.
export async function getURL(
file: string,
optionals: {
scope?: { userKey?: string } & GenericScope;
affiliate?: Affiliate;
family?: string;
videoKey?: string;
} & RoutingOptions = {},
): Promise<string>
Parameters
file(string) – Name of the file to retrieve (e.g.,"archive.mp4").optionals(Type:{ scope?: { userKey?: string } & GenericScope; affiliate?: Affiliate; family?: string; videoKey?: string } & RoutingOptions, optional) – Arguments for selecting the video URL andRoutingOptionsfor overriding routing behavior.scope?({ userKey?: string } & GenericScope)scopeBoundary– Scope entityscopeKey(string) – Unique identifier for the scopeuserKey?(string) – User attached to the scope, if applicable
affiliate?(Affiliate) – Affiliate providing the resource (e.g.,'DAILY')family?(string) – The set of media files related to the same video conference recordingvideoKey?(string) – Key of the video object to retrieve
Return value
A promise that resolves to the download URL string for the requested video file.
Usage example
import { videoAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';
// Get using video key
videoAdapter.getURL('archive.mp4', {
videoKey: '0000017e31bb902cfe17615867d5005c5d5f',
});
// Get using scope/affiliate/family
videoAdapter.getURL('archive.mp4', {
scope: {
scopeBoundary: SCOPE_BOUNDARY.GROUP,
scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',
},
affiliate: 'DAILY',
family: 'archiveName',
});
Download video file
To download a specific video file, use the download() function.
Permissions
Requires a role of ANONYMOUS or higher.
Function description
- Constructs a
GETrequest to either:/video/download/{VIDEO_KEY}/{FILE}, or/video/download/with/{SCOPE_BOUNDARY}/{SCOPE_KEY}/{AFFILIATE}/{FAMILY}/{FILE}
- Initiates a file download and resolves when the download completes.
export async function download(
file: string,
optionals: {
scope?: { userKey?: string } & GenericScope;
affiliate?: Affiliate;
family?: string;
videoKey?: string;
} & RoutingOptions = {},
): Promise<void>
Parameters
file(string) – Name of the file to download (e.g.,"archive.mp4").optionals(Type:{ scope?: { userKey?: string } & GenericScope; affiliate?: Affiliate; family?: string; videoKey?: string } & RoutingOptions, optional) – Arguments for selecting the video file andRoutingOptionsfor overriding routing behavior.scope?({ userKey?: string } & GenericScope)scopeBoundary– Scope entityscopeKey(string) – Unique identifier for the scopeuserKey?(string) – User attached to the scope, if applicable
affiliate?(Affiliate) – Affiliate providing the resource (e.g.,'DAILY')family?(string) – The set of media files related to the same video conference recordingvideoKey?(string) – Key of the video object to retrieve
Return value
A promise that resolves to undefined when the download is complete.
Usage example
import { videoAdapter, SCOPE_BOUNDARY } from 'epicenter-libs';
// Download using video key
await videoAdapter.download('archive.mp4', {
videoKey: '0000017e31bb902cfe17615867d5005c5d5f',
});
// Download using scope/affiliate/family
await videoAdapter.download('archive.mp4', {
scope: {
scopeBoundary: SCOPE_BOUNDARY.GROUP,
scopeKey: '0000017dd3bf540e5ada5b1e058f08f20461',
},
affiliate: 'DAILY',
family: 'archiveName',
});
Process
Process video
To process a recording file, use the processVideo() function.
The function takes an array of processor objects that describe the type of processing that should be performed. The processing types are defined by ProcessingType.
Permissions
Requires a role of ANONYMOUS or higher.
Function description
- Constructs a
POSTrequest to the/video/execute/{VIDEO_KEY}endpoint. - Supports specifying media format, language, timeout, and target media file.
- Returns a boolean indicating whether the processing request was successfully submitted.
export async function processVideo(
videoKey: string,
processors: {
jobName: string;
mediaFormat: MediaFormat;
languageCode: LanguageCode;
timeoutMinutes?: number;
mediaFile: string;
objectType: ProcessingType;
}[],
optionals: {
log?: string;
} & RoutingOptions = {},
): Promise<boolean>
Parameters
videoKey(string) – The key of the video to process.processors(Array of processing job objects) – A list of processing tasks to perform on the video. Each processor includes:jobName(string) – Name for the resulting processed file.mediaFormat(MediaFormat) – Format of the media file being processed.languageCode(LanguageCode) – Language of the video content.timeoutMinutes?(number) – Optional timeout before the request is canceled (defaults to 3 minutes).mediaFile(string) – Name of the media file to process.objectType(ProcessingType) – Type of processing job.
optionals(Type:{ log?: string } & RoutingOptions, optional)log?(string) – Name of the log file to write processing logs to.RoutingOptionsfor overriding routing behavior.
Return value
A promise that resolves to a boolean indicating whether the processing request was successfully submitted.
Usage example
const processors = [
{
mediaFormat: 'mp4',
languageCode: 'en-US',
objectType: 'transcription',
mediaFile: 'archive.mp4',
jobName: 'test-transcription',
},
];
await videoAdapter.processVideo(videoKey, processors);
Delete
Delete video
To delete a video and all associated files, use the remove() function.
Permissions
Requires a role of ANONYMOUS or higher.
Function description
- Constructs a
DELETErequest to the/video/{VIDEO_KEY}endpoint. - Returns
undefinedwhen the deletion is successful.
export async function remove(
videoKey: string,
optionals: RoutingOptions = {},
): Promise<void>
Parameters
videoKey(string) – The key of the video to delete.optionals(Type:RoutingOptions, optional) – Additional routing options to override default network call behavior.
Return value
A promise that resolves to undefined when the video is successfully deleted.
Usage example
import { videoAdapter } from 'epicenter-libs';
await videoAdapter.remove(videoKey);