stormcloud-video-player 0.1.4 → 0.1.5
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 +32 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -70,6 +70,7 @@ function MyApp() {
|
|
|
70
70
|
muted={true}
|
|
71
71
|
allowNativeHls={false}
|
|
72
72
|
controls={true}
|
|
73
|
+
licenseKey="your_license_key_here"
|
|
73
74
|
style={{ width: "640px", height: "360px" }}
|
|
74
75
|
adSchedule={{
|
|
75
76
|
lateJoinPolicy: "play_remaining",
|
|
@@ -112,6 +113,7 @@ function MyApp() {
|
|
|
112
113
|
autoplay: true,
|
|
113
114
|
muted: true,
|
|
114
115
|
allowNativeHls: false,
|
|
116
|
+
licenseKey: "your_license_key_here", // Optional
|
|
115
117
|
// Optional external ad schedule
|
|
116
118
|
adSchedule: {
|
|
117
119
|
lateJoinPolicy: "play_remaining",
|
|
@@ -166,11 +168,41 @@ interface StormcloudVideoPlayerConfig {
|
|
|
166
168
|
allowNativeHls?: boolean;
|
|
167
169
|
adSchedule?: AdSchedule;
|
|
168
170
|
defaultVastTagUrl?: string;
|
|
171
|
+
licenseKey?: string;
|
|
169
172
|
}
|
|
170
173
|
```
|
|
171
174
|
|
|
172
175
|
---
|
|
173
176
|
|
|
177
|
+
## License Key Authentication
|
|
178
|
+
|
|
179
|
+
The player supports license key authentication for API calls. When a `licenseKey` is provided, it will be included as a `Bearer` token in the `Authorization` header for all API requests to:
|
|
180
|
+
|
|
181
|
+
- Ad configuration endpoint: `https://adstorm.co/api-adstorm-dev/adstorm/ads/web`
|
|
182
|
+
- Initial tracking: `https://adstorm.co/api-adstorm-dev/adstorm/player-tracking/track`
|
|
183
|
+
- Heartbeat tracking: `https://adstorm.co/api-adstorm-dev/adstorm/player-tracking/heartbeat`
|
|
184
|
+
|
|
185
|
+
### Usage
|
|
186
|
+
|
|
187
|
+
```javascript
|
|
188
|
+
// Vanilla JavaScript
|
|
189
|
+
const player = new StormcloudVideoPlayer({
|
|
190
|
+
videoElement: video,
|
|
191
|
+
src: "https://example.com/stream.m3u8",
|
|
192
|
+
licenseKey: "your_license_key_here" // Optional
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
// React Component
|
|
196
|
+
<StormcloudVideoPlayerComponent
|
|
197
|
+
src="https://example.com/stream.m3u8"
|
|
198
|
+
licenseKey="your_license_key_here" // Optional
|
|
199
|
+
/>
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
The license key is optional and the player will work without it, but some API features may be limited or unavailable.
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
174
206
|
## How ad alignment works
|
|
175
207
|
|
|
176
208
|
- On `CUE-OUT`/`DATERANGE` start: request IMA ads and start playback immediately; if duration is known, a countdown is scheduled to auto-stop if `CUE-IN` is missing.
|