export default SrgSsr; /** @import Player from 'video.js/dist/types/player' */ /** @import {Chapter, MainResource, Segment, Subtitle, TimeInterval} from '../dataProvider/model/typedef' */ /** @import {ComposedSrcMediaData, MainResourceWithKeySystems} from './typedef' */ /** * @class SrgSsr */ declare class SrgSsr { /** * Adds blocked segments to the player. * * @param {Player} player * @param {Array} [segments=[]] */ static addBlockedSegments(player: Player, segments?: Array): Promise; /** * Adds remote text tracks from an array of subtitles. * * @param {Player} player * @param {Array} [subtitles=[]] */ static addRemoteTextTracks(player: Player, subtitles?: Array): void; /** * Add a new cue to a text track with the given data. * * @param {TextTrack} textTrack * @param { * Segment | * Chapter | * TimeInterval * } data SRG SSR's cue-like representation */ static addTextTrackCue(textTrack: TextTrack, data: any): void; /** * Add a new cues to a text track with the given array. * * @param {TextTrack} textTrack * @param {Array.< * Segment | * Chapter | * TimeInterval> * } cues SRG SSR's cues-like representation */ static addTextTrackCues(textTrack: TextTrack, cues?: Array): void; /** * Add multiple text tracks to the player. * * @param {Player} player * @param {ComposedSrcMediaData} srcMediaObj */ static addTextTracks(player: Player, { mediaData }: ComposedSrcMediaData): void; /** * Adds chapters to the player. * * @param {Player} player * @param {string} chapterUrn The URN of the main chapter. * @param {Array.} [chapters=[]] */ static addChapters(player: Player, chapterUrn: string, chapters?: Array): Promise; /** * Adds intervals to the player. * * @param {Player} player * @param {Array.} [intervals=[]] */ static addIntervals(player: Player, intervals?: Array): Promise; /** * Set a blocking reason according to the block reason returned * by mediaData. * * @param {Player} player * @param {ComposedSrcMediaData} srcMediaObj * * @returns {undefined|Boolean} */ static blockingReason(player: Player, srcMediaObj: ComposedSrcMediaData): undefined | boolean; /** * Add the Akamai token to all resources * if at least one of them has tokenType * set to Akamai. * * @param {Array.} resources * * @returns {Promise>} */ static composeAkamaiResources(resources?: Array): Promise>; /** * Add the keySystems property to all resources * if at least one of them has DRM. * * @param {Array.} resources * * @returns {Array.} */ static composeKeySystemsResources(resources?: Array): Array; /** * Get the main resources from a mediaComposition. * May add an Akamai token or key systems if required by the resource. * * @param {MediaComposition} mediaComposition * * @returns {Promise>} */ static composeMainResources(mediaComposition: MediaComposition): Promise>; /** * Compose source options with media data. * MediaData properties from source options overwrite mediaData from IL. * * @param {any} srcObj * @param {any} srcObj.mediaData overrides or adds metadata to the composed mediaData. * @param {boolean} srcObj.disableTrackers * @param {MainResourceWithKeySystems} resource * * @returns {ComposedSrcMediaData} */ static composeSrcMediaData({ mediaData: srcMediaData, disableTrackers }: any, resource: MainResourceWithKeySystems): ComposedSrcMediaData; /** * Create a new metadata text track and add it to the player. * * If a text track with the same trackId exists, it is deleted beforehand. * * @param {Player} player * @param {String} trackId Text track unique ID * @param {Array.< * Segment | * Chapter | * TimeInterval> * } cues SRG SSR's cues-like representation * * @returns {Promise} */ static createTextTrack(player: Player, trackId: string, cues?: Array): Promise; /** * Proxy SRG SSR chapters and intervals cuechange events at player level. * * @param {Player} player */ static cuechangeEventProxy(player: Player): void; /** * SRG SSR data provider singleton. * * @param {Player} player * * @returns {DataProvider} */ static dataProvider(player: Player): DataProvider; /** * Set an error if something goes wrong with the data provider. * * @param {Player} player * @param {Object} error * * @returns {undefined|true} */ static dataProviderError(player: Player, error: any): undefined | true; /** * Set player error. * * @param {Player} player * @param {Object} error */ static error(player: Player, { code, message, metadata }: any): void; /** * Filter out incompatible resources such as `RTMP` and `HDS`. * * @param {Array.} resources Resources to filter * * @returns {Array.} The filtered resources */ static filterIncompatibleResources(resources?: Array): Array; /** * Get the current blocked segment from the player. * * @param {Player} player * * @returns {VTTCue|undefined} The blocked segment cue object, or undefined */ static getBlockedSegment(player: Player): VTTCue | undefined; /** * Get the VTT cue of a blocked segment. * * @param {Player} player * @param {Number} currentTime * * @returns {VTTCue|undefined} The VTT cue of a blocked segment, or undefined */ static getBlockedSegmentByTime(player: Player, currentTime: number): VTTCue | undefined; /** * Get blocked segments. * * @param {Player} player * @param {Array} [segments=[]] * * @returns {Array} */ static getBlockedSegments(segments?: Array): Array; /** * Get chapters related to the main chapter. * * @param {string} chapterUrn The URN of the main chapter. * @param {Array.} [chapters=[]] * * @returns {Array.} */ static getChapters(chapterUrn: string, chapters?: Array): Array; /** * Get intervals. * * @param {Array} [segments=[]] * * @returns {Array} */ static getIntervals(intervals?: any[]): Array; /** * Get mediaComposition from an URN. * * @param {String} urn * @param {Function} requestHandler * * @returns {Promise} */ static getMediaComposition(urn: string, handleRequest?: Promise): Promise; /** * Get the mediaData most likely to be compatible depending on the browser. * * @param {Array.} resources * * @returns {MainResourceWithKeySystems} By default, the first entry is used if none is compatible. */ static getMediaData(resources?: Array): MainResourceWithKeySystems; /** * Get the source media object. * * @param {Player} player * @param {any} srcObj * * @returns {Promise} - The composed source media data. */ static getSrcMediaObj(player: Player, srcObj: any): Promise; /** * Handles the middleware's currentTime function. * - If the current time is between the start and end of a blocked segment, * the blocked portion will be skipped. * * _Note_: This function should disappear as soon as this behavior is * supported on the packaging side. * * @param {Player} player * @param {number} currentTime * * @returns {number} */ static handleCurrentTime(player: Player, currentTime: number): number; /** * Handles the middleware's setCurrentTime function. * - Modify the current time if the value is between the start and end of a * blocked segment. * * _Note_: This function should disappear as soon as this behavior is * supported on the packaging side. * * @param {Player} player * @param {number} currentTime * * @returns {number} */ static handleSetCurrentTime(player: Player, currentTime: number): number; /** * Handles the middleware's setSource function. * * This function allows to: * - resolve a URN into media that can be played by the player * - initialize media playback tracking * - update the title bar * - handle blocking reasons * - add remote subtitles * * @param {Player} player * @param {any} srcObj * @param {function} next * * @returns {Promise} */ static handleSetSource(player: Player, srcObj: any, next: Function): Promise; /** * SRG SSR analytics singleton. * * @param {Player} player */ static srgAnalytics(player: Player): void; /** * PillarboxMonitoring monitoring singleton. * * @param {Player} player * * @returns {PillarboxMonitoring} instance of PillarboxMonitoring */ static pillarboxMonitoring(player: Player): PillarboxMonitoring; /** * Update player's poster. * * @param {Player} player * @param {ComposedSrcMediaData} srcMediaObj * @param {Image} imageService */ static updatePoster(player: Player, srcMediaObj: ComposedSrcMediaData, imageService?: Image): void; /** * Update player titleBar with title and description. * * @param {Player} player * @param {ComposedSrcMediaData} srcMediaObj */ static updateTitleBar(player: Player, srcMediaObj: ComposedSrcMediaData): void; /** * Middleware to resolve SRG SSR URNs into playable media. * * @param {Player} player * * @returns {Object} */ static middleware(player: Player): any; } import type Player from 'video.js/dist/types/player'; import type { Segment } from '../dataProvider/model/typedef'; import type { Subtitle } from '../dataProvider/model/typedef'; import type { Chapter } from '../dataProvider/model/typedef'; import type { TimeInterval } from '../dataProvider/model/typedef'; import type { ComposedSrcMediaData } from './typedef'; import type { MainResourceWithKeySystems } from './typedef'; import type { MainResource } from '../dataProvider/model/typedef'; import MediaComposition from '../dataProvider/model/MediaComposition.js'; import DataProvider from '../dataProvider/services/DataProvider.js'; import PillarboxMonitoring from '../trackers/PillarboxMonitoring.js'; import Image from '../utils/Image.js'; //# sourceMappingURL=srgssr.d.ts.map