@vindral/web-sdk 2.0.11 → 2.0.15
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 +13 -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
|
@@ -7,6 +7,7 @@ interface BaseCodedSample {
|
|
|
7
7
|
timescale: number;
|
|
8
8
|
duration: number;
|
|
9
9
|
data: ArrayBuffer;
|
|
10
|
+
compositionTimeOffset?: number;
|
|
10
11
|
}
|
|
11
12
|
interface CodedAudioSample extends BaseCodedSample {
|
|
12
13
|
type: "audio";
|
|
@@ -179,6 +180,7 @@ export interface PlaybackSource {
|
|
|
179
180
|
muted: boolean;
|
|
180
181
|
currentTime: number;
|
|
181
182
|
playbackRate?: number;
|
|
183
|
+
isActivated: boolean;
|
|
182
184
|
readonly seekTime: number;
|
|
183
185
|
readonly isSeeking: boolean;
|
|
184
186
|
play(initiator: PlayInitiator): Promise<void>;
|
|
@@ -204,6 +206,7 @@ declare class MediaElement extends Emitter<MediaElementEvents> {
|
|
|
204
206
|
private seekStartTime?;
|
|
205
207
|
private _userProvidedMuted;
|
|
206
208
|
private _userHasProvidedInput;
|
|
209
|
+
isActivated: boolean;
|
|
207
210
|
constructor({ type, autoplay, muted, logger }: MediaElementOptions);
|
|
208
211
|
attach: (container: HTMLElement) => void;
|
|
209
212
|
get seekTime(): number;
|
|
@@ -359,6 +362,7 @@ declare class AudioPlayerModule {
|
|
|
359
362
|
private clockDelta?;
|
|
360
363
|
private startTimeIsInvalidated;
|
|
361
364
|
private lastSampleTimestamp;
|
|
365
|
+
isActivated: boolean;
|
|
362
366
|
get volume(): number;
|
|
363
367
|
set volume(volume: number);
|
|
364
368
|
get seekTime(): number;
|
|
@@ -477,6 +481,7 @@ declare class ConnectionModule {
|
|
|
477
481
|
private onTransportChange;
|
|
478
482
|
disconnect: (reason?: string) => void;
|
|
479
483
|
reconnect: (reason: string) => void;
|
|
484
|
+
private cleanupOnDisconnect;
|
|
480
485
|
private sendPing;
|
|
481
486
|
}
|
|
482
487
|
interface Size {
|
|
@@ -724,7 +729,6 @@ declare class DocumentStateModule implements DocumentState {
|
|
|
724
729
|
private onOffline;
|
|
725
730
|
private onPageHide;
|
|
726
731
|
private onVisibilityChanged;
|
|
727
|
-
private onFocusChange;
|
|
728
732
|
private setIsActive;
|
|
729
733
|
}
|
|
730
734
|
interface IncomingDataModuleListeners {
|
|
@@ -773,19 +777,23 @@ declare class LoggerModule {
|
|
|
773
777
|
interface MetadataModuleEvents {
|
|
774
778
|
["metadata"]: Readonly<Metadata>;
|
|
775
779
|
}
|
|
776
|
-
interface
|
|
777
|
-
|
|
780
|
+
interface TimeSource {
|
|
781
|
+
readonly drift: number | undefined;
|
|
782
|
+
readonly serverCurrentTime: number;
|
|
778
783
|
}
|
|
779
784
|
declare class MetadataModule {
|
|
780
785
|
private static METADATA_TIMEOUT;
|
|
786
|
+
private static METADATA_CHECK_INTERVAL;
|
|
781
787
|
private logger;
|
|
782
788
|
private emitter;
|
|
783
789
|
private waitingMetadata;
|
|
784
790
|
private isTriggered;
|
|
785
|
-
|
|
791
|
+
private timeSource;
|
|
792
|
+
private timers;
|
|
793
|
+
constructor(emitter: Emitter<unknown, MetadataModuleEvents>, logger: Logger, timeSource: TimeSource);
|
|
786
794
|
load: () => void;
|
|
787
795
|
unload: () => void;
|
|
788
|
-
static create: (emitter: Emitter<
|
|
796
|
+
static create: (emitter: Emitter<unknown, MetadataModuleEvents>, logger: Logger, timeSource: TimeSource) => MetadataModule;
|
|
789
797
|
addMetadata: (metadata: Metadata) => void;
|
|
790
798
|
private onBufferedStateChanged;
|
|
791
799
|
}
|
package/package.json
CHANGED