@vindral/web-sdk 2.0.12 → 2.0.13
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 +10 -2
- 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 {
|
|
@@ -776,16 +780,20 @@ interface MetadataModuleEvents {
|
|
|
776
780
|
interface MetadataModuleListeners {
|
|
777
781
|
["buffer state"]: Readonly<BufferState>;
|
|
778
782
|
}
|
|
783
|
+
interface DriftSource {
|
|
784
|
+
readonly drift: number | undefined;
|
|
785
|
+
}
|
|
779
786
|
declare class MetadataModule {
|
|
780
787
|
private static METADATA_TIMEOUT;
|
|
781
788
|
private logger;
|
|
782
789
|
private emitter;
|
|
783
790
|
private waitingMetadata;
|
|
784
791
|
private isTriggered;
|
|
785
|
-
|
|
792
|
+
private driftSource;
|
|
793
|
+
constructor(emitter: Emitter<MetadataModuleListeners, MetadataModuleEvents>, logger: Logger, driftSource: DriftSource);
|
|
786
794
|
load: () => void;
|
|
787
795
|
unload: () => void;
|
|
788
|
-
static create: (emitter: Emitter<MetadataModuleListeners, MetadataModuleEvents>, logger: Logger) => MetadataModule;
|
|
796
|
+
static create: (emitter: Emitter<MetadataModuleListeners, MetadataModuleEvents>, logger: Logger, driftSource: DriftSource) => MetadataModule;
|
|
789
797
|
addMetadata: (metadata: Metadata) => void;
|
|
790
798
|
private onBufferedStateChanged;
|
|
791
799
|
}
|
package/package.json
CHANGED