Skip to content

OpencastPaellaPlayer

The OpencastPaellaPlayer class is the main component of the paella-opencast-core package. It extends the Paella class from the @asicupv/paella-core and adds specific functionalities for working with Opencast.

constructor(containerElement: HTMLElement | string, opencastParams: OpencastInitParams = {})
  • containerElement: HTMLElement | string - The container element where the player will be mounted
  • opencastParams: OpencastInitParams - Opencast-specific initialization parameters (OpencastInitParams)
readonly opencastPresentationUrl: string | null

Base URL of the Opencast presentations server.

readonly opencastAuth: OpencastAuth

Instance of the Opencast authentication system.

getUrlFromOpencastServer(url: string): string | null

Builds a complete URL based on the Opencast presentations server URL.

Parameters:

  • url: string - Relative or absolute URL

Returns: The complete URL or null if no presentation URL is configured.

getEvent(): Event

Gets the Opencast event from the video manifest.

Returns: The Event object containing the event information.

async applyOpencastTheme(): Promise<void>

Applies the Opencast visual theme to the player.

The class accepts extended configuration that includes Opencast-specific options:

export interface OpencastPaellaConfig extends Config {
opencast?: {
auth?: string;
conversionConfig?: ConversionConfig;
}
}
import { OpencastPaellaPlayer } from '@asicupv/paella-opencast-core';
const player = new OpencastPaellaPlayer('player-container', {
// player configuration
...
});
// Apply Opencast theme
await player.applyOpencastTheme();
// Get event information
const event = player.getEvent();
console.log('Event title:', event.metadata?.title);
  • Internationalization: Automatically adds language dictionaries for Opencast
  • Skin integration: Automatically loads Opencast CSS styles
  • URL management: Facilitates the construction of URLs relative to the Opencast server
  • Authentication: Integrates the authentication system with the player