///
import { ChromecastDevice } from "stratocaster";
import { BaseApp } from "../base";
import { PlaybackTracker } from "../playback-tracker";
import { IMediaMetadata, SenderCapabilities } from "./model";
export interface IBabblerOpts {
appId: string;
capabilities: SenderCapabilities;
useLicenseIpc: boolean;
/**
* options to pass to constructor for use in Daemon. If passed,
* `loadUrl` will be called in a Daemon, and submitPositionUpdate
* will be called periodically
*/
daemonOptions?: any;
}
export interface IQueueItem {
id: string;
licenseUrl?: string;
media?: TMedia;
metadata: IMediaMetadata;
currentTime?: number;
}
export interface IPlayableInfo {
contentId: string;
contentUrl: string;
customData?: {
license?: {
ipc?: boolean;
url?: string;
};
};
metadata?: IMediaMetadata;
}
/**
* Base class for apps that use Babbler for playback
*/
export declare class BabblerBaseApp extends BaseApp {
private babblerOpts;
protected tracker: PlaybackTracker | undefined;
private currentMedia;
constructor(device: ChromecastDevice, babblerOpts: IBabblerOpts);
start(): Promise;
protected loadMedia(item: IQueueItem): Promise;
/**
* Called if we're running in daemon mode and the media
* has been paused, or the player stopped
*/
protected onFetchQueue(mode: "before" | "after", itemContentId: string): Promise;
/**
* Called if we're running in daemon mode and the media
* has been paused, or the player stopped
*/
protected onPlayerPaused(currentTimeSeconds: number, media: TMedia | undefined): Promise;
protected loadInfoFor(contentId: string): Promise;
protected performLicenseRequest(buffer: Buffer, url: string | undefined): Promise;
protected loadQueueBefore(contentId: string, media?: TMedia): Promise>>;
protected loadQueueAfter(contentId: string, media?: TMedia): Promise>>;
private handleInfoRequest;
private handleLicenseRequest;
private handleQueueRequest;
private createCustomData;
}