@signageos/front-applet 6.2.1 → 6.4.0

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +3 -1
  3. package/dist/bundle.js +2 -2
  4. package/dist/bundle.js.map +1 -1
  5. package/docs/applet-basics.md +3 -3
  6. package/docs/{js-api → content}/js-browser.md +13 -10
  7. package/docs/{js-api → content}/js-display.md +15 -5
  8. package/docs/{js-api → content}/js-file-system.md +4 -16
  9. package/docs/{js-api → content}/js-offline-cache-simple-data.md +1 -1
  10. package/docs/{js-api → content}/js-sensors.md +2 -2
  11. package/docs/{js-api → content}/js-serial.md +1 -1
  12. package/docs/{js-api → content}/js-video-inputs-internal-ports.md +1 -1
  13. package/docs/content/js-video-stream.md +560 -0
  14. package/docs/index.md +3 -3
  15. package/docs/{management-api → management}/js-management-management.md +60 -20
  16. package/docs/{management-api → management}/js-management-network.md +3 -3
  17. package/docs/{management-api → management}/js-management-wifi.md +8 -8
  18. package/es6/FrontApplet/Browser/IOpenLinkOptions.d.ts +4 -0
  19. package/es6/FrontApplet/Browser/IOpenLinkOptions.js +1 -0
  20. package/es6/FrontApplet/Browser/IOpenLinkOptions.js.map +1 -1
  21. package/es6/FrontApplet/Input/IInput.d.ts +11 -0
  22. package/es6/FrontApplet/Input/IInput.js +3 -0
  23. package/es6/FrontApplet/Input/IInput.js.map +1 -0
  24. package/es6/FrontApplet/Input/Input.d.ts +5 -1
  25. package/es6/FrontApplet/Input/Input.js +6 -0
  26. package/es6/FrontApplet/Input/Input.js.map +1 -1
  27. package/es6/FrontApplet/Stream/Stream.d.ts +7 -3
  28. package/es6/FrontApplet/Stream/Stream.js +234 -63
  29. package/es6/FrontApplet/Stream/Stream.js.map +1 -1
  30. package/es6/FrontApplet/Stream/streamEvents.d.ts +1 -1
  31. package/package.json +8 -5
  32. package/docs/js-api/js-video-stream.md +0 -491
  33. /package/docs/{js-api → content}/js-applet-resources.md +0 -0
  34. /package/docs/{js-api → content}/js-command.md +0 -0
  35. /package/docs/{js-api → content}/js-debug.md +0 -0
  36. /package/docs/{js-api → content}/js-device-info.md +0 -0
  37. /package/docs/{js-api → content}/js-fonts.md +0 -0
  38. /package/docs/{js-api → content}/js-hardware.md +0 -0
  39. /package/docs/{js-api → content}/js-iframes.md +0 -0
  40. /package/docs/{js-api → content}/js-input.md +0 -0
  41. /package/docs/{js-api → content}/js-offline-cache-media-files.md +0 -0
  42. /package/docs/{js-api → content}/js-osd.md +0 -0
  43. /package/docs/{js-api → content}/js-proof-of-play.md +0 -0
  44. /package/docs/{js-api → content}/js-sync-playback.md +0 -0
  45. /package/docs/{js-api → content}/js-video.md +0 -0
  46. /package/docs/{management-api → management}/js-management-application.md +0 -0
  47. /package/docs/{management-api → management}/js-management-audio.md +0 -0
  48. /package/docs/{management-api → management}/js-management-debug.md +0 -0
  49. /package/docs/{management-api → management}/js-management-firmware.md +0 -0
  50. /package/docs/{management-api → management}/js-management-monitoring-commands.md +0 -0
  51. /package/docs/{management-api → management}/js-management-monitors.md +0 -0
  52. /package/docs/{management-api → management}/js-management-os.md +0 -0
  53. /package/docs/{management-api → management}/js-management-package.md +0 -0
  54. /package/docs/{management-api → management}/js-management-power.md +0 -0
  55. /package/docs/{management-api → management}/js-management-proxy.md +0 -0
  56. /package/docs/{management-api → management}/js-management-remote-control.md +0 -0
  57. /package/docs/{management-api → management}/js-management-screen.md +0 -0
  58. /package/docs/{management-api → management}/js-management-security.md +0 -0
  59. /package/docs/{management-api → management}/js-management-time.md +0 -0
