@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signageos/front-applet",
3
- "version": "6.2.1",
3
+ "version": "6.4.0",
4
4
  "main": "dist/bundle.js",
5
5
  "types": "es6/bundle.d.ts",
6
6
  "files": [
@@ -21,10 +21,13 @@
21
21
  "lint:staged": "npx lint-staged",
22
22
  "prebuild": "rm -rf dist/*",
23
23
  "prepare": "npm run prebuild && npm run build && npm run generate-declarations && npx husky install",
24
- "test": "env NODE_ENV=test c8 ./node_modules/mocha/bin/mocha --opts mocha.opts",
24
+ "test": "env NODE_ENV=test ./node_modules/mocha/bin/mocha --config .mocha/default.js",
25
+ "test:coverage": "npm run test:coverage:runtime && npm run test:coverage:types",
26
+ "test:coverage:runtime": "env NODE_ENV=test c8 ./node_modules/mocha/bin/mocha --config .mocha/transpile-only.js",
27
+ "test:coverage:types": "tsc --noEmit -p tsconfig.json",
25
28
  "escheck": "es-check --module es5 dist/*.js",
26
29
  "check": "npm run depcheck && npx --userconfig ./.npmrc @signageos/lib check-deps '.+' 'weinre'",
27
- "depcheck": "depcheck --specials=tslint,webpack,mocha --parsers='*.ts:typescript,*.js:es6' --detectors='requireCallExpression,importDeclaration' --ignore-dirs='dist,packages' --ignores='@types/*,@signageos/codestyle,ts-node,source-map-support,mocha,depcheck,webpack-cli,@babel/polyfill,@babel/preset-env,es-check,debug,husky,lint-staged,c8'"
30
+ "depcheck": "depcheck --specials=tslint,webpack,mocha --parsers='*.ts:typescript,*.js:es6' --detectors='requireCallExpression,importDeclaration' --ignore-dirs='dist,packages' --ignores='@types/*,@signageos/codestyle,ts-node,source-map-support,mocha,depcheck,webpack-cli,@babel/polyfill,@babel/preset-env,es-check,debug,husky,lint-staged,c8,should-sinon,weinre,faker,should,sinon'"
28
31
  },
29
32
  "repository": {
30
33
  "url": "git@gitlab.com:signageos/front-applet",
@@ -34,7 +37,7 @@
34
37
  "@babel/core": "7.6.0",
35
38
  "@babel/polyfill": "7.6.0",
36
39
  "@babel/preset-env": "7.6.0",
37
- "@signageos/codestyle": "0.0.24",
40
+ "@signageos/codestyle": "0.1.1",
38
41
  "@signageos/lib": "10.19.2",
39
42
  "@types/debug": "4.1.8",
40
43
  "@types/faker": "4.1.5",
@@ -50,7 +53,7 @@
50
53
  "es-check": "5.1.0",
51
54
  "faker": "4.1.0",
52
55
  "husky": "7.0.4",
53
- "lint-staged": "14.0.1",
56
+ "lint-staged": "12.5.0",
54
57
  "lodash": "4.17.21",
55
58
  "mocha": "6.2.3",
56
59
  "should": "13.2.3",
@@ -1,491 +0,0 @@
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
- Methods to play or stop video streams.
16
-
17
- ## All methods
18
-
19
- | Methods | Description | Supported since |
20
- | ------------------ | ----------------------------------------------------- | --------------- |
21
- | `prepare()` | Prepare video stream in the background | 4.7.0 |
22
- | `play()` | Start playing video stream | 1.0.18 |
23
- | `stop()` | Stop video stream | 1.0.18 |
24
- | `getTracks()` | Get all tracks of the stream | 6.1.0 |
25
- | `selectTrack()` | Select track of the stream | 6.1.0 |
26
- | `resetTrack()` | Reset track of the stream | 6.1.0 |
27
- | `onConnected()` | Calls a listener callback when stream connects | 1.0.20 |
28
- | `onDisconnected()` | Calls a listener callback when stream disconnects | 1.0.20 |
29
- | `onError()` | Calls a listener callback when an unexpected stream error occurs | 1.0.20 |
30
- | `onPlay()` | Calls a listener callback when stream starts playing | 5.12.0 |
31
- | `onStop()` | Calls a listener callback when stream stops | 5.12.0 |
32
- | `onPrepare()` | Calls a listener callback when stream prepares | 5.12.0 |
33
- | `onTracksChanged()`| Calls a listener callback when stream tracks change | 6.1.0 |
34
-
35
- :::warning
36
- Are you using **Samsung Tizen** to play streams? [Read more about limitation and Tizen-specific details](https://docs.signageos.io/hc/en-us/articles/4405387373458).
37
- :::
38
-
39
- :::danger
40
- Be aware version of JS API (v6.0.0+) changed how stream functions `play()` and `prepare()` work. For using an options object
41
- you need to our latest core app versions. If you are using older core app versions, you need to use deprecated format.
42
- :::
43
-
44
- ## prepare()
45
- Calls the internal player and prepares a video stream in memory, so it can later start playing instantaneously.
46
-
47
- :::info
48
- If you want to play a video stream in full screen mode, use x = y = 0 and width = document.documentElement.clientWidth and height = document.documentElement.clientHeight as setup parameters.
49
- :::
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
-
94
- ### Javascript syntax
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
-
110
- ## play()
111
- Calls the internal player and starts a video stream in correct position.
112
-
113
- :::info
114
- If you want to play a video stream in full screen mode, use x = y = 0 and width = document.documentElement.clientWidth and height = document.documentElement.clientHeight as setup parameters.
115
- :::
116
-
117
- ### Parameters
118
-
119
- | Param | Type | Required | Description |
120
- | -------------- | --------------------------- | :--------------------------: | --------------------------------------------- |
121
- | `uri` | String | <div class="red">Yes</div> | Network address where the stream is available |
122
- | `x` | Number | <div class="red">Yes</div> | Stream x-position on the screen |
123
- | `y` | Number | <div class="red">Yes</div> | Stream y-position on the screen |
124
- | `width` | Number | <div class="red">Yes</div> | Stream width on the screen |
125
- | `height` | Number | <div class="red">Yes</div> | Stream height on the screen |
126
- | `options` | Object | <div class="red">Yes</div> | Additional options for the stream
127
-
128
- ### Options object
129
-
130
- | Key | Type | Required | Description |
131
- | ------------ | --------------------------- | :--------------------------: | --------------------------------------------- |
132
- | `protocol` | String | <div class="red">Yes</div> | Protocol that the stream is using |
133
- |^^|^^|^^| Types: `HLS`, `RTP`, `HTTP`, `UDP`, `RTMP`, `RTSP`. |
134
- | `autoReconnect` | Boolean | <div class="yellow">No</div> | Automatically reconnect stream when it disconnects |
135
- |^^|^^|^^| Default value: false |
136
- | `autoReconnectInterval` | Number | <div class="yellow">No</div> | Interval in miliseconds between reconnect attempts |
137
- |^^|^^|^^| Default value: 30000 ms |
138
- | `volume` | Number | <div class="yellow">No</div> | Volume of the stream |
139
- | `trackSelection`| Object | <div class="yellow">No</div> | Track selection options |
140
- | `drm` | Object | <div class="yellow">No</div> | DRM options
141
-
142
- ### Javascript syntax
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
-
161
- ## stop()
162
- Stops the video stream playback.
163
-
164
- ### Javascript syntax
165
- ```javascript
166
- await sos.stream.stop(uri, x, y, width, height);
167
- ```
168
-
169
- ### Parameters:
170
-
171
- | Param | Type | Required | Description |
172
- | -------------- | --------------------------- | :------------------------: | --------------------------------------------- |
173
- | `uri` | String | <div class="red">Yes</div> | Network address where the stream is available |
174
- | `x` | Number | <div class="red">Yes</div> | Stream x-position on the screen |
175
- | `y` | Number | <div class="red">Yes</div> | Stream y-position on the screen |
176
- | `width` | Number | <div class="red">Yes</div> | Stream width on the screen |
177
- | `height` | Number | <div class="red">Yes</div> | Stream height on the screen
178
-
179
- ## getTracks()
180
- Get all tracks of the selected stream.
181
-
182
- ### Javascript syntax
183
- ```javascript
184
- const videoId = {
185
- uri: 'http://example.com/stream.m3u8',
186
- x: 0,
187
- y: 0,
188
- width: 1920,
189
- height: 1080,
190
- };
191
-
192
- const tracks = await sos.stream.getTracks(videoId); // Promise<ITrackInfo[]>
193
- ```
194
-
195
- ### Parameters:
196
-
197
- | Param | Type | Required | Description |
198
- | -------------- | --------------------------- | :------------------------: | --------------------------------------------- |
199
- | `videoId` | Object | <div class="red">Yes</div> | Video ID object of selected stream
200
-
201
- ### Example of returned value
202
- ```javascript
203
- [
204
- {
205
- trackType: 'VIDEO', // string - AUDIO, VIDEO, TEXT
206
- mimeType: 'video/mp4', // string
207
- videoSize: { // object
208
- width: 1920, // number
209
- height: 1080, // number
210
- },
211
- groupId: '1', // string
212
- trackIndex: 1, // number
213
- selected: true, // boolean
214
- language: 'en', // string
215
- supported: true, // boolean
216
- }
217
- ]
218
- ```
219
-
220
- ## selectTrack()
221
- Select track of the selected stream.
222
-
223
- ### Javascript syntax
224
- ```javascript
225
- await sos.stream.selectTrack(videoId, trackType, groupId, trackIndex); // Promise<void>
226
- ```
227
-
228
- ### Parameters:
229
-
230
- | Param | Type | Required | Description |
231
- | -------------- | --------------------------- | :------------------------: | --------------------------------------------- |
232
- | `videoId` | Object | <div class="red">Yes</div> | Video ID object of selected stream |
233
- | `trackType` | String | <div class="red">Yes</div> | Track type - `AUDIO`, `VIDEO`, `TEXT` |
234
- | `groupId` | String | <div class="red">Yes</div> | Group ID of selected track |
235
- | `trackIndex` | Number | <div class="red">Yes</div> | Index of selected track
236
-
237
- ## resetTrack()
238
- Reset track of the selected stream.
239
-
240
- ### Javascript syntax
241
- ```javascript
242
- await sos.stream.resetTrack(videoId, trackType); // Promise<void>
243
- await sos.stream.resetTrack(videoId, trackType, groupId); // Promise<void>
244
- ```
245
-
246
- ### Parameters:
247
-
248
- | Param | Type | Required | Description |
249
- | -------------- | --------------------------- | :------------------------: | --------------------------------------------- |
250
- | `videoId` | Object | <div class="red">Yes</div> | Video ID object of selected stream |
251
- | `trackType` | String | <div class="red">Yes</div> | Track type - `AUDIO`, `VIDEO`, `TEXT` |
252
- | `groupId` | String | <div class="yellow">No</div> | Group ID of selected track
253
-
254
- ## Event onConnected()
255
- Calls a listener callback everytime `connected` event is emitted.
256
-
257
- ### Javascript syntax
258
- ```javascript
259
- sos.stream.onConnected((event) => {
260
- // do something
261
- });
262
- ```
263
-
264
- ## Event onDisconnected()
265
- Calls a listener callback everytime `disconnected` event is emitted.
266
-
267
- ### Javascript syntax
268
- ```javascript
269
- sos.stream.onDisconnected((event) => {
270
- // do something
271
- });
272
- ```
273
-
274
- ## Event onError()
275
- Calls a listener callback everytime `error` event is emitted.
276
-
277
- ### Javascript syntax
278
- ```javascript
279
- sos.stream.onError((event) => {
280
- // do something
281
- });
282
- ```
283
-
284
- ## Event onPlay()
285
- Calls a listener callback everytime `play` event is emitted.
286
-
287
- ### Javascript syntax
288
- ```javascript
289
- sos.stream.onPlay((event) => {
290
- // do something
291
- });
292
- ```
293
-
294
- ## Event onStop()
295
- Calls a listener callback everytime `stop` event is emitted.
296
-
297
- ### Javascript syntax
298
- ```javascript
299
- sos.stream.onStop((event) => {
300
- // do something
301
- });
302
- ```
303
-
304
- ## Event onPrepare()
305
- Calls a listener callback everytime `prepare` event is emitted.
306
-
307
- ### Javascript syntax
308
- ```javascript
309
- sos.stream.onPrepare((event) => {
310
- // do something
311
- });
312
- ```
313
-
314
- ## Event onTracksChanged()
315
- Calls a listener callback everytime `tracks_changed` event is emitted.
316
-
317
- ### Javascript syntax
318
- ```javascript
319
- sos.stream.onTracksChanged((event) => {
320
- // do something
321
- });
322
- ```
323
-
324
- ## Stream events
325
- All stream events have the same format.
326
-
327
- `type` property contains string with the event type. Type can be `connected`, `disconnected`, `error` or `tracks_changed`.
328
-
329
- `srcArguments` property contains parameters of the source stream, that emitted the event.
330
- That way, if multiple streams are playing at once, you can associate the events with each stream instance.
331
-
332
- Example of **connected**, **disconnected** event:
333
- ```json
334
- {
335
- "type": "<type>",
336
- "srcArguments": {
337
- "uri": "<uri>",
338
- "x": 0,
339
- "y": 0,
340
- "width": 1920,
341
- "height": 1080,
342
- "protocol": "HTTP"
343
- }
344
- }
345
- ```
346
-
347
- Example of **tracks_changed** event:
348
- ```json
349
- {
350
- "type": "tracks_changed",
351
- "srcArguments": {
352
- "uri": "<uri>",
353
- "x": 0,
354
- "y": 0,
355
- "width": 1920,
356
- "height": 1080,
357
- "tracks": [] // Array of ITrackInfo
358
- }
359
- }
360
- ```
361
-
362
- Example of **error** event:
363
- ```json
364
- {
365
- "type": "error",
366
- "srcArguments": {
367
- "uri": "<uri>",
368
- "x": 0,
369
- "y": 0,
370
- "width": 1920,
371
- "height": 1080,
372
- "protocol": "HTTP"
373
- },
374
- "errorMessage": "Some error message"
375
- }
376
- ```
377
-
378
- ## Usage with Typescript
379
- You can also use all these methods with [signageOS TypeScript](https://docs.signageos.io/hc/en-us/articles/4405069154962#signageos-typescript).
380
-
381
- ```typescript
382
- type StreamProtocol = 'HLS' | 'RTP' | 'HTTP' | 'UDP' | 'RTMP' | 'RTSP';
383
- type DrmScheme = "CommonPSSH" | "ClearKey" | "Widevine" | "PlayReady" | string;
384
- interface StreamEvent {
385
- type: 'connected' | 'disconnected' | 'error' | 'stop' | 'prepare' | 'play',
386
- srcArguments: {
387
- uri: string;
388
- x: number;
389
- y: number;
390
- width: number;
391
- height: number;
392
- protocol?: StreamProtocol;
393
- },
394
- }
395
- interface IVideoProperties {
396
- uri: string;
397
- x: number;
398
- y: number;
399
- width: number;
400
- height: number;
401
- }
402
- type TrackType = 'AUDIO' | 'VIDEO' | 'TEXT';
403
- type ITrackInfo = IVideoTrack | IAudioTrack | ITextTrack;
404
- interface ITrack<T extends TrackType> {
405
- trackType: T;
406
- mimeType: string;
407
- groupId: string;
408
- trackIndex: number;
409
- selected: boolean;
410
- language: string | null;
411
- supported: boolean;
412
- }
413
- interface IVideoTrack extends ITrack<'VIDEO'> {
414
- videoSize: { width: number; height: number };
415
- }
416
- interface IAudioTrack extends ITrack<'AUDIO'> {
417
- channelCount: number;
418
- }
419
- interface ITextTrack extends ITrack<'TEXT'> {
420
- selection: 'default' | 'forced' | 'autoselect';
421
- }
422
- prepare(
423
- uri: string;
424
- x: number;
425
- y: number;
426
- width: number;
427
- height: number;
428
- options: {
429
- protocol: StreamProtocol;
430
- background?: boolean;
431
- autoReconnect?: boolean;
432
- autoReconnectInterval?: number;
433
- trackSelection?: {
434
- maxAudioChannelCount?: number;
435
- minVideoSize?: { width: number; height: number };
436
- maxVideoSize?: { width: number; height: number };
437
- preferredAudioLanguages?: string[];
438
- preferredTextLanguages?: string[];
439
- };
440
- drm?: {
441
- scheme: DrmScheme;
442
- licenseUri: string;
443
- licenseRequestHeaders: { [key: string]: string };
444
- };
445
- }
446
- ): Promise<void>;
447
- play(
448
- uri: string;
449
- x: number;
450
- y: number;
451
- width: number;
452
- height: number;
453
- options: {
454
- protocol: StreamProtocol;
455
- background?: boolean;
456
- autoReconnect?: boolean;
457
- autoReconnectInterval?: number;
458
- }
459
- ): Promise<void>;
460
- stop(
461
- uri: string,
462
- x: number,
463
- y: number,
464
- width: number,
465
- height: number
466
- ): Promise<void>;
467
- getTracks(videoId: IVideoProperties): Promise<ITrackInfo[]>;
468
- selectTrack(videoId: IVideoProperties, trackType: TrackType, groupId: string, trackIndex: number): Promise<void>;
469
- resetTrack(videoId: IVideoProperties, trackType: TrackType, groupId?: string): Promise<void>;
470
- onConnected(listener: (event: StreamEvent) => void): void;
471
- onDisconnected(listener: (event: StreamEvent) => void): void;
472
- onError(listener: (event: StreamErrorEvent) => void): void;
473
- onPlay(listener: (event: StreamEvent) => void): void;
474
- onStop(listener: (event: StreamEvent) => void): void;
475
- onPrepare(listener: (event: StreamEvent) => void): void;
476
- onTracksChanged(listener: (event: StreamTracksChangedEvent) => void): void;
477
- ```
478
-
479
- ## Errors
480
- Although we are doing our best, following errors may occur when working with the video stream.
481
-
482
-
483
- | Code | Type | Message |
484
- | ---- | ---- | ------- |
485
- | 41401 | AppletStreamError | Invalid stream protocol type: `protocol` |
486
- | 51301 | InternalStreamError | Couldn't stop the stream before playing the new one. |
487
- | 51301 | InternalStreamError | Couldn't stop the stream. |
488
- | 51302 | InternalStreamError | Couldn't prepare the stream. |
489
- | 51303 | InternalStreamError | Couldn't get stream tracks. |
490
- | 51304 | InternalStreamError | Couldn't select stream track. |
491
- | 51305 | InternalStreamError | Couldn't reset stream track.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes