@tivio/sdk-js 2.0.0-alpha → 2.1.0-alpha

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -12,13 +12,23 @@ yarn add @tivio/sdk-js
12
12
 
13
13
  # Changelog
14
14
 
15
- * 2.0.0-alpha
16
- * requires core-js at least 1.12.0
17
- * force using cloud fn instead of resolver
18
- * major: rename positionMs to startFromPosition
19
- * minor: add continueFromPosition and streamStart to TvProgramSource
20
- * minor: add continueFromPosition to TivioVodSource, OtherSource and LiveTvChannelSource
21
- * minor: live_tv_channel source type does pass-through instead of stopping the setSource action
15
+ * 2.1.0-alpha
16
+ * minor: better es5 polyfills
17
+ * patch: add `verbose` to Tivio config type
18
+ * patch: add `bundleUrlOverride` to Tivio config type
19
+ * 2.0.0
20
+ * requires core-js at least 1.13.0
21
+ * major: remove `createPlayerWrapper` from Tivio API object
22
+ * major: rename `positionMs` to `startFromPosition`
23
+ * minor: add `createPlayerWrapper` to the root of the @tivio-sdk-js package, it's not necessary to wait until
24
+ `createTivio` is finished before using it but it is still necessary to call `createTivio` at some point
25
+ * minor: add (optional) `capabilitiesOptions` and `deviceCapabilities` options to Tivio config
26
+ * minor: add fetch polyfill
27
+ * minor: better source types documentation
28
+ * minor: add `streamStart` to `TvProgramSource`
29
+ * minor: add `continueFromPosition` to `TvProgramSource`, `TivioVodSource`, `OtherSource` and `LiveTvChannelSource`
30
+ * minor: `live_tv_channel` source type does pass-through instead of stopping the `setSource` action
31
+ * minor: add `forceCloudFnResolver` option to Tivio config
22
32
  * 1.1.0
23
33
  * minor: fallback to fetch bundle by cloud fn when indexedDB not supported
24
34
  * minor: transpile to es5
@@ -137,14 +137,22 @@ declare type AdMetadata = {
137
137
  declare enum PlayerWrapperEventType {
138
138
  adMetadata = "adMetadata"
139
139
  }
140
- declare type TivioPlayerWrapper = {
140
+ interface TivioPlayerWrapper {
141
141
  addEventListener: (eventType: PlayerWrapperEventType.adMetadata, listener: (metadata: AdMetadata) => void) => void;
142
142
  reportError: (error: Error) => void;
143
143
  reportPlaybackEnded: () => void;
144
144
  reportTimeProgress: (ms: number) => void;
145
145
  seekTo: (ms: number) => void;
146
146
  setSource: (source: Source | null) => void;
147
- };
147
+ }
148
+ interface PlayerInterfaceForPlayerWrapper {
149
+ /**
150
+ * @param {number} ms - milliseconds relative to start of video (relative to 0 ms)
151
+ * or in case of TV programs relative to start of the program (relative to source.from ms)
152
+ */
153
+ seekTo: (ms: number) => void;
154
+ setSource: (source: Source | null) => void;
155
+ }
148
156
  declare type ExposedApi = {
149
157
  AdSource: any;
150
158
  ChannelSource: any;
@@ -269,9 +277,6 @@ declare type ExposedApi = {
269
277
  * @param password
270
278
  */
271
279
  signInWithEmailAndPassword: (email: string, password: string) => Promise<void>;
272
- createPlayerWrapper: (playerImplementation: {
273
- setSource: (source: Source | null) => void;
274
- seekTo: (ms: number) => void;
275
- }) => TivioPlayerWrapper;
280
+ createPlayerWrapper: (playerImplementation: PlayerInterfaceForPlayerWrapper) => TivioPlayerWrapper;
276
281
  };
277
- export { AdMetadata, AdSource, ExposedApi, LiveTvChannelSource, OtherSource, PlayerWrapperEventType, Source, TivioPlayerWrapper, TivioVodSource, TvProgramSource, };
282
+ export { AdMetadata, AdSource, ExposedApi, LiveTvChannelSource, OtherSource, PlayerInterfaceForPlayerWrapper, PlayerWrapperEventType, Source, TivioPlayerWrapper, TivioVodSource, TvProgramSource, };
package/dist/conf.d.ts CHANGED
@@ -5,13 +5,52 @@
5
5
  import { Logger } from './services/logger';
6
6
  import { FetchPackage } from './services/packageLoader';
7
7
  import { Conf as ExternalConf } from './types';
8
+ export interface PlayerCapability {
9
+ codec: 'h264' | 'h265';
10
+ encryption: 'fairplay' | 'none' | 'playready' | 'widevine';
11
+ protocol: 'dash' | 'hls';
12
+ }
8
13
  export declare type InternalConf = {
14
+ /**
15
+ * @private URL of remote code bundle to be fetched directly (without using resolver)
16
+ */
17
+ bundleUrlOverride?: string;
18
+ /**
19
+ * Tells Tivio which technologies/protocols etc. is the device capable to play.
20
+ * If not provided, Tivio will try to guess it (based on the browser).
21
+ */
22
+ deviceCapabilities?: PlayerCapability[];
23
+ /**
24
+ * Additional options for deviceCapabilities
25
+ */
26
+ capabilitiesOptions?: {
27
+ /**
28
+ * Should the player prefer HTTP sources instead HTTPs if they are available.
29
+ * This can be used on platforms that support mixed content but do not support
30
+ * specific HTTPS certificates. (e.g. certificates from Letsencrypt not supported on LG TVs)
31
+ */
32
+ preferHttp?: boolean;
33
+ };
9
34
  secret: string;
10
35
  resolverUrl: string;
11
36
  logger?: Logger | null;
12
37
  fetchPackage: FetchPackage;
13
38
  language?: string;
14
39
  sdkVersion: string;
40
+ /**
41
+ * Can force using bundle resolver method which doesn't depend on indexedDB (useful when some polyfill
42
+ * for indexedDB is used but indexedDB is not fully supported - it leads to situation where check for indexedDB
43
+ * presence passes but resolver fails anyway).
44
+ */
45
+ forceCloudFnResolver?: boolean;
46
+ /**
47
+ * Can turn off Tivio's Sentry logging, defaults to true.
48
+ */
49
+ enableSentry?: boolean;
50
+ /**
51
+ * Can turn on Tivio's console logging, defaults to false.
52
+ */
53
+ verbose?: boolean;
15
54
  };
16
55
  export declare const defaultConf: {
17
56
  resolverUrl: string;
package/dist/index.d.ts CHANGED
@@ -1,3 +1,6 @@
1
+ import 'whatwg-fetch';
2
+ import 'core-js/actual';
1
3
  export * from './services/bundleLoader';
2
4
  export * from './types';
3
5
  export * from './api.types';
6
+ export { createPlayerWrapper } from './services/playerWrapper';