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;
  badgeImageUrl?: string; // Badge image set for this item in the CMS, if any
}

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;
  title?: string | null; // Page title set in Arena, or null when the page has none
}

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?