@vindral/web-sdk 2.0.10 → 2.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/index.d.ts +12 -5
- package/package.json +1 -1
- package/web-sdk.esm.js +1 -1
- package/web-sdk.umd.js +1 -1
package/README.md
CHANGED
|
@@ -60,10 +60,10 @@ This example attaches a player to an element with the id `#root`. The player wil
|
|
|
60
60
|
|
|
61
61
|
The example assumes that there is a html page that loads this script that has at least a div with `id="#root"`.
|
|
62
62
|
|
|
63
|
-
```
|
|
63
|
+
```javascript
|
|
64
64
|
import { Player } from "@vindral/web-sdk"
|
|
65
65
|
|
|
66
|
-
const root = document.querySelector
|
|
66
|
+
const root = document.querySelector("#root")
|
|
67
67
|
|
|
68
68
|
const player = new Player({
|
|
69
69
|
url: "https://lb.cdn.vindral.com",
|
|
@@ -85,12 +85,12 @@ The Core SDK is the lowest level method to integrate that provides only a video
|
|
|
85
85
|
|
|
86
86
|
The example assumes that there is a html page that loads this script that has at least a div with `id="#root"`, `id="#playback-state"` and a button with `id="#activate-audio-button"`.
|
|
87
87
|
|
|
88
|
-
```
|
|
88
|
+
```javascript
|
|
89
89
|
import { Vindral } from "@vindral/web-sdk"
|
|
90
90
|
|
|
91
|
-
const root = document.querySelector
|
|
92
|
-
const button = document.querySelector
|
|
93
|
-
const playbackState = document.querySelector
|
|
91
|
+
const root = document.querySelector("#root")!
|
|
92
|
+
const button = document.querySelector("#activate-audio-button")!
|
|
93
|
+
const playbackState = document.querySelector("#playback-state")!
|
|
94
94
|
|
|
95
95
|
button.style.display = "none"
|
|
96
96
|
|
package/index.d.ts
CHANGED
|
@@ -179,6 +179,7 @@ export interface PlaybackSource {
|
|
|
179
179
|
muted: boolean;
|
|
180
180
|
currentTime: number;
|
|
181
181
|
playbackRate?: number;
|
|
182
|
+
isActivated: boolean;
|
|
182
183
|
readonly seekTime: number;
|
|
183
184
|
readonly isSeeking: boolean;
|
|
184
185
|
play(initiator: PlayInitiator): Promise<void>;
|
|
@@ -204,6 +205,7 @@ declare class MediaElement extends Emitter<MediaElementEvents> {
|
|
|
204
205
|
private seekStartTime?;
|
|
205
206
|
private _userProvidedMuted;
|
|
206
207
|
private _userHasProvidedInput;
|
|
208
|
+
isActivated: boolean;
|
|
207
209
|
constructor({ type, autoplay, muted, logger }: MediaElementOptions);
|
|
208
210
|
attach: (container: HTMLElement) => void;
|
|
209
211
|
get seekTime(): number;
|
|
@@ -359,6 +361,7 @@ declare class AudioPlayerModule {
|
|
|
359
361
|
private clockDelta?;
|
|
360
362
|
private startTimeIsInvalidated;
|
|
361
363
|
private lastSampleTimestamp;
|
|
364
|
+
isActivated: boolean;
|
|
362
365
|
get volume(): number;
|
|
363
366
|
set volume(volume: number);
|
|
364
367
|
get seekTime(): number;
|
|
@@ -477,6 +480,7 @@ declare class ConnectionModule {
|
|
|
477
480
|
private onTransportChange;
|
|
478
481
|
disconnect: (reason?: string) => void;
|
|
479
482
|
reconnect: (reason: string) => void;
|
|
483
|
+
private cleanupOnDisconnect;
|
|
480
484
|
private sendPing;
|
|
481
485
|
}
|
|
482
486
|
interface Size {
|
|
@@ -724,7 +728,6 @@ declare class DocumentStateModule implements DocumentState {
|
|
|
724
728
|
private onOffline;
|
|
725
729
|
private onPageHide;
|
|
726
730
|
private onVisibilityChanged;
|
|
727
|
-
private onFocusChange;
|
|
728
731
|
private setIsActive;
|
|
729
732
|
}
|
|
730
733
|
interface IncomingDataModuleListeners {
|
|
@@ -773,19 +776,23 @@ declare class LoggerModule {
|
|
|
773
776
|
interface MetadataModuleEvents {
|
|
774
777
|
["metadata"]: Readonly<Metadata>;
|
|
775
778
|
}
|
|
776
|
-
interface
|
|
777
|
-
|
|
779
|
+
interface TimeSource {
|
|
780
|
+
readonly drift: number | undefined;
|
|
781
|
+
readonly serverCurrentTime: number;
|
|
778
782
|
}
|
|
779
783
|
declare class MetadataModule {
|
|
780
784
|
private static METADATA_TIMEOUT;
|
|
785
|
+
private static METADATA_CHECK_INTERVAL;
|
|
781
786
|
private logger;
|
|
782
787
|
private emitter;
|
|
783
788
|
private waitingMetadata;
|
|
784
789
|
private isTriggered;
|
|
785
|
-
|
|
790
|
+
private timeSource;
|
|
791
|
+
private timers;
|
|
792
|
+
constructor(emitter: Emitter<unknown, MetadataModuleEvents>, logger: Logger, timeSource: TimeSource);
|
|
786
793
|
load: () => void;
|
|
787
794
|
unload: () => void;
|
|
788
|
-
static create: (emitter: Emitter<
|
|
795
|
+
static create: (emitter: Emitter<unknown, MetadataModuleEvents>, logger: Logger, timeSource: TimeSource) => MetadataModule;
|
|
789
796
|
addMetadata: (metadata: Metadata) => void;
|
|
790
797
|
private onBufferedStateChanged;
|
|
791
798
|
}
|
package/package.json
CHANGED