@tivio/sdk-js 2.1.0-alpha → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -25,4 +25,5 @@ export declare const fetchBundleViaResolver: (conf: InternalConf) => Promise<str
25
25
  * Fetch & load CommonJS remote module.
26
26
  */
27
27
  export declare const createRemotePackageLoader: () => (conf: InternalConf) => Promise<TivioBundle>;
28
+ export declare let tivioBundle: RemoteBundleState | null;
28
29
  export declare const createTivio: () => (conf: Conf) => Promise<RemoteBundleState>;
@@ -0,0 +1,6 @@
1
+ declare type Result = Promise<{
2
+ startTimestamp?: number;
3
+ endTimestamp?: number;
4
+ } | null>;
5
+ export declare const getProgramTimestamps: (channelName: string, epgFrom: Date, epgTo: Date) => Result;
6
+ export {};
@@ -1,5 +1,5 @@
1
- import { AdMetadata, PlayerInterfaceForPlayerWrapper, PlayerWrapperEventType, Source, TivioPlayerWrapper } from '../api.types';
2
1
  import { InternalPlayerWrapper } from './playerWrapperInternal';
2
+ import type { ListenerAdMetadata, ListenerMarkers, PlayerInterfaceForPlayerWrapper, Source, TivioPlayerWrapper } from '../api.types';
3
3
  import type { CreatePlayerWrapperType } from './playerWrapperInternal';
4
4
  /**
5
5
  * Player wrapper which instances are exposed to SDK user.
@@ -7,23 +7,22 @@ import type { CreatePlayerWrapperType } from './playerWrapperInternal';
7
7
  export declare class PlayerWrapper implements TivioPlayerWrapper {
8
8
  private internalPlayerWrapper;
9
9
  constructor(internalPlayerWrapper: InternalPlayerWrapper);
10
- addEventListener(eventType: PlayerWrapperEventType.adMetadata, listener: (metadata: AdMetadata) => void): void;
10
+ addEventListener(eventType: 'adMetadata', listener: ListenerAdMetadata): void;
11
+ addEventListener(eventType: 'markers', listener: ListenerMarkers): void;
11
12
  reportError(error: Error): void;
12
13
  reportPlaybackEnded(): void;
13
14
  reportTimeProgress(ms: number): void;
14
15
  seekTo(ms: number): void;
15
- setSource(source: Source | null): void;
16
+ setSource(source: Source | null, calibrationId?: string): void;
16
17
  }
17
18
  /**
18
19
  * Called when tivio is initialized (remote bundle is ready).
19
20
  *
20
- * @param {CreatePlayerWrapperType} createPlayerWrapper - functions which creates player wrapper in core-js
21
+ * @param {CreatePlayerWrapperType} createPlayerWrapperFromCoreJs - functions which creates player wrapper in core-js
21
22
  */
22
- export declare const onCreatePlayerWrapperReady: (createPlayerWrapper: CreatePlayerWrapperType) => void;
23
+ export declare const onCreatePlayerWrapperReady: (createPlayerWrapperFromCoreJs: CreatePlayerWrapperType) => void;
23
24
  /**
24
- * Public method accessible in SDK.
25
- *
26
- * @param {PlayerInterfaceForPlayerWrapper} playerImplementation - player implementation from SDK user
25
+ * @param {PlayerInterfaceForPlayerWrapper} playerImplementation - player implementation
27
26
  * @returns player wrapper instance
28
27
  */
29
28
  export declare const createPlayerWrapper: (playerImplementation: PlayerInterfaceForPlayerWrapper) => PlayerWrapper;
@@ -1,4 +1,4 @@
1
- import { AdMetadata, PlayerInterfaceForPlayerWrapper, PlayerWrapperEventType, Source, TivioPlayerWrapper } from '../api.types';
1
+ import type { Listener, PlayerInterfaceForPlayerWrapper, PlayerWrapperEventTypeType, Source, TivioPlayerWrapper } from '../api.types';
2
2
  export declare type CreatePlayerWrapperType = (playerImplementation: PlayerInterfaceForPlayerWrapper) => TivioPlayerWrapper;
3
3
  /**
4
4
  * Responsible for handling of all player wrapper methods (it's called through PlayerWrapper).
@@ -9,16 +9,16 @@ export declare class InternalPlayerWrapper implements TivioPlayerWrapper {
9
9
  private id;
10
10
  corePlayerWrapperInstance: TivioPlayerWrapper | null;
11
11
  listenersWaitingToRegister: {
12
- eventType: PlayerWrapperEventType.adMetadata;
13
- listener: (metadata: AdMetadata) => void;
12
+ eventType: PlayerWrapperEventTypeType;
13
+ listener: Listener;
14
14
  }[];
15
15
  constructor(playerImplementation: PlayerInterfaceForPlayerWrapper, id: string);
16
- addEventListener(eventType: PlayerWrapperEventType.adMetadata, listener: (metadata: AdMetadata) => void): void;
16
+ addEventListener(eventType: PlayerWrapperEventTypeType, listener: Listener): void;
17
17
  reportError(error: Error): void;
18
18
  reportPlaybackEnded(): void;
19
19
  reportTimeProgress(ms: number): void;
20
20
  seekTo(ms: number): void;
21
- setSource(source: Source | null): void;
21
+ setSource(source: Source | null, calibrationId?: string): void;
22
22
  /**
23
23
  * Set instance of the real player wrapper (from core-js).
24
24
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tivio/sdk-js",
3
- "version": "2.1.0-alpha",
3
+ "version": "2.3.0",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
6
6
  "source": "src/index.ts",