@brandbrigade/ott-bb-player 1.0.69 → 1.1.1
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 +126 -270
- package/dist/OTTPlayer.js +13 -13
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -1,358 +1,214 @@
|
|
|
1
1
|
# OTT-BB-Player
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
## Table of Contents
|
|
6
|
-
|
|
7
|
-
- [Overview](#Overview)
|
|
8
|
-
- [Installation](#installation)
|
|
9
|
-
- [HowTo](#HowTo)
|
|
10
|
-
- [Example](#example)
|
|
11
|
-
- [Changelog](#changelog)
|
|
12
|
-
|
|
13
|
-
## Overview
|
|
14
|
-
|
|
15
|
-
The SDK allows to augment targeted ads on top of DRM1 stream, providing that the same content is/was augmetned by BrandBrigade and the augmentation metadata is stored in the BrandBrigade cloud Smart-Feed, and providing that the stream contains embeded timecodes that match in a frame-accurate manner the timecode embedded in the smart feed.
|
|
3
|
+
BrandBrigade OTT Player SDK for targeted ad augmentation on live streams.
|
|
16
4
|
|
|
17
5
|
## Installation
|
|
18
6
|
|
|
19
|
-
To install My Project, follow these steps:
|
|
20
|
-
|
|
21
|
-
1. Login into npmjs repo if you are not logged in
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
npm login
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
2. Use npm to install the package
|
|
28
|
-
|
|
29
7
|
```bash
|
|
30
|
-
npm install @brandbrigade/ott-bb-player
|
|
8
|
+
npm install @brandbrigade/ott-bb-player
|
|
31
9
|
```
|
|
32
10
|
|
|
33
|
-
##
|
|
11
|
+
## Usage
|
|
34
12
|
|
|
35
13
|
### Initialization
|
|
36
14
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
4. A channel name: The programmatic emulation channel to demonstrate the targeted ad
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
bbPlayer = new BB.OTTPlayer(
|
|
50
|
-
video, //Video Tag
|
|
51
|
-
30000/1001, // frame rate
|
|
52
|
-
{ gameId:<game id>,//game id
|
|
53
|
-
augmentation:{“channelName”:”nba”}});//channel name
|
|
15
|
+
```javascript
|
|
16
|
+
const bbPlayer = new BB.OTTPlayer(
|
|
17
|
+
videoElement,
|
|
18
|
+
frameRate, // e.g., 30000/1001 for 29.97 fps
|
|
19
|
+
{
|
|
20
|
+
gameId: 'game_identifier',
|
|
21
|
+
augmentation: { channelName: 'channel_name' }
|
|
22
|
+
}
|
|
23
|
+
);
|
|
54
24
|
```
|
|
55
25
|
|
|
56
|
-
##
|
|
26
|
+
## API Reference
|
|
57
27
|
|
|
58
|
-
|
|
59
|
-
A test page hosted on the BB server can be accessed [here](http://bb-ott-player.s3-website-us-east-1.amazonaws.com/demo/node_modules/@brandbrigade/ott-bb-player/sample.html)
|
|
28
|
+
### Event Integration
|
|
60
29
|
|
|
61
|
-
|
|
30
|
+
#### `onNewMetadata(event)`
|
|
31
|
+
Forward MediaKind metadata events containing timecode information.
|
|
62
32
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
var config = {
|
|
70
|
-
"url":"https://injecto-streams.s3-accelerate.amazonaws.com/hls_fileTest_tmp/index_test.m3u8",
|
|
71
|
-
"gameId":"“arena_nba_BB_test_Lakers_long”,
|
|
72
|
-
"channel":"nba"
|
|
73
|
-
};
|
|
33
|
+
```javascript
|
|
34
|
+
wmcMgr.addEventListener(wmcEvents.AMC_EVENT_PLAYER_METADATA, (event) => {
|
|
35
|
+
bbPlayer.onNewMetadata(event);
|
|
36
|
+
});
|
|
74
37
|
```
|
|
75
38
|
|
|
76
|
-
|
|
39
|
+
#### `onNewSegment(event)`
|
|
40
|
+
Forward MediaKind segment playback events for synchronization.
|
|
77
41
|
|
|
42
|
+
```javascript
|
|
43
|
+
wmcMgr.addEventListener(wmcEvents.AMC_EVENT_PLAYER_SEGMENT_PLAYBACK, (event) => {
|
|
44
|
+
bbPlayer.onNewSegment(event);
|
|
45
|
+
});
|
|
78
46
|
```
|
|
79
|
-
function onNewMetadata(eventObj) {
|
|
80
|
-
bbPlayer.onNewMetadata(eventObj)
|
|
81
|
-
};
|
|
82
|
-
function onNewSegment(eventObj) {
|
|
83
|
-
bbPlayer.onNewSegment(eventObj);
|
|
84
|
-
};
|
|
85
|
-
wmcMgr.addEventListener(wmcEvents.AMC_EVENT_PLAYER_METADATA, onNewMetadata);
|
|
86
|
-
wmcMgr.addEventListener(wmcEvents.AMC_EVENT_PLAYER_SEGMENT_PLAYBACK, onNewSegment);
|
|
87
|
-
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### Control
|
|
91
47
|
|
|
92
|
-
|
|
48
|
+
#### `onAdEvent(eventType)`
|
|
49
|
+
Notify player of ad events to pause/resume augmentation.
|
|
93
50
|
|
|
51
|
+
```javascript
|
|
52
|
+
bbPlayer.onAdEvent('start'); // Pause augmentation during ad
|
|
53
|
+
bbPlayer.onAdEvent('end'); // Resume augmentation after ad
|
|
94
54
|
```
|
|
95
|
-
bbPlayer.Toggle({true|false});
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
## Changelog
|
|
99
|
-
|
|
100
|
-
### Version 1.0.0
|
|
101
|
-
|
|
102
|
-
Initial version
|
|
103
|
-
|
|
104
|
-
### Version 1.0.1
|
|
105
|
-
|
|
106
|
-
Initial version
|
|
107
|
-
|
|
108
|
-
### Version 1.0.2
|
|
109
|
-
|
|
110
|
-
Initial version
|
|
111
|
-
|
|
112
|
-
### Version 1.0.3
|
|
113
|
-
|
|
114
|
-
Added readme.md
|
|
115
|
-
|
|
116
|
-
### Version 1.0.4
|
|
117
|
-
|
|
118
|
-
Added support of 59.94 streams
|
|
119
|
-
|
|
120
|
-
Added interface functions to get sync timecodes from MK MetadataEvents
|
|
121
|
-
|
|
122
|
-
### Version 1.0.5
|
|
123
|
-
|
|
124
|
-
Added support of Safari on Mac
|
|
125
|
-
|
|
126
|
-
### Version 1.0.6
|
|
127
|
-
|
|
128
|
-
Enabled support of Safari on Mac
|
|
129
|
-
|
|
130
|
-
### Version 1.0.7
|
|
131
|
-
|
|
132
|
-
Fixed Safari issue.
|
|
133
|
-
Improved Chrome rendering
|
|
134
|
-
|
|
135
|
-
### Version 1.0.8
|
|
136
|
-
|
|
137
|
-
Added usage of TimeCodesSync service
|
|
138
|
-
|
|
139
|
-
### Version 1.0.9
|
|
140
|
-
|
|
141
|
-
Bug fix
|
|
142
|
-
|
|
143
|
-
### Version 1.0.10
|
|
144
|
-
|
|
145
|
-
Bug fix
|
|
146
|
-
|
|
147
|
-
### Version 1.0.11
|
|
148
|
-
|
|
149
|
-
Bug fix
|
|
150
|
-
|
|
151
|
-
### Version 1.0.12
|
|
152
|
-
|
|
153
|
-
All is packed to one file
|
|
154
|
-
|
|
155
|
-
### Version 1.0.13
|
|
156
|
-
|
|
157
|
-
Chrome on MK REF App support
|
|
158
|
-
|
|
159
|
-
### Version 1.0.14
|
|
160
|
-
|
|
161
|
-
Safari on MK REF App support
|
|
162
55
|
|
|
163
|
-
###
|
|
56
|
+
### Control Methods
|
|
164
57
|
|
|
165
|
-
|
|
58
|
+
#### `toggle(enabled)`
|
|
59
|
+
Enable or disable augmentation rendering.
|
|
166
60
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
### Version 1.0.17
|
|
172
|
-
|
|
173
|
-
Improvements
|
|
174
|
-
|
|
175
|
-
### Version 1.0.18
|
|
176
|
-
|
|
177
|
-
Improvements
|
|
178
|
-
|
|
179
|
-
### Version v1.0.19
|
|
180
|
-
|
|
181
|
-
Chrome-Mac support
|
|
182
|
-
|
|
183
|
-
### Version v1.0.20
|
|
184
|
-
|
|
185
|
-
Improvements### Version v1.0.21
|
|
186
|
-
test26
|
|
187
|
-
|
|
188
|
-
### Version v1.0.22
|
|
189
|
-
|
|
190
|
-
test26
|
|
191
|
-
|
|
192
|
-
### Version v1.0.23
|
|
193
|
-
|
|
194
|
-
test_v_1.0.23
|
|
195
|
-
|
|
196
|
-
### Version v1.0.24
|
|
197
|
-
|
|
198
|
-
test
|
|
199
|
-
|
|
200
|
-
### Version v1.0.25
|
|
201
|
-
|
|
202
|
-
test
|
|
203
|
-
|
|
204
|
-
### Version v1.0.26
|
|
205
|
-
|
|
206
|
-
test
|
|
207
|
-
|
|
208
|
-
### Version v1.0.27
|
|
209
|
-
|
|
210
|
-
test
|
|
211
|
-
|
|
212
|
-
### Version v1.0.28
|
|
213
|
-
|
|
214
|
-
test
|
|
215
|
-
|
|
216
|
-
### Version v1.0.29
|
|
217
|
-
|
|
218
|
-
test
|
|
219
|
-
|
|
220
|
-
### Version v1.0.30
|
|
221
|
-
|
|
222
|
-
test
|
|
223
|
-
|
|
224
|
-
### Version v1.0.31
|
|
225
|
-
|
|
226
|
-
test
|
|
61
|
+
```javascript
|
|
62
|
+
bbPlayer.toggle(true); // Enable
|
|
63
|
+
bbPlayer.toggle(false); // Disable
|
|
64
|
+
```
|
|
227
65
|
|
|
228
|
-
|
|
66
|
+
#### `setMediaInfo(mediaInfo)`
|
|
67
|
+
Update media stream information (fps, bitrate).
|
|
229
68
|
|
|
230
|
-
|
|
69
|
+
```javascript
|
|
70
|
+
bbPlayer.setMediaInfo({ fps: 29.97, bitrate: 5000000 });
|
|
71
|
+
```
|
|
231
72
|
|
|
232
|
-
|
|
73
|
+
#### `setFps(fps)`
|
|
74
|
+
Update frame rate independently.
|
|
233
75
|
|
|
234
|
-
|
|
76
|
+
```javascript
|
|
77
|
+
bbPlayer.setFps(29.97);
|
|
78
|
+
```
|
|
235
79
|
|
|
236
|
-
###
|
|
80
|
+
### Asset Override Methods
|
|
237
81
|
|
|
238
|
-
|
|
82
|
+
#### `setAd(source, placeholder?)`
|
|
83
|
+
Override ad creative at runtime. Accepts URL, Blob, or ImageBitmap.
|
|
239
84
|
|
|
240
|
-
|
|
85
|
+
```javascript
|
|
86
|
+
bbPlayer.setAd('https://example.com/ad.png', 'brand_name');
|
|
87
|
+
bbPlayer.setAd(adBlob);
|
|
88
|
+
bbPlayer.setAd(imageBitmap);
|
|
89
|
+
```
|
|
241
90
|
|
|
242
|
-
|
|
91
|
+
#### `setLED(source)`
|
|
92
|
+
Override LED board creative. Accepts URL, Blob, or ImageBitmap.
|
|
243
93
|
|
|
244
|
-
|
|
94
|
+
```javascript
|
|
95
|
+
bbPlayer.setLED('https://example.com/led.png');
|
|
96
|
+
bbPlayer.setLED(ledBlob);
|
|
97
|
+
bbPlayer.setLED(imageBitmap);
|
|
98
|
+
```
|
|
245
99
|
|
|
246
|
-
|
|
100
|
+
#### `setGameParams(gameParams)`
|
|
101
|
+
Manually override game parameters (offsets, bucket info).
|
|
102
|
+
|
|
103
|
+
```javascript
|
|
104
|
+
bbPlayer.setGameParams({
|
|
105
|
+
bucketName: 'game-bucket',
|
|
106
|
+
offsets: [{ frame: 0, offset: 0, timecode: '00:00:00:00' }],
|
|
107
|
+
startZip: 'start.zip',
|
|
108
|
+
endZip: 'end.zip',
|
|
109
|
+
customerId: 'customer_id',
|
|
110
|
+
customerName: 'Customer Name'
|
|
111
|
+
});
|
|
112
|
+
```
|
|
247
113
|
|
|
248
|
-
###
|
|
114
|
+
### Event Subscription
|
|
249
115
|
|
|
250
|
-
|
|
116
|
+
#### `on(eventName, listener)`
|
|
117
|
+
Subscribe to player events.
|
|
251
118
|
|
|
252
|
-
|
|
119
|
+
```javascript
|
|
120
|
+
bbPlayer.on('augmentationStatusChanged', (event) => {
|
|
121
|
+
console.log('Status:', event.detail);
|
|
122
|
+
});
|
|
123
|
+
```
|
|
253
124
|
|
|
254
|
-
|
|
125
|
+
#### `off(eventName, listener)`
|
|
126
|
+
Unsubscribe from player events.
|
|
255
127
|
|
|
256
|
-
|
|
128
|
+
```javascript
|
|
129
|
+
bbPlayer.off('augmentationStatusChanged', listener);
|
|
130
|
+
```
|
|
257
131
|
|
|
258
|
-
|
|
132
|
+
### Lifecycle
|
|
259
133
|
|
|
260
|
-
|
|
134
|
+
#### `destroy()`
|
|
135
|
+
Cleanup and dispose of player instance. Terminates workers, removes event listeners, and frees resources.
|
|
261
136
|
|
|
262
|
-
|
|
137
|
+
```javascript
|
|
138
|
+
bbPlayer.destroy();
|
|
139
|
+
```
|
|
263
140
|
|
|
264
|
-
|
|
141
|
+
## Platform Support
|
|
265
142
|
|
|
266
|
-
|
|
143
|
+
- Chrome (Mac, Windows)
|
|
267
144
|
|
|
268
|
-
### Version v1.0.47
|
|
269
145
|
|
|
270
|
-
|
|
146
|
+
## Changelog
|
|
271
147
|
|
|
272
|
-
|
|
148
|
+
**Version v1.0.47** - OTT Web rebuild, supports Chrome Mac
|
|
273
149
|
|
|
274
|
-
Fixed augmentation size bug,
|
|
150
|
+
**Version v1.0.49** - Fixed augmentation size bug,
|
|
275
151
|
Updated configurations
|
|
276
152
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
Fixed multiple instances of OTT Player,
|
|
153
|
+
**Version v1.0.50** - Fixed multiple instances of OTT Player,
|
|
280
154
|
Applied SetInterval in Adepter,
|
|
281
155
|
Added OTTActions support
|
|
282
156
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
Adapter, Downloader and Decoder Settings added to global player options
|
|
286
|
-
|
|
287
|
-
### Version v1.0.53
|
|
157
|
+
**Version v1.0.52** - Adapter, Downloader and Decoder Settings added to global player options
|
|
288
158
|
|
|
289
|
-
More debug metrix added,
|
|
159
|
+
**Version v1.0.53** - More debug metrix added,
|
|
290
160
|
Pixel tickers color changed to dark gray
|
|
291
161
|
|
|
292
|
-
|
|
162
|
+
**Version v1.0.55** - Pattern tracking based renderer calls implemented
|
|
293
163
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
### Version v1.0.57
|
|
297
|
-
|
|
298
|
-
Added support for Windows Chrome,
|
|
164
|
+
**Version v1.0.57** - Added support for Windows Chrome,
|
|
299
165
|
Updated logging
|
|
300
166
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
Improve support for Windows Chrome
|
|
304
|
-
|
|
305
|
-
### Version v1.0.59
|
|
167
|
+
**Version v1.0.58** - Improve support for Windows Chrome
|
|
306
168
|
|
|
307
|
-
Logging to Datadog Enabled
|
|
169
|
+
**Version v1.0.59** - Logging to Datadog Enabled
|
|
308
170
|
Minor improvements
|
|
309
171
|
|
|
310
|
-
|
|
311
|
-
|
|
172
|
+
**Version v1.0.60** -
|
|
312
173
|
- Game parameters are now fetched every 10 seconds.
|
|
313
174
|
- After seeking, if new metadata with a relevant timecode is not received, the augmentation will stop.
|
|
314
175
|
- Fixed an issue where the timecode exceeds 24 hours.
|
|
315
176
|
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
WebGL Quad rendering optimization
|
|
177
|
+
**Version v1.0.61** - WebGL Quad rendering optimization
|
|
319
178
|
Added error logging in case of the missing JSON in zip
|
|
320
179
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
Minor Update
|
|
180
|
+
**Version v1.0.62** - Minor Update
|
|
324
181
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
Added setMediaInfo(mediaInfo: { fps?: number; bitrate?: number }) for communication with MK
|
|
182
|
+
**Version v1.0.63** - Added setMediaInfo(mediaInfo: { fps?: number; bitrate?: number }) for communication with MK
|
|
328
183
|
Added logging metrics to backend
|
|
329
184
|
Hardcoded BurkerKing logo to be replaced by campaigns
|
|
330
185
|
Dev tests of Firefox support
|
|
331
186
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
Added Beacon Evenst
|
|
187
|
+
**Version v1.0.64** - Added Beacon Evenst
|
|
335
188
|
Added onAdEvent
|
|
336
189
|
Ad campaings connected
|
|
337
190
|
Added internal metrics logging to cloud
|
|
338
191
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
Added global augmentation status to beacon events
|
|
192
|
+
**Version v1.0.65** - Added global augmentation status to beacon events
|
|
342
193
|
Console logs cleared
|
|
343
194
|
|
|
344
|
-
|
|
195
|
+
**Version v1.0.66** - Minor fixes
|
|
345
196
|
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
### Version v1.0.67
|
|
349
|
-
|
|
350
|
-
Killswitch status is now checked on game params headers instead of zip headers
|
|
197
|
+
**Version v1.0.67** - Killswitch status is now checked on game params headers instead of zip headers
|
|
351
198
|
Added metrics for zip fetch as URL parameters
|
|
352
199
|
Implemented a zip fetch retry mechanism while there is still time to fetch them
|
|
353
200
|
Added OTTPlayer off method to unsubscribe from player events
|
|
354
201
|
Implemented destroy method to properly dispose OTTPlayer instances
|
|
355
202
|
|
|
356
|
-
|
|
203
|
+
**Version v1.0.68** - Zip download logic fixed
|
|
204
|
+
|
|
205
|
+
**Version v1.1.00** -
|
|
206
|
+
- Add banchmarking
|
|
207
|
+
- Add Lifecicle management
|
|
208
|
+
- Add status overlay
|
|
209
|
+
- Fix toggle(flag: boolean)
|
|
210
|
+
- Update onAdEvent(eventType: 'start' | 'end') logic
|
|
357
211
|
|
|
358
|
-
|
|
212
|
+
**Version v1.1.1** -
|
|
213
|
+
- Fix no augmentation when showAugmentationStatus: false
|
|
214
|
+
- Reset ads to default if no arguments provided to setAd()
|