Add OpenTok Archive layout options. (#20218)

* Add OpenTok Archive layout options.

* Fix styesheet type.
This commit is contained in:
Seth Westphal
2017-10-02 15:11:46 -07:00
committed by Ryan Cavanaugh
parent 2233a0eee6
commit 2fba16f44b
2 changed files with 27 additions and 0 deletions
+12
View File
@@ -33,6 +33,18 @@ declare module 'opentok' {
hasAudio?: boolean;
hasVideo?: boolean;
outputMode?: OutputMode;
layout?: ArchiveLayoutOptions;
}
export type ArchiveLayoutOptions = PredefinedArchiveLayoutOptions | CustomArchiveLayoutOptions;
export interface PredefinedArchiveLayoutOptions {
type: 'bestFit' | 'pip' | 'verticalPresentation' | 'horizontalPresentation';
}
export interface CustomArchiveLayoutOptions {
type: 'custom';
stylesheet: string;
}
export type MediaMode = 'relayed' | 'routed';
+15
View File
@@ -28,6 +28,21 @@ const archiveOptions: OpenTok.ArchiveOptions = {
outputMode: 'individual',
};
const archiveCustomLayoutOptions: OpenTok.ArchiveOptions = {
outputMode: 'composed',
layout: {
type: 'custom',
stylesheet: 'derp',
}
};
const archivePredefinedLayoutOptions: OpenTok.ArchiveOptions = {
outputMode: 'composed',
layout: {
type: 'pip',
}
};
client.startArchive('SESSION_ID', archiveOptions, (err: Error, archive: OpenTok.Archive) => {
if (err) return console.log(err);
console.log(archive.id);