GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

Custom widget content types

Content types

Your custom renderer receives an array of content items. Every item implements IBlazeContent. The concrete shape depends on the widget content type: story, moment, or video.

IBlazeContent

export interface IBlazeContent {
  id: string;
  title: string;
  updateTime: string;
  createTime: string;
  thumbnails: IThumbnail[];
  hasViewed: boolean;
  type?: string;
  entities?: ContentEntities;
}

IBlazeStory

export interface IBlazeStory extends IBlazeContent {
  pages: IBlazePage[];
  isLive: boolean;
}
export interface IBlazePage {
  id: string;
  duration: number;
  hasViewed: boolean;
  createTime: string;
  index?: number;
  thumbnail?: IThumbnail;
  poster?: IThumbnail;
}

IBlazeMoment

export interface IBlazeMoment extends IBlazeContent { 
  duration: string;
  likes: number;
}

IBlazeVideo

export interface IBlazeVideo extends IBlazeContent { 
  duration: string;
  likes: number;
  isLive: boolean;
}

Shared thumbnail types

export interface IThumbnail {
  type: ThumbnailApiType;
  rendition: IRendition;
  renditions?: IRendition[];
}
export type ThumbnailApiType =
  | 'SquareIcon'
  | 'VerticalTwoByThree'
  | 'Gif'
  | 'AnimatedThumbnailPoster'
  | 'MainThumbnail';
export interface IRendition {
  url: string;
  aspectRatio: ContentAspectRatio;
  bitRate: number;
  fileSize: number;
}

Related

Custom widgets | WidgetCustomView example | WidgetView class


Did this page help you?