# Namespace: SDKApi
# Table of contents
# Interfaces
- IClipPlain
- ITagPlain
- SDKApiSession
- createClipOptions
- createHighlightOptions
- createTagOptions
- getClipsOptions
- getTagsOptions
# Functions
- baseUrl
- createClip
- createHighlight
- createTag
- getClipById
- getClips
- getProtectedSourceUrl
- getTags
- projectId
- session
# Functions
# baseUrl
▸ baseUrl(value?): string
BaseURL represents the base URL of the Pixellot public API (PAPI).
SDKApi.baseUrl
baseUrl is required for usage of SDKApi.
# Parameters
| Name | Type |
|---|---|
value? | string |
# Returns
string
# createClip
▸ createClip(options): Promise<IClipPlain>
Creates a clip.
const { SDKApi } = window.PixellotWebSDK;
SDKApi.createClip(options)
.then(clip => console.log(clip)); // {{ id: string, duration: { startTime: number, endTime: number }, name: string, ... } }
# Parameters
| Name | Type |
|---|---|
options | createClipOptions |
# Returns
Promise<IClipPlain>
# createHighlight
▸ createHighlight(options?): Promise<IClipPlain>
Creates a highlight.
const { SDKApi } = window.PixellotWebSDK;
const options = { useMusic: false, clipType: 'highlight', name: 'My Clip' }
SDKApi.createHighlight(options)
.then(highlight => console.log(highlight))
# Parameters
| Name | Type |
|---|---|
options? | createHighlightOptions |
# Returns
Promise<IClipPlain>
# createTag
▸ createTag(options): Promise<ITagPlain>
Create a tag for the specific event.
const { SDKApi } = window.PixellotWebSDK;
const options = { streamName: 'hd', mode: 'sync', videoType: 'live' };
SDKApi.createTag(options)
.then(tag => console.log(tag)) // {{ targetId: string, targetType: string, streamName: string }}
# Parameters
| Name | Type |
|---|---|
options | createTagOptions |
# Returns
Promise<ITagPlain>
# getClipById
▸ getClipById(id): Promise<IClipPlain>
Gets a single clip by ID.
const { SDKApi } = window.PixellotWebSDK;
const id = 'ad34627765388f';
SDKApi.getClipById(id)
.then(clip => console.log(clip)) // {{ id: string, duration: { startTime: number, endTime: number }, name: string, ... }}
# Parameters
| Name | Type |
|---|---|
id | string |
# Returns
Promise<IClipPlain>
# getClips
▸ getClips(options?): Promise<IClipPlain>
Gets a list of clips.
const { SDKApi } = window.PixellotWebSDK;
const options = { limit: 10, offset: 0 };
SDKApi.getClips(options)
.then(clips => console.lod(clips)); // {{ total: number, result: [{ id: number, name: string, ... }, ...] }}
# Parameters
| Name | Type |
|---|---|
options | getClipsOptions |
# Returns
Promise<IClipPlain>
# getProtectedSourceUrl
▸ getProtectedSourceUrl(url): Promise<{ expirationTime: number ; token: string }>
Gets a protected url for passed source url.
NOTE
Make sure that projectId and session data is set on SDKApi.
Also you should have an access to that content from user which token(session.token) you're using.
const { SDKApi } = window.PixellotWebSDK;
const url = 'https://some_secured_link/without_token.com';
SDKApi.getProtectedSourceUrl(url)
.then(urlWithToken => console.log(urlWithToken)) // {{ url: string }}
# Parameters
| Name | Type |
|---|---|
url | string |
# Returns
Promise<{ expirationTime: number ; token: string }>
# getTags
▸ getTags(options?): Promise<ITagPlain>
Fetch tags for the specific event.
const { SDKApi } = window.PixellotWebSDK;
const options = { limit: 10, offset: 0, videoType: 'live' };
SDKApi.getTags(options)
.then(tags => console.log(tags)) // {{ total: number, result: [{ targetId: string, targetType: string, ... }] }}
# Parameters
| Name | Type |
|---|---|
options | getTagsOptions |
# Returns
Promise<ITagPlain>
# projectId
▸ projectId(value?): string
ProjectID represents an id of your project created via Pixellot public API (PAPI).
SDKApi.session
projectId is required for usage of SDKApi.
# Parameters
| Name | Type |
|---|---|
value? | string |
# Returns
string
# session
▸ session(sessionPayload?): SDKApiSession
Session is a pair of token + signature which will be used to sign each request to the server.
SDKApi.session
session data are required for usage of SDKApi.
# Parameters
| Name | Type |
|---|---|
sessionPayload? | SDKApiSession |