@@ -0,0 +1,560 @@
1
+ ---
2
+ title: Video Streams
3
+ author: Miroslav Behina
4
+ date: 22.11.2018
5
+ type: js-api
6
+ tags:
7
+ - applet
8
+ - applet_api
9
+ - api
10
+ - js_api
11
+ description: '[Content JS API] Methods to play or stop video streams.'
12
+ ---
13
+
14
+ # Video streams
15
+
16
+ Methods to play or stop video streams.
17
+
18
+ ## All methods
19
+
20
+ | Methods | Description | Supported since |
21
+ | ------------------- | ---------------------------------------------------------------- | --------------- |
22
+ | `prepare()` | Prepare video stream in the background | 4.7.0 |
23
+ | `play()` | Start playing video stream | 1.0.18 |
24
+ | `stop()` | Stop video stream | 1.0.18 |
25
+ | `pause()` | Pause video stream | 6.3.0 |
26
+ | `resume()` | Resume video stream | 6.3.0 |
27
+ | `getTracks()` | Get all tracks of the stream | 6.1.0 |
28
+ | `selectTrack()` | Select track of the stream | 6.1.0 |
29
+ | `resetTrack()` | Reset track of the stream | 6.1.0 |
30
+ | `onConnected()` | Calls a listener callback when stream connects | 1.0.20 |
31
+ | `onDisconnected()` | Calls a listener callback when stream disconnects | 1.0.20 |
32
+ | `onError()` | Calls a listener callback when an unexpected stream error occurs | 1.0.20 |
33
+ | `onPlay()` | Calls a listener callback when stream starts playing | 5.12.0 |
34
+ | `onStop()` | Calls a listener callback when stream stops | 5.12.0 |
35
+ | `onPrepare()` | Calls a listener callback when stream prepares | 5.12.0 |
36
+ | `onTracksChanged()` | Calls a listener callback when stream tracks change | 6.1.0 |
37
+
38
+ :::warning Are you using **Samsung Tizen** to play streams?
39
+ [Read more about limitation and Tizen-specific details](https://docs.signageos.io/hc/en-us/articles/4405387373458). :::
40
+
41
+ :::danger Be aware version of JS API (v6.0.0+) changed how stream functions `play()` and `prepare()` work. For using an options object you
42
+ need to our latest core app versions. If you are using older core app versions, you need to use deprecated format. :::
43
+
44
+ ## prepare()
45
+
46
+ Calls the internal player and prepares a video stream in memory, so it can later start playing instantaneously.
47
+
48
+ :::info If you want to play a video stream in full screen mode, use x = y = 0 and width = document.documentElement.clientWidth and height =
49
+ document.documentElement.clientHeight as setup parameters. :::
50
+
51
+ ### Parameters
52
+
53
+ | Param | Type | Required | Description |
54
+ | --------- | ------ | :------------------------: | --------------------------------------------- |
55
+ | `uri` | String | <div class="red">Yes</div> | Network address where the stream is available |
56
+ | `x` | Number | <div class="red">Yes</div> | Stream x-position on the screen |
57
+ | `y` | Number | <div class="red">Yes</div> | Stream y-position on the screen |
58
+ | `width` | Number | <div class="red">Yes</div> | Stream width on the screen |
59
+ | `height` | Number | <div class="red">Yes</div> | Stream height on the screen |
60
+ | `options` | Object | <div class="red">Yes</div> | Additional options for the stream |
61
+
62
+ ### Options object
63
+
64
+ | Key | Type | Required | Description |
65
+ | ---------------- | ------- | :--------------------------: | --------------------------------------------------- |
66
+ | `protocol` | String | <div class="red">Yes</div> | Protocol that the stream is using |
67
+ | ^^ | ^^ | ^^ | Types: `HLS`, `RTP`, `HTTP`, `UDP`, `RTMP`, `RTSP`. |
68
+ | `background` | Boolean | <div class="yellow">No</div> | Prepare stream in the background |
69
+ | `trackSelection` | Object | <div class="yellow">No</div> | Track selection options |
70
+ | `drm` | Object | <div class="yellow">No</div> | DRM options |
71
+
72
+ ### Track selection object
73
+
74
+ | Key | Type | Required | Description |
75
+ | ------------------------- | ---------------- | :--------------------------: | ------------------------------------------- |
76
+ | `maxAudioChannelCount` | Number | <div class="yellow">No</div> | Maximum number of audio channels to play |
77
+ | `minVideoSize` | Object | <div class="yellow">No</div> | Minimum video size to play |
78
+ | ^^ | ^^ | ^^ | Object with `width` and `height` properties |
79
+ | `maxVideoSize` | Object | <div class="yellow">No</div> | Maximum video size to play |
80
+ | ^^ | ^^ | ^^ | Object with `width` and `height` properties |
81
+ | `preferredAudioLanguages` | Array of strings | <div class="yellow">No</div> | Preferred audio languages to play |
82
+ | `preferredTextLanguages` | Array of strings | <div class="yellow">No</div> | Preferred text languages to play |
83
+
84
+ ### DRM object
85
+
86
+ | Key | Type | Required | Description |
87
+ | ----------------------- | ------ | :--------------------------: | --------------------------------------------------------------------- |
88
+ | `scheme` | String | <div class="red">Yes</div> | DRM scheme |
89
+ | ^^ | ^^ | ^^ | Types: `CommonPSSH`, `ClearKey`, `Widevine`, `PlayReady` or own value |
90
+ | `licenseUri` | String | <div class="red">Yes</div> | DRM license URI |
91
+ | `licenseRequestHeaders` | Object | <div class="yellow">No</div> | DRM license request headers |
92
+
93
+ ### Javascript syntax
94
+
95
+ ```javascript
96
+ // Example with specific protocol type
97
+ await sos.stream.prepare(uri, x, y, width, height, { protocol: 'HTTP' });
98
+
99
+ // Example with options - prepare stream in the background
100
+ await sos.stream.prepare(uri, x, y, width, height, { protocol: 'HTTP', background: true });
101
+
102
+ // Deprecated format
103
+ await sos.stream.prepare(uri, x, y, width, height, 'HTTP');
104
+ ```
105
+
106
+ :::note[GitHub Example]
107
+ [Stream video Applet example](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/stream) :::
108
+
109
+ ## play()
110
+
111
+ Calls the internal player and starts a video stream in correct position.
112
+
113
+ :::info If you want to play a video stream in full screen mode, use x = y = 0 and width = document.documentElement.clientWidth and height =
114
+ document.documentElement.clientHeight as setup parameters. :::
115
+
116
+ ### Parameters
117
+
118
+ | Param | Type | Required | Description |
119
+ | --------- | ------ | :------------------------: | --------------------------------------------- |
120
+ | `uri` | String | <div class="red">Yes</div> | Network address where the stream is available |
121
+ | `x` | Number | <div class="red">Yes</div> | Stream x-position on the screen |
122
+ | `y` | Number | <div class="red">Yes</div> | Stream y-position on the screen |
123
+ | `width` | Number | <div class="red">Yes</div> | Stream width on the screen |
124
+ | `height` | Number | <div class="red">Yes</div> | Stream height on the screen |
125
+ | `options` | Object | <div class="red">Yes</div> | Additional options for the stream |
126
+
127
+ ### Options object
128
+
129
+ | Key | Type | Required | Description |
130
+ | ----------------------- | ------- | :--------------------------: | --------------------------------------------------- |
131
+ | `protocol` | String | <div class="red">Yes</div> | Protocol that the stream is using |
132
+ | ^^ | ^^ | ^^ | Types: `HLS`, `RTP`, `HTTP`, `UDP`, `RTMP`, `RTSP`. |
133
+ | `autoReconnect` | Boolean | <div class="yellow">No</div> | Automatically reconnect stream when it disconnects |
134
+ | ^^ | ^^ | ^^ | Default value: false |
135
+ | `autoReconnectInterval` | Number | <div class="yellow">No</div> | Interval in miliseconds between reconnect attempts |
136
+ | ^^ | ^^ | ^^ | Default value: 30000 ms |
137
+ | `volume` | Number | <div class="yellow">No</div> | Volume of the stream |
138
+ | `trackSelection` | Object | <div class="yellow">No</div> | Track selection options |
139
+ | `drm` | Object | <div class="yellow">No</div> | DRM options |
140
+
141
+ ### Javascript syntax
142
+
143
+ ```javascript
144
+ // Example with specific protocol type
145
+ await sos.stream.play(uri, x, y, width, height, { protocol: 'HTTP' });
146
+
147
+ // Example with other options - enable auto reconnect
148
+ await sos.stream.play(uri, x, y, width, height, { protocol: 'HTTP', autoReconnect: true });
149
+
150
+ // Example with other options - reconnect every 10 seconds
151
+ await sos.stream.play(uri, x, y, width, height, { protocol: 'HTTP', autoReconnect: true, autoReconnectInterval: 10000 });
152
+
153
+ // Deprecated format
154
+ await sos.stream.play(uri, x, y, width, height, 'HTTP');
155
+ ```
156
+
157
+ :::note[GitHub Example]
158
+ [Stream video Applet example](https://github.com/signageos/applet-examples/blob/master/examples/content-js-api/stream) :::
159
+
160
+ ## stop()
161
+
162
+ Stops the video stream playback.
163
+
164
+ ### Javascript syntax
165
+
166
+ ```javascript
167
+ await sos.stream.stop(uri, x, y, width, height);
168
+ ```
169
+
170
+ ### Parameters:
171
+
172
+ | Param | Type | Required | Description |
173
+ | -------- | ------ | :------------------------: | --------------------------------------------- |
174
+ | `uri` | String | <div class="red">Yes</div> | Network address where the stream is available |
175
+ | `x` | Number | <div class="red">Yes</div> | Stream x-position on the screen |
176
+ | `y` | Number | <div class="red">Yes</div> | Stream y-position on the screen |
177
+ | `width` | Number | <div class="red">Yes</div> | Stream width on the screen |
178
+ | `height` | Number | <div class="red">Yes</div> | Stream height on the screen |
179
+
180
+ ## pause()
181
+
182
+ Pauses the video stream playback.
183
+
184
+ ### Javascript syntax
185
+
186
+ ```javascript
187
+ await sos.stream.pause(uri, x, y, width, height);
188
+ ```
189
+
190
+ ### Parameters:
191
+
192
+ | Param | Type | Required | Description |
193
+ | -------- | ------ | :------------------------: | --------------------------------------------- |
194
+ | `uri` | String | <div class="red">Yes</div> | Network address where the stream is available |
195
+ | `x` | Number | <div class="red">Yes</div> | Stream x-position on the screen |
196
+ | `y` | Number | <div class="red">Yes</div> | Stream y-position on the screen |
197
+ | `width` | Number | <div class="red">Yes</div> | Stream width on the screen |
198
+ | `height` | Number | <div class="red">Yes</div> | Stream height on the screen |
199
+
200
+ ## resume()
201
+
202
+ Resumes the video stream playback.
203
+
204
+ ### Javascript syntax
205
+
206
+ ```javascript
207
+ await sos.stream.resume(uri, x, y, width, height);
208
+ ```
209
+
210
+ ### Parameters:
211
+
212
+ | Param | Type | Required | Description |
213
+ | -------- | ------ | :------------------------: | --------------------------------------------- |
214
+ | `uri` | String | <div class="red">Yes</div> | Network address where the stream is available |
215
+ | `x` | Number | <div class="red">Yes</div> | Stream x-position on the screen |
216
+ | `y` | Number | <div class="red">Yes</div> | Stream y-position on the screen |
217
+ | `width` | Number | <div class="red">Yes</div> | Stream width on the screen |
218
+ | `height` | Number | <div class="red">Yes</div> | Stream height on the screen |
219
+
220
+ ## getTracks()
221
+
222
+ Get all tracks of the selected stream.
223
+
224
+ ### Javascript syntax
225
+
226
+ ```javascript
227
+ const videoId = {
228
+ uri: 'http://example.com/stream.m3u8',
229
+ x: 0,
230
+ y: 0,
231
+ width: 1920,
232
+ height: 1080,
233
+ };
234
+
235
+ const tracks = await sos.stream.getTracks(videoId); // Promise<ITrackInfo[]>
236
+ ```
237
+
238
+ ### Parameters:
239
+
240
+ | Param | Type | Required | Description |
241
+ | --------- | ------ | :------------------------: | ---------------------------------- |
242
+ | `videoId` | Object | <div class="red">Yes</div> | Video ID object of selected stream |
243
+
244
+ ### Example of returned value
245
+
246
+ ```javascript
247
+ [
248
+ {
249
+ trackType: 'VIDEO', // string - AUDIO, VIDEO, TEXT
250
+ mimeType: 'video/mp4', // string
251
+ videoSize: {
252
+ // object
253
+ width: 1920, // number
254
+ height: 1080, // number
255
+ },
256
+ groupId: '1', // string
257
+ trackIndex: 1, // number
258
+ selected: true, // boolean
259
+ language: 'en', // string
260
+ supported: true, // boolean
261
+ },
262
+ ];
263
+ ```
264
+
265
+ ## selectTrack()
266
+
267
+ Select track of the selected stream.
268
+
269
+ ### Javascript syntax
270
+
271
+ ```javascript
272
+ await sos.stream.selectTrack(videoId, trackType, groupId, trackIndex); // Promise<void>
273
+ ```
274
+
275
+ ### Parameters:
276
+
277
+ | Param | Type | Required | Description |
278
+ | ------------ | ------ | :------------------------: | ------------------------------------- |
279
+ | `videoId` | Object | <div class="red">Yes</div> | Video ID object of selected stream |
280
+ | `trackType` | String | <div class="red">Yes</div> | Track type - `AUDIO`, `VIDEO`, `TEXT` |
281
+ | `groupId` | String | <div class="red">Yes</div> | Group ID of selected track |
282
+ | `trackIndex` | Number | <div class="red">Yes</div> | Index of selected track |
283
+
284
+ ## resetTrack()
285
+
286
+ Reset track of the selected stream.
287
+
288
+ ### Javascript syntax
289
+
290
+ ```javascript
291
+ await sos.stream.resetTrack(videoId, trackType); // Promise<void>
292
+ await sos.stream.resetTrack(videoId, trackType, groupId); // Promise<void>
293
+ ```
294
+
295
+ ### Parameters:
296
+
297
+ | Param | Type | Required | Description |
298
+ | ----------- | ------ | :--------------------------: | ------------------------------------- |
299
+ | `videoId` | Object | <div class="red">Yes</div> | Video ID object of selected stream |
300
+ | `trackType` | String | <div class="red">Yes</div> | Track type - `AUDIO`, `VIDEO`, `TEXT` |
301
+ | `groupId` | String | <div class="yellow">No</div> | Group ID of selected track |
302
+
303
+ ## Event onConnected()
304
+
305
+ Calls a listener callback everytime `connected` event is emitted.
306
+
307
+ ### Javascript syntax
308
+
309
+ ```javascript
310
+ sos.stream.onConnected((event) => {
311
+ // do something
312
+ });
313
+ ```
314
+
315
+ ## Event onDisconnected()
316
+
317
+ Calls a listener callback everytime `disconnected` event is emitted.
318
+
319
+ ### Javascript syntax
320
+
321
+ ```javascript
322
+ sos.stream.onDisconnected((event) => {
323
+ // do something
324
+ });
325
+ ```
326
+
327
+ ## Event onError()
328
+
329
+ Calls a listener callback everytime `error` event is emitted.
330
+
331
+ ### Javascript syntax
332
+
333
+ ```javascript
334
+ sos.stream.onError((event) => {
335
+ // do something
336
+ });
337
+ ```
338
+
339
+ ## Event onPlay()
340
+
341
+ Calls a listener callback everytime `play` event is emitted.
342
+
343
+ ### Javascript syntax
344
+
345
+ ```javascript
346
+ sos.stream.onPlay((event) => {
347
+ // do something
348
+ });
349
+ ```
350
+
351
+ ## Event onStop()
352
+
353
+ Calls a listener callback everytime `stop` event is emitted.
354
+
355
+ ### Javascript syntax
356
+
357
+ ```javascript
358
+ sos.stream.onStop((event) => {
359
+ // do something
360
+ });
361
+ ```
362
+
363
+ ## Event onPrepare()
364
+
365
+ Calls a listener callback everytime `prepare` event is emitted.
366
+
367
+ ### Javascript syntax
368
+
369
+ ```javascript
370
+ sos.stream.onPrepare((event) => {
371
+ // do something
372
+ });
373
+ ```
374
+
375
+ ## Event onTracksChanged()
376
+
377
+ Calls a listener callback everytime `tracks_changed` event is emitted.
378
+
379
+ ### Javascript syntax
380
+
381
+ ```javascript
382
+ sos.stream.onTracksChanged((event) => {
383
+ // do something
384
+ });
385
+ ```
386
+
387
+ ## Stream events
388
+
389
+ All stream events have the same format.
390
+
391
+ `type` property contains string with the event type. Type can be `connected`, `disconnected`, `error` or `tracks_changed`.
392
+
393
+ `srcArguments` property contains parameters of the source stream, that emitted the event. That way, if multiple streams are playing at once,
394
+ you can associate the events with each stream instance.
395
+
396
+ Example of **connected**, **disconnected** event:
397
+
398
+ ```json
399
+ {
400
+ "type": "<type>",
401
+ "srcArguments": {
402
+ "uri": "<uri>",
403
+ "x": 0,
404
+ "y": 0,
405
+ "width": 1920,
406
+ "height": 1080,
407
+ "protocol": "HTTP"
408
+ }
409
+ }
410
+ ```
411
+
412
+ Example of **tracks_changed** event:
413
+
414
+ ```json
415
+ {
416
+ "type": "tracks_changed",
417
+ "srcArguments": {
418
+ "uri": "<uri>",
419
+ "x": 0,
420
+ "y": 0,
421
+ "width": 1920,
422
+ "height": 1080,
423
+ "tracks": [] // Array of ITrackInfo
424
+ }
425
+ }
426
+ ```
427
+
428
+ Example of **error** event:
429
+
430
+ ```json
431
+ {
432
+ "type": "error",
433
+ "srcArguments": {
434
+ "uri": "<uri>",
435
+ "x": 0,
436
+ "y": 0,
437
+ "width": 1920,
438
+ "height": 1080,
439
+ "protocol": "HTTP"
440
+ },
441
+ "errorMessage": "Some error message"
442
+ }
443
+ ```
444
+
445
+ ## Usage with Typescript
446
+
447
+ You can also use all these methods with
448
+ [signageOS TypeScript](https://docs.signageos.io/hc/en-us/articles/4405069154962#signageos-typescript).
449
+
450
+ ```typescript
451
+ type StreamProtocol = 'HLS' | 'RTP' | 'HTTP' | 'UDP' | 'RTMP' | 'RTSP';
452
+ type DrmScheme = "CommonPSSH" | "ClearKey" | "Widevine" | "PlayReady" | string;
453
+ interface StreamEvent {
454
+ type: 'connected' | 'disconnected' | 'error' | 'stop' | 'prepare' | 'play',
455
+ srcArguments: {
456
+ uri: string;
457
+ x: number;
458
+ y: number;
459
+ width: number;
460
+ height: number;
461
+ protocol?: StreamProtocol;
462
+ },
463
+ }
464
+ interface IVideoProperties {
465
+ uri: string;
466
+ x: number;
467
+ y: number;
468
+ width: number;
469
+ height: number;
470
+ }
471
+ type TrackType = 'AUDIO' | 'VIDEO' | 'TEXT';
472
+ type ITrackInfo = IVideoTrack | IAudioTrack | ITextTrack;
473
+ interface ITrack<T extends TrackType> {
474
+ trackType: T;
475
+ mimeType: string;
476
+ groupId: string;
477
+ trackIndex: number;
478
+ selected: boolean;
479
+ language: string | null;
480
+ supported: boolean;
481
+ }
482
+ interface IVideoTrack extends ITrack<'VIDEO'> {
483
+ videoSize: { width: number; height: number };
484
+ }
485
+ interface IAudioTrack extends ITrack<'AUDIO'> {
486
+ channelCount: number;
487
+ }
488
+ interface ITextTrack extends ITrack<'TEXT'> {
489
+ selection: 'default' | 'forced' | 'autoselect';
490
+ }
491
+ prepare(
492
+ uri: string;
493
+ x: number;
494
+ y: number;
495
+ width: number;
496
+ height: number;
497
+ options: {
498
+ protocol: StreamProtocol;
499
+ background?: boolean;
500
+ autoReconnect?: boolean;
501
+ autoReconnectInterval?: number;
502
+ trackSelection?: {
503
+ maxAudioChannelCount?: number;
504
+ minVideoSize?: { width: number; height: number };
505
+ maxVideoSize?: { width: number; height: number };
506
+ preferredAudioLanguages?: string[];
507
+ preferredTextLanguages?: string[];
508
+ };
509
+ drm?: {
510
+ scheme: DrmScheme;
511
+ licenseUri: string;
512
+ licenseRequestHeaders: { [key: string]: string };
513
+ };
514
+ }
515
+ ): Promise<void>;
516
+ play(
517
+ uri: string;
518
+ x: number;
519
+ y: number;
520
+ width: number;
521
+ height: number;
522
+ options: {
523
+ protocol: StreamProtocol;
524
+ background?: boolean;
525
+ autoReconnect?: boolean;
526
+ autoReconnectInterval?: number;
527
+ }
528
+ ): Promise<void>;
529
+ stop(
530
+ uri: string,
531
+ x: number,
532
+ y: number,
533
+ width: number,
534
+ height: number
535
+ ): Promise<void>;
536
+ getTracks(videoId: IVideoProperties): Promise<ITrackInfo[]>;
537
+ selectTrack(videoId: IVideoProperties, trackType: TrackType, groupId: string, trackIndex: number): Promise<void>;
538
+ resetTrack(videoId: IVideoProperties, trackType: TrackType, groupId?: string): Promise<void>;
539
+ onConnected(listener: (event: StreamEvent) => void): void;
540
+ onDisconnected(listener: (event: StreamEvent) => void): void;
541
+ onError(listener: (event: StreamErrorEvent) => void): void;
542
+ onPlay(listener: (event: StreamEvent) => void): void;
543
+ onStop(listener: (event: StreamEvent) => void): void;
544
+ onPrepare(listener: (event: StreamEvent) => void): void;
545
+ onTracksChanged(listener: (event: StreamTracksChangedEvent) => void): void;
546
+ ```
547
+
548
+ ## Errors
549
+
550
+ Although we are doing our best, following errors may occur when working with the video stream.
551
+
552
+ | Code | Type | Message |
553
+ | ----- | ------------------- | ---------------------------------------------------- |
554
+ | 41401 | AppletStreamError | Invalid stream protocol type: `protocol` |
555
+ | 51301 | InternalStreamError | Couldn't stop the stream before playing the new one. |
556
+ | 51301 | InternalStreamError | Couldn't stop the stream. |
557
+ | 51302 | InternalStreamError | Couldn't prepare the stream. |
558
+ | 51303 | InternalStreamError | Couldn't get stream tracks. |
559
+ | 51304 | InternalStreamError | Couldn't select stream track. |
560
+ | 51305 | InternalStreamError | Couldn't reset stream track. |
package/docs/index.md CHANGED
@@ -18,7 +18,7 @@ All APIs are standardized and available across all [supported devices](https://d
18
18
  :::
19
19
 
20
20
  :::info[Start here]
21
- [Basic information about Applets](/sdk/applet-basics)
21
+ [Basic information about Applets](applet-basics.md)
22
22
 
23
23
  General information required to use the signageOS JS API
24
24
  :::
@@ -38,13 +38,13 @@ Universal APIs for File system, access to accelerated video playback, sensor man
38
38
  | [Device Info](content/js-device-info) | Device-related informations |
39
39
  | [Display](content/js-display) | Query features supported by the display |
40
40
  | [File system](content/js-file-system) | Full-featured file system API including ZIP and folder management |
41
- | [Fonts](content/js-loading-fonts) | Make it easy to load additional fonts into SoC devices |
41
+ | [Fonts](content/js-fonts) | Make it easy to load additional fonts into SoC devices |
42
42
  | [Hardware](content/js-hardware) | Hardware-specific APIs like LED lights on Philips 10BDL |
43
43
  | [Inputs](content/js-input) | Controller inputs like IR remote unified under one API |
44
44
  | [iFrames](content/js-iframes) | Using JS SDK in iFrames |
45
45
  | [Proof of Play](content/js-proof-of-play) | Proof of Play API |
46
46
  | [Sensors](content/js-sensors) | Using sensors and IoT devices in your application |
47
- | [Serial Port](content/js-hardware-serial) | Control external devices via serial |
47
+ | [Serial Port](content/js-serial) | Control external devices via serial |
48
48
  | [Synchronized playback](content/js-sync-playback) | API for creating synced playback and videowalls |
49
49
  | [Video Inputs aka PiP](content/js-video-inputs-internal-ports) | Show HDMI/DP/VGA as a part of your content via PiP feature |
50
50
  | [Video Playback](content/js-video) | Playing accelerated gapless videos via native video player |
@@ -30,21 +30,9 @@ To make the management of devices more viable and open there is a management API
30
30
  | `getBrand()` | Information about device brand | 5.7.0
31
31
 
32
32
  ## Examples
33
- <div class="row d-flex align-content-stretch force-padding-10">
34
- <div class="col-12 d-flex">
35
- <a class="wide-box wide-box--white d-flex align-content-stretch widebox-kb-color" target="_blank" href="https://github.com/signageos/applet-examples/blob/master/examples/management-js-api/basics/">
36
- <div>
37
- <div class="wide-box__image d-flex align-items-center">
38
- <i class="fab fa-github svg-black"></i>
39
- </div>
40
- <div>
41
- <h3 class="wide-box__title wide-box__title__small pl-85">Basic usage of management API</h3>
42
- <div class="wide-box__description">Working example on our Github</div>
43
- </div>
44
- </div>
45
- </a>
46
- </div>
47
- </div>
33
+ :::note[GitHub Example]
34
+ [Basic usage of management API](https://github.com/signageos/applet-examples/blob/master/examples/management-js-api/basics)
35
+ :::
48
36
 
49
37
  :::note[GitHub Example]
50
38
  - [Getting basic management API data](https://github.com/signageos/applet-examples/blob/master/examples/management-js-api/js-management-getters/)
@@ -54,16 +42,68 @@ To make the management of devices more viable and open there is a management API
54
42
  ## supports()
55
43
  Method `supports()` will show you what capabilities the deployed device currently has.
56
44
 
57
-
58
- | Param | Type |Description |
59
- | -------------- | ----------------------------- | ---------------------------- |
60
- | `capability` | String | Name of capability
61
-
62
45
  ### Javascript example
46
+
63
47
  ```javascript
64
48
  await sos.management.supports("NETWORK_INFO"); // Returns boolean
65
49
  ```
66
50
 
51
+ ### Capabilities
52
+
53
+ | Param |
54
+ | -------------- |
55
+ | MODEL |
56
+ | SERIAL_NUMBER |
57
+ | BRAND |
58
+ | OS_VERSION |
59
+ | BATTERY_STATUS |
60
+ | STORAGE_UNITS |
61
+ | TEMPERATURE |
62
+ | SCREENSHOT_UPLOAD |
63
+ | NETWORK_INFO |
64
+ | WIFI |
65
+ | WIFI_SCAN |
66
+ | WIFI_AP |
67
+ | WIFI_STRENGTH |
68
+ | TIMERS_PROPRIETARY |
69
+ | BRIGHTNESS_SCHEDULING |
70
+ | TIMERS_NATIVE |
71
+ | SET_BRIGHTNESS |
72
+ | GET_BRIGHTNESS |
73
+ | SCREEN_RESIZE |
74
+ | SET_TIME |
75
+ | SET_TIMEZONE |
76
+ | GET_TIMEZONE |
77
+ | NTP_TIME |
78
+ | APP_UPGRADE |
79
+ | FIRMWARE_UPGRADE |
80
+ | PACKAGE_INSTALL |
81
+ | SET_VOLUME |
82
+ | GET_VOLUME |
83
+ | SET_REMOTE_CONTROL_ENABLED |
84
+ | SET_DEBUG |
85
+ | SYSTEM_REBOOT |
86
+ | APP_RESTART |
87
+ | DISPLAY_POWER |
88
+ | SERVLET |
89
+ | HARDWARE_LED_SET_COLOR |
90
+ | PROXIMITY_SENSOR |
91
+ | FACTORY_RESET |
92
+ | ORIENTATION_LANDSCAPE |
93
+ | ORIENTATION_PORTRAIT |
94
+ | ORIENTATION_LANDSCAPE_FLIPPED |
95
+ | ORIENTATION_PORTRAIT_FLIPPED |
96
+ | ORIENTATION_AUTO |
97
+ | SCHEDULE_POWER_ACTION |
98
+ | EXTENDED_MANAGEMENT |
99
+ | SYSTEM_CPU |
100
+ | SYSTEM_MEMORY |
101
+ | PROXY |
102
+ | AUTO_RECOVERY |
103
+ | PEER_RECOVERY |
104
+ | FILE_SYSTEM_WIPEOUT |
105
+ | REMOTE_DESKTOP |
106
+
67
107
  ## getModel()
68
108
  Method `getModel()` will display the model of your device.
69
109