Event converters
Event converters are components that transform Opencast event data from different sources to the normalized Event format used by Paella Player.
EventConversor (Base class)
Section titled “EventConversor (Base class)”The base EventConversor class provides common functionalities for event conversion.
export class EventConversor { readonly paella: Paella; readonly conversionConfig: ConversionConfig;
constructor(paella: Paella, conversionConfig: ConversionConfig = {})}ConversionConfig
Section titled “ConversionConfig”Configuration to customize the conversion process:
export interface ConversionConfig { captionsBackwardsCompatibility?: boolean segmentPreviewAttachmentsFlavours?: string[] playerPreviewAttachmentsFlavours?: string[] timelineAttachmentsFlavours?: string[] tagFor360Video?: string hideTimeLineOnLive?: boolean}Configuration properties
Section titled “Configuration properties”- 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
EngageEventConversor
Section titled “EngageEventConversor”Converts events from Opencast’s Engage service to Event format.
export function opencastSearchResultToOpencastPaellaEvent(searchResult: any): Eventexport function opencastSearchResultToPaellaManifest(searchResult: any, paella: Paella, conversionConfig: ConversionConfig = {}): Promise<Manifest>Main functions
Section titled “Main functions”opencastSearchResultToOpencastPaellaEvent
Section titled “opencastSearchResultToOpencastPaellaEvent”Converts an Engage service search result to an Event object.
Parameters:
searchResult: Search result from Engage service
Returns: Normalized Event object
opencastSearchResultToPaellaManifest
Section titled “opencastSearchResultToPaellaManifest”Converts an Engage service search result to a Paella Player manifest.
Parameters:
searchResult: Search result from Engage servicepaella: Paella Player instanceconversionConfig: Conversion configuration
Returns: Promise that resolves to a Paella Manifest
APIEventConversor
Section titled “APIEventConversor”Converts events from Opencast’s external API to Event format.
export function opencastExternalAPIEventToPaellaManifest(event: any, paella: Paella, conversionConfig: ConversionConfig = {}): Promise<Manifest>opencastExternalAPIEventToPaellaManifest
Section titled “opencastExternalAPIEventToPaellaManifest”Converts an external API event to a Paella Player manifest.
Parameters:
event: Event from Opencast external APIpaella: Paella Player instanceconversionConfig: Conversion configuration
Returns: Promise that resolves to a Manifest