Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Type aliases

AsyncCallback

AsyncCallback<T>: (result: AsyncResult<T>) => void

Type parameters

  • T

Type declaration

AsyncResult

AsyncResult<T>: { data: T | Error; success: boolean }

Type parameters

  • T

Type declaration

  • data: T | Error
  • success: boolean

Properties

VideoStore

VideoStore: { createVideo: (data: CreateVideoData, callback?: AsyncCallback<Video>) => Promise<Video>; deleteVideo: (id: string, callback?: AsyncCallback<boolean>) => Promise<boolean>; getVideo: (id: string, callback?: AsyncCallback<Video>) => Promise<Video>; getVideos: (params?: SearchParams, callback?: AsyncCallback<VideoList>) => Promise<VideoList>; subscribeOnNewVideos: (params: VideoSubscriptionFilters, handler: VideoSubscriptionHandler) => void | (() => void); subscribeOnVideoUpdate: (id: string, handler: VideoSubscriptionHandler) => () => void; updateVideo: (id: string, data: UpdateVideoData, callback?: AsyncCallback<Video>) => void | Promise<Video> }

Type declaration

  • createVideo: (data: CreateVideoData, callback?: AsyncCallback<Video>) => Promise<Video>
      • Create new video

        example

        Videos.createVideo({ title: 'My new video', tags: ['cats'] }).then(function(video) {})

        Parameters

        Returns Promise<Video>

        Promise object

  • deleteVideo: (id: string, callback?: AsyncCallback<boolean>) => Promise<boolean>
      • (id: string, callback?: AsyncCallback<boolean>): Promise<boolean>
      • Delete specified video

        example`

        Videos.deleteVideo('523b2185-874c-4c7f-9a41-ad651737f047').then(function(response) {})

        Parameters

        Returns Promise<boolean>

        Promise object

  • getVideo: (id: string, callback?: AsyncCallback<Video>) => Promise<Video>
      • Return list of videos

        example

        Videos.getVideo('548f048c-6170-691f-a206-3e0000000000').then(function(video) {})

        Parameters

        Returns Promise<Video>

        • Promise object
  • getVideos: (params?: SearchParams, callback?: AsyncCallback<VideoList>) => Promise<VideoList>
      • (params?: SearchParams, callback?: AsyncCallback<VideoList>): Promise<VideoList>
      • Return list of videos in accordance with search params

        example

        // Return 50 first videos that contain specified metadata Videos.getVideos({ metadata: { itemId: '548f0460-6170-691f-a2be-070000000000' } }).then(function(videos) {})

        // Return 50 last videos that have tag dogs Videos.getVideos({ tag: 'dogs', sortOrder: 'desc' }).then(function(videos) {})

        // Return first 30 videos that were created before specified date Videos.getVideos({ toDate: '2016-10-11T13:50:27.730490Z', page: 1, perPage: 30 }).then(function(videos) {})

        // Return next page with 30 videos that were created after specified date Videos.getVideos({ fromDate: '2016-10-11T13:50:27.730490Z', page: 2, perPage: 30 }).then(function(videos) {})

        // Return 3 specified videos Videos.getVideos({ ids: [ 'ed3875b5-4bdb-45b9-a969-7ff74737bbd6', '5032fffe-bb85-4c31-80ed-88452270731e', '229eace9-4598-4542-8de4-1b68d4f16013' ] }).then(function(videos) {})

        Parameters

        • params: SearchParams = {}

          Search params

        • Optional callback: AsyncCallback<VideoList>

        Returns Promise<VideoList>

        Promise object

  • subscribeOnNewVideos: (params: VideoSubscriptionFilters, handler: VideoSubscriptionHandler) => void | (() => void)
      • (params: VideoSubscriptionFilters, handler: VideoSubscriptionHandler): void | (() => void)
      • Create subscription on new videos with passed params

        example

        Videos.subscribeOnNewVideos({ metadata: { item_id: '4929382374812' } }, function(video) {})

        Videos.subscribeOnNewVideos({ tags: ['cats'] }, function(video) {})

        Parameters

        • params: VideoSubscriptionFilters
        • handler: VideoSubscriptionHandler

          Handler function, will be called with video object of new video

        Returns void | (() => void)

        • Unsubscribe function, calling of this function will remove subscription
  • subscribeOnVideoUpdate: (id: string, handler: VideoSubscriptionHandler) => () => void
      • (id: string, handler: VideoSubscriptionHandler): () => void
      • Create subscription on video update

        example

        V.streams.subscribeOnStreamUpdate('STREAM_ID', function(stream) {});

        Parameters

        • id: string

          Video id

        • handler: VideoSubscriptionHandler

          Handler function, will be called with video object of new stream

        Returns () => void

        Unsubscribe function, calling of this function will remove subscription

          • (): void
          • Returns void

  • updateVideo: (id: string, data: UpdateVideoData, callback?: AsyncCallback<Video>) => void | Promise<Video>
      • Update specified video

        example

        Videos.updateVideo('523b2185-874c-4c7f-9a41-ad651737f047', { title: 'New video title', tags: ['dogs'] }).then(function(video) {})

        Parameters

        • id: string

          Video id

        • data: UpdateVideoData

          Video data

        • Optional callback: AsyncCallback<Video>

        Returns void | Promise<Video>

        Promise object

Variables

SessionManager

SessionManager: SessionManager

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Property
  • Method
  • Inherited property

Generated using TypeDoc