Skip to content

Event converters

Event converters are components that transform Opencast event data from different sources to the normalized Event format used by Paella Player.

The base EventConversor class provides common functionalities for event conversion.

export class EventConversor {
readonly paella: Paella;
readonly conversionConfig: ConversionConfig;
constructor(paella: Paella, conversionConfig: ConversionConfig = {})
}

Configuration to customize the conversion process:

export interface ConversionConfig {
captionsBackwardsCompatibility?: boolean
segmentPreviewAttachmentsFlavours?: string[]
playerPreviewAttachmentsFlavours?: string[]
timelineAttachmentsFlavours?: string[]
tagFor360Video?: string
hideTimeLineOnLive?: boolean
}
  • captionsBackwardsCompatibility: Enables compatibility with legacy captions
  • segmentPreviewAttachmentsFlavours: Attachment types for segment previews
  • playerPreviewAttachmentsFlavours: Attachment types for player previews
  • timelineAttachmentsFlavours: Attachment types for timeline
  • tagFor360Video: Tag to identify 360° videos
  • hideTimeLineOnLive: Hide timeline on live broadcasts

Converts events from Opencast’s Engage service to Event format.

export function opencastSearchResultToOpencastPaellaEvent(searchResult: any): Event
export function opencastSearchResultToPaellaManifest(searchResult: any, paella: Paella, conversionConfig: ConversionConfig = {}): Promise<Manifest>

Converts an Engage service search result to an Event object.

Parameters:

  • searchResult: Search result from Engage service

Returns: Normalized Event object

Converts an Engage service search result to a Paella Player manifest.

Parameters:

  • searchResult: Search result from Engage service
  • paella: Paella Player instance
  • conversionConfig: Conversion configuration

Returns: Promise that resolves to a Paella Manifest

Converts events from Opencast’s external API to Event format.

export function opencastExternalAPIEventToPaellaManifest(event: any, paella: Paella, conversionConfig: ConversionConfig = {}): Promise<Manifest>

Converts an external API event to a Paella Player manifest.

Parameters:

  • event: Event from Opencast external API
  • paella: Paella Player instance
  • conversionConfig: Conversion configuration

Returns: Promise that resolves to a Manifest