Video Functions
To manage video call recordings, use the functions exported by the Video adapter.
Importing the adapter
To use the functions of the Video adapter, import it as shown:
import { videoAdapter } from 'epicenter-libs';
The videoAdapter namespace exports functions that make calls to the Video API.
learn more
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.
Function signature
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.
Function signature
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