@signageos/front-applet 5.12.2 → 6.1.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.
- package/CHANGELOG.md +15 -1
- package/dist/bundle.js +1 -1
- package/dist/bundle.js.map +1 -1
- package/docs/js-api/js-file-system.md +0 -5
- package/docs/js-api/js-video-stream.md +258 -41
- package/es6/FrontApplet/Browser/Browser.js.map +1 -1
- package/es6/FrontApplet/Browser/IOpenLinkOptions.js +18 -9
- package/es6/FrontApplet/Browser/IOpenLinkOptions.js.map +1 -1
- package/es6/FrontApplet/Browser/events.js.map +1 -1
- package/es6/FrontApplet/Browser/messages.d.ts +1 -1
- package/es6/FrontApplet/Command/Command.js +11 -5
- package/es6/FrontApplet/Command/Command.js.map +1 -1
- package/es6/FrontApplet/Command/ICommand.d.ts +1 -1
- package/es6/FrontApplet/Command/ICommandEvent.d.ts +2 -2
- package/es6/FrontApplet/Command/ICommandEventListener.d.ts +1 -1
- package/es6/FrontApplet/Debug/Debug.d.ts +3 -3
- package/es6/FrontApplet/Debug/Debug.js +5 -5
- package/es6/FrontApplet/Debug/Debug.js.map +1 -1
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.d.ts +1 -1
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.js +2 -2
- package/es6/FrontApplet/DeviceInfo/DeviceInfo.js.map +1 -1
- package/es6/FrontApplet/Dimensions/coordinationsHelper.js +2 -2
- package/es6/FrontApplet/Dimensions/coordinationsHelper.js.map +1 -1
- package/es6/FrontApplet/Display/Display.js.map +1 -1
- package/es6/FrontApplet/Error/AppletCommandError.js +1 -1
- package/es6/FrontApplet/Error/AppletCommandError.js.map +1 -1
- package/es6/FrontApplet/Error/AppletError.js +1 -1
- package/es6/FrontApplet/Error/AppletError.js.map +1 -1
- package/es6/FrontApplet/Error/AppletHardwareError.js +1 -1
- package/es6/FrontApplet/Error/AppletHardwareError.js.map +1 -1
- package/es6/FrontApplet/Error/AppletOfflineCacheError.js +1 -1
- package/es6/FrontApplet/Error/AppletOfflineCacheError.js.map +1 -1
- package/es6/FrontApplet/Error/AppletResourcesError.js +1 -1
- package/es6/FrontApplet/Error/AppletResourcesError.js.map +1 -1
- package/es6/FrontApplet/Error/AppletSecurityError.js +1 -1
- package/es6/FrontApplet/Error/AppletSecurityError.js.map +1 -1
- package/es6/FrontApplet/Error/AppletStreamError.js +1 -1
- package/es6/FrontApplet/Error/AppletStreamError.js.map +1 -1
- package/es6/FrontApplet/Error/AppletVideoError.js +1 -1
- package/es6/FrontApplet/Error/AppletVideoError.js.map +1 -1
- package/es6/FrontApplet/Error/ErrorCodesMessages.d.ts +1 -1
- package/es6/FrontApplet/Error/ErrorSuggestions.js.map +1 -1
- package/es6/FrontApplet/Error/FileNotFoundError.js +1 -1
- package/es6/FrontApplet/Error/FileNotFoundError.js.map +1 -1
- package/es6/FrontApplet/Error/SosError.js.map +1 -1
- package/es6/FrontApplet/Error/errorHelper.js +3 -7
- package/es6/FrontApplet/Error/errorHelper.js.map +1 -1
- package/es6/FrontApplet/Exchange/Exchange.d.ts +1 -1
- package/es6/FrontApplet/Exchange/Exchange.js.map +1 -1
- package/es6/FrontApplet/FileSystem/FileSystem.js.map +1 -1
- package/es6/FrontApplet/FileSystem/types.js +1 -1
- package/es6/FrontApplet/FileSystem/types.js.map +1 -1
- package/es6/FrontApplet/Font/fontFaceGenerator.js +4 -4
- package/es6/FrontApplet/Font/fontFaceGenerator.js.map +1 -1
- package/es6/FrontApplet/FrontApplet.js +1 -3
- package/es6/FrontApplet/FrontApplet.js.map +1 -1
- package/es6/FrontApplet/Hardware/Hardware.js.map +1 -1
- package/es6/FrontApplet/Hardware/Led/Led.js +3 -1
- package/es6/FrontApplet/Hardware/Led/Led.js.map +1 -1
- package/es6/FrontApplet/Hardware/SerialPort.d.ts +1 -1
- package/es6/FrontApplet/Hardware/SerialPort.js.map +1 -1
- package/es6/FrontApplet/Hash/generator.js.map +1 -1
- package/es6/FrontApplet/IMessage.d.ts +1 -1
- package/es6/FrontApplet/IPostMessage.d.ts +1 -1
- package/es6/FrontApplet/Iframe/Iframe.js +1 -1
- package/es6/FrontApplet/Iframe/Iframe.js.map +1 -1
- package/es6/FrontApplet/Input/IKeyUpEvent.d.ts +1 -1
- package/es6/FrontApplet/Input/IKeyUpEventListener.d.ts +1 -1
- package/es6/FrontApplet/Input/Input.js +7 -1
- package/es6/FrontApplet/Input/Input.js.map +1 -1
- package/es6/FrontApplet/Management/App.js.map +1 -1
- package/es6/FrontApplet/Management/Audio.js.map +1 -1
- package/es6/FrontApplet/Management/AutoRecovery.d.ts +2 -2
- package/es6/FrontApplet/Management/Debug.js.map +1 -1
- package/es6/FrontApplet/Management/Firmware.js.map +1 -1
- package/es6/FrontApplet/Management/IAutoRecovery.js.map +1 -1
- package/es6/FrontApplet/Management/INetworkInfo.js +3 -3
- package/es6/FrontApplet/Management/INetworkInfo.js.map +1 -1
- package/es6/FrontApplet/Management/IOrientation.d.ts +1 -1
- package/es6/FrontApplet/Management/IPeerRecovery.js.map +1 -1
- package/es6/FrontApplet/Management/Management.d.ts +1 -1
- package/es6/FrontApplet/Management/Management.js.map +1 -1
- package/es6/FrontApplet/Management/Network.js.map +1 -1
- package/es6/FrontApplet/Management/OS.js.map +1 -1
- package/es6/FrontApplet/Management/Package.js.map +1 -1
- package/es6/FrontApplet/Management/PeerRecovery.d.ts +2 -2
- package/es6/FrontApplet/Management/PeerRecovery.js +3 -3
- package/es6/FrontApplet/Management/PeerRecovery.js.map +1 -1
- package/es6/FrontApplet/Management/Power.js +28 -5
- package/es6/FrontApplet/Management/Power.js.map +1 -1
- package/es6/FrontApplet/Management/Proxy.js.map +1 -1
- package/es6/FrontApplet/Management/RemoteControl.js.map +1 -1
- package/es6/FrontApplet/Management/Screen.js +12 -2
- package/es6/FrontApplet/Management/Screen.js.map +1 -1
- package/es6/FrontApplet/Management/Security.js.map +1 -1
- package/es6/FrontApplet/Management/Time.js.map +1 -1
- package/es6/FrontApplet/Management/Wifi.js.map +1 -1
- package/es6/FrontApplet/Management/helpers/SecurityHelper.js +3 -1
- package/es6/FrontApplet/Management/helpers/SecurityHelper.js.map +1 -1
- package/es6/FrontApplet/Monitors/Monitors.js.map +1 -1
- package/es6/FrontApplet/OSD/OSD.js +2 -2
- package/es6/FrontApplet/OSD/OSD.js.map +1 -1
- package/es6/FrontApplet/Offline/Cache/Cache.d.ts +2 -2
- package/es6/FrontApplet/Offline/Cache/Cache.js.map +1 -1
- package/es6/FrontApplet/Offline/Cache/IChecksumMessage.d.ts +1 -1
- package/es6/FrontApplet/Offline/Cache/IFile.d.ts +1 -1
- package/es6/FrontApplet/Offline/Cache/IListedContentsMessage.d.ts +1 -1
- package/es6/FrontApplet/Offline/Cache/IListedFilesMessage.d.ts +1 -1
- package/es6/FrontApplet/Offline/Cache/ILoadedContentMessage.d.ts +1 -1
- package/es6/FrontApplet/Offline/Cache/ILoadedFileMessage.d.ts +1 -1
- package/es6/FrontApplet/Offline/Cache/ISavedContentMessage.d.ts +1 -1
- package/es6/FrontApplet/Offline/Cache/ISavedContents.d.ts +1 -1
- package/es6/FrontApplet/Offline/Cache/ISavedFileMessage.d.ts +1 -1
- package/es6/FrontApplet/Offline/Cache/ISavedFiles.d.ts +1 -1
- package/es6/FrontApplet/Offline/Cache/IValidatedChecksumMessage.d.ts +1 -1
- package/es6/FrontApplet/Offline/Flags/AppendFlagController.js +1 -1
- package/es6/FrontApplet/Offline/Flags/AppendFlagController.js.map +1 -1
- package/es6/FrontApplet/Offline/Flags/IFlag.d.ts +1 -1
- package/es6/FrontApplet/Offline/Flags/IFlag.js +2 -2
- package/es6/FrontApplet/Offline/Flags/IFlag.js.map +1 -1
- package/es6/FrontApplet/Offline/Flags/IFlagController.d.ts +1 -1
- package/es6/FrontApplet/Offline/Flags/IFlags.d.ts +1 -1
- package/es6/FrontApplet/Offline/IAddFont.js.map +1 -1
- package/es6/FrontApplet/Offline/IElement.d.ts +1 -1
- package/es6/FrontApplet/Offline/IElement.js.map +1 -1
- package/es6/FrontApplet/Offline/IFileType.d.ts +1 -1
- package/es6/FrontApplet/Offline/IFileType.js.map +1 -1
- package/es6/FrontApplet/Offline/ISaveFile.d.ts +2 -2
- package/es6/FrontApplet/Offline/ISaveFile.js +10 -5
- package/es6/FrontApplet/Offline/ISaveFile.js.map +1 -1
- package/es6/FrontApplet/Offline/LoadFile/CssLoadFileController.js.map +1 -1
- package/es6/FrontApplet/Offline/LoadFile/ILoadFile.d.ts +1 -1
- package/es6/FrontApplet/Offline/LoadFile/ILoadFileController.d.ts +1 -1
- package/es6/FrontApplet/Offline/LoadFile/JavascriptLoadFileController.js.map +1 -1
- package/es6/FrontApplet/Offline/Offline.js +2 -7
- package/es6/FrontApplet/Offline/Offline.js.map +1 -1
- package/es6/FrontApplet/Offline/Types.js +3 -3
- package/es6/FrontApplet/Offline/Types.js.map +1 -1
- package/es6/FrontApplet/ProofOfPlay/ProofOfPlay.js.map +1 -1
- package/es6/FrontApplet/Sensors/Proximity.js.map +1 -1
- package/es6/FrontApplet/Sensors/Sensors.js.map +1 -1
- package/es6/FrontApplet/Stream/IStreamMessage.d.ts +2 -4
- package/es6/FrontApplet/Stream/IStreamTrackInfo.d.ts +23 -0
- package/es6/FrontApplet/Stream/{IStreamEventListener.js → IStreamTrackInfo.js} +1 -1
- package/es6/FrontApplet/Stream/IStreamTrackInfo.js.map +1 -0
- package/es6/FrontApplet/Stream/Stream.d.ts +13 -7
- package/es6/FrontApplet/Stream/Stream.js +101 -17
- package/es6/FrontApplet/Stream/Stream.js.map +1 -1
- package/es6/FrontApplet/Stream/streamEventProperties.d.ts +21 -0
- package/es6/FrontApplet/Stream/{IStreamEventProperties.js → streamEventProperties.js} +1 -1
- package/es6/FrontApplet/Stream/streamEventProperties.js.map +1 -0
- package/es6/FrontApplet/Stream/streamEvents.d.ts +13 -0
- package/es6/FrontApplet/Stream/streamEvents.js +3 -0
- package/es6/FrontApplet/Stream/streamEvents.js.map +1 -0
- package/es6/FrontApplet/Stream/streamListeners.d.ts +10 -0
- package/es6/FrontApplet/Stream/streamListeners.js +3 -0
- package/es6/FrontApplet/Stream/streamListeners.js.map +1 -0
- package/es6/FrontApplet/Sync/Sync.d.ts +1 -1
- package/es6/FrontApplet/Sync/Sync.js +6 -3
- package/es6/FrontApplet/Sync/Sync.js.map +1 -1
- package/es6/FrontApplet/Timing/Timing.js.map +1 -1
- package/es6/FrontApplet/Timing/Triggers/Triggers.js.map +1 -1
- package/es6/FrontApplet/Touch/Touch.js +1 -1
- package/es6/FrontApplet/Touch/Touch.js.map +1 -1
- package/es6/FrontApplet/Validate/Validate.d.ts +2 -2
- package/es6/FrontApplet/Validate/Validate.js +17 -29
- package/es6/FrontApplet/Validate/Validate.js.map +1 -1
- package/es6/FrontApplet/Validate/ValidateObjectInterface.js +4 -7
- package/es6/FrontApplet/Validate/ValidateObjectInterface.js.map +1 -1
- package/es6/FrontApplet/Video/IOptions.d.ts +25 -0
- package/es6/FrontApplet/Video/IVideoEvent.d.ts +1 -1
- package/es6/FrontApplet/Video/IVideoEvent.js +1 -3
- package/es6/FrontApplet/Video/IVideoEvent.js.map +1 -1
- package/es6/FrontApplet/Video/IVideoEventListener.d.ts +1 -1
- package/es6/FrontApplet/Video/IVideoMessage.d.ts +1 -1
- package/es6/FrontApplet/Video/IVideoProperties.d.ts +1 -1
- package/es6/FrontApplet/Video/Video.js +7 -7
- package/es6/FrontApplet/Video/Video.js.map +1 -1
- package/es6/FrontApplet/createFrontApplet.js.map +1 -1
- package/es6/Monitoring/Console/consoleCommands.js.map +1 -1
- package/es6/Monitoring/FileSystem/fileSystemCommands.d.ts +1 -1
- package/es6/Monitoring/FileSystem/fileSystemCommands.js +32 -32
- package/es6/Monitoring/FileSystem/fileSystemCommands.js.map +1 -1
- package/es6/Monitoring/Html/htmlCommands.js.map +1 -1
- package/es6/Monitoring/Montoring.js.map +1 -1
- package/es6/Monitoring/Offline/Cache/offlineCacheCommands.d.ts +1 -1
- package/es6/Monitoring/Offline/Cache/offlineCacheCommands.js +2 -2
- package/es6/Monitoring/Offline/Cache/offlineCacheCommands.js.map +1 -1
- package/es6/Monitoring/Timing/timingCommands.js.map +1 -1
- package/es6/Monitoring/Video/videoCommands.js.map +1 -1
- package/es6/Monitoring/monitoringCommands.js.map +1 -1
- package/es6/bundle.js.map +1 -1
- package/package.json +17 -5
- package/es6/FrontApplet/Stream/IStreamEvent.d.ts +0 -9
- package/es6/FrontApplet/Stream/IStreamEvent.js +0 -5
- package/es6/FrontApplet/Stream/IStreamEvent.js.map +0 -1
- package/es6/FrontApplet/Stream/IStreamEventListener.d.ts +0 -5
- package/es6/FrontApplet/Stream/IStreamEventListener.js.map +0 -1
- package/es6/FrontApplet/Stream/IStreamEventProperties.d.ts +0 -12
- package/es6/FrontApplet/Stream/IStreamEventProperties.js.map +0 -1
|
@@ -653,11 +653,6 @@ await sos.fileSystem.appendFile(
|
|
|
653
653
|
## readFile()
|
|
654
654
|
Read a text file.
|
|
655
655
|
|
|
656
|
-
::: alert alert--warning
|
|
657
|
-
**LG webOS limitation**:
|
|
658
|
-
It's possible to handle only files up to **~10KB** on webOS devices. At the moment we are working on the solution regarding the file/s 'manipulation' on LG devices.
|
|
659
|
-
:::
|
|
660
|
-
|
|
661
656
|
### Parameters
|
|
662
657
|
|
|
663
658
|
| Param | Type | Required | Description |
|
|
@@ -21,18 +21,27 @@ Methods to play or stop video streams.
|
|
|
21
21
|
| `prepare()` | Prepare video stream in the background | 4.7.0 |
|
|
22
22
|
| `play()` | Start playing video stream | 1.0.18 |
|
|
23
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 |
|
|
24
27
|
| `onConnected()` | Calls a listener callback when stream connects | 1.0.20 |
|
|
25
28
|
| `onDisconnected()` | Calls a listener callback when stream disconnects | 1.0.20 |
|
|
26
29
|
| `onError()` | Calls a listener callback when an unexpected stream error occurs | 1.0.20 |
|
|
27
30
|
| `onPlay()` | Calls a listener callback when stream starts playing | 5.12.0 |
|
|
28
31
|
| `onStop()` | Calls a listener callback when stream stops | 5.12.0 |
|
|
29
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 |
|
|
30
34
|
:::
|
|
31
35
|
|
|
32
36
|
::: alert alert--warning
|
|
33
37
|
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).
|
|
34
38
|
:::
|
|
35
39
|
|
|
40
|
+
::: alert alert--danger
|
|
41
|
+
Be aware version of JS API (v6.0.0+) changed how stream functions `play()` and `prepare()` work. For using an options object
|
|
42
|
+
you need to our latest core app versions. If you are using older core app versions, you need to use deprecated format.
|
|
43
|
+
:::
|
|
44
|
+
|
|
36
45
|
## prepare()
|
|
37
46
|
Calls the internal player and prepares a video stream in memory, so it can later start playing instantaneously.
|
|
38
47
|
|
|
@@ -49,24 +58,54 @@ If you want to play a video stream in full screen mode, use x = y = 0 and width
|
|
|
49
58
|
| `y` | Number | <div class="red">Yes</div> | Stream y-position on the screen |
|
|
50
59
|
| `width` | Number | <div class="red">Yes</div> | Stream width on the screen |
|
|
51
60
|
| `height` | Number | <div class="red">Yes</div> | Stream height on the screen |
|
|
52
|
-
| `
|
|
53
|
-
|^^|^^|^^| Types: `HLS`, `RTP`, `HTTP`, `UDP`, `RTMP`, `RTSP`. |
|
|
54
|
-
| `options` | Object | <div class="red">No</div> | Additional options for the stream |
|
|
61
|
+
| `options` | Object | <div class="red">Yes</div> | Additional options for the stream |
|
|
55
62
|
:::
|
|
56
63
|
|
|
57
64
|
### Options object
|
|
58
65
|
::: table-responsive
|
|
59
66
|
| Key | Type | Required | Description |
|
|
60
67
|
| ------------ | --------------------------- | :--------------------------: | --------------------------------------------- |
|
|
61
|
-
| `
|
|
68
|
+
| `protocol` | String | <div class="red">Yes</div> | Protocol that the stream is using |
|
|
69
|
+
|^^|^^|^^| Types: `HLS`, `RTP`, `HTTP`, `UDP`, `RTMP`, `RTSP`. |
|
|
70
|
+
| `background` | Boolean | <div class="yellow">No</div> | Prepare stream in the background |
|
|
71
|
+
| `trackSelection`| Object | <div class="yellow">No</div> | Track selection options |
|
|
72
|
+
| `drm` | Object | <div class="yellow">No</div> | DRM options |
|
|
73
|
+
:::
|
|
74
|
+
|
|
75
|
+
### Track selection object
|
|
76
|
+
::: table-responsive
|
|
77
|
+
| Key | Type | Required | Description |
|
|
78
|
+
| ------------ | --------------------------- | :--------------------------: | --------------------------------------------- |
|
|
79
|
+
| `maxAudioChannelCount` | Number | <div class="yellow">No</div> | Maximum number of audio channels to play |
|
|
80
|
+
| `minVideoSize` | Object | <div class="yellow">No</div> | Minimum video size to play |
|
|
81
|
+
|^^|^^|^^| Object with `width` and `height` properties |
|
|
82
|
+
| `maxVideoSize` | Object | <div class="yellow">No</div> | Maximum video size to play |
|
|
83
|
+
|^^|^^|^^| Object with `width` and `height` properties |
|
|
84
|
+
| `preferredAudioLanguages` | Array of strings | <div class="yellow">No</div> | Preferred audio languages to play |
|
|
85
|
+
| `preferredTextLanguages` | Array of strings | <div class="yellow">No</div> | Preferred text languages to play |
|
|
62
86
|
:::
|
|
63
87
|
|
|
88
|
+
### DRM object
|
|
89
|
+
::: table-responsive
|
|
90
|
+
| Key | Type | Required | Description |
|
|
91
|
+
| ------------ | --------------------------- | :--------------------------: | --------------------------------------------- |
|
|
92
|
+
| `scheme` | String | <div class="red">Yes</div> | DRM scheme |
|
|
93
|
+
|^^|^^|^^| Types: `CommonPSSH`, `ClearKey`, `Widevine`, `PlayReady` or own value |
|
|
94
|
+
| `licenseUri` | String | <div class="red">Yes</div> | DRM license URI |
|
|
95
|
+
| `licenseRequestHeaders` | Object | <div class="yellow">No</div> | DRM license request headers |
|
|
96
|
+
:::
|
|
97
|
+
|
|
98
|
+
|
|
64
99
|
### Javascript syntax
|
|
65
100
|
```javascript
|
|
66
|
-
|
|
101
|
+
// Example with specific protocol type
|
|
102
|
+
await sos.stream.prepare(uri, x, y, width, height, { protocol: 'HTTP' });
|
|
67
103
|
|
|
68
104
|
// Example with options - prepare stream in the background
|
|
69
|
-
await sos.stream.prepare(uri, x, y, width, height,
|
|
105
|
+
await sos.stream.prepare(uri, x, y, width, height, { protocol: 'HTTP', background: true });
|
|
106
|
+
|
|
107
|
+
// Deprecated format
|
|
108
|
+
await sos.stream.prepare(uri, x, y, width, height, 'HTTP');
|
|
70
109
|
```
|
|
71
110
|
|
|
72
111
|
<div class="row d-flex align-content-stretch force-padding-20">
|
|
@@ -101,30 +140,37 @@ If you want to play a video stream in full screen mode, use x = y = 0 and width
|
|
|
101
140
|
| `y` | Number | <div class="red">Yes</div> | Stream y-position on the screen |
|
|
102
141
|
| `width` | Number | <div class="red">Yes</div> | Stream width on the screen |
|
|
103
142
|
| `height` | Number | <div class="red">Yes</div> | Stream height on the screen |
|
|
104
|
-
| `
|
|
105
|
-
|^^|^^|^^| Types: `HLS`, `RTP`, `HTTP`, `UDP`, `RTMP`, `RTSP`. |
|
|
106
|
-
| `options` | Object | <div class="red">No</div> | Additional options for the stream |
|
|
143
|
+
| `options` | Object | <div class="red">Yes</div> | Additional options for the stream |
|
|
107
144
|
:::
|
|
108
145
|
|
|
109
146
|
### Options object
|
|
110
147
|
::: table-responsive
|
|
111
148
|
| Key | Type | Required | Description |
|
|
112
149
|
| ------------ | --------------------------- | :--------------------------: | --------------------------------------------- |
|
|
113
|
-
| `
|
|
150
|
+
| `protocol` | String | <div class="red">Yes</div> | Protocol that the stream is using |
|
|
151
|
+
|^^|^^|^^| Types: `HLS`, `RTP`, `HTTP`, `UDP`, `RTMP`, `RTSP`. |
|
|
152
|
+
| `autoReconnect` | Boolean | <div class="yellow">No</div> | Automatically reconnect stream when it disconnects |
|
|
114
153
|
|^^|^^|^^| Default value: false |
|
|
115
|
-
| `autoReconnectInterval` | Number | <div class="
|
|
154
|
+
| `autoReconnectInterval` | Number | <div class="yellow">No</div> | Interval in miliseconds between reconnect attempts |
|
|
116
155
|
|^^|^^|^^| Default value: 30000 ms |
|
|
156
|
+
| `volume` | Number | <div class="yellow">No</div> | Volume of the stream |
|
|
157
|
+
| `trackSelection`| Object | <div class="yellow">No</div> | Track selection options |
|
|
158
|
+
| `drm` | Object | <div class="yellow">No</div> | DRM options |
|
|
117
159
|
:::
|
|
118
160
|
|
|
119
161
|
### Javascript syntax
|
|
120
162
|
```javascript
|
|
121
|
-
|
|
163
|
+
// Example with specific protocol type
|
|
164
|
+
await sos.stream.play(uri, x, y, width, height, { protocol: 'HTTP' });
|
|
122
165
|
|
|
123
|
-
// Example with options - enable auto reconnect
|
|
124
|
-
await sos.stream.play(uri, x, y, width, height,
|
|
166
|
+
// Example with other options - enable auto reconnect
|
|
167
|
+
await sos.stream.play(uri, x, y, width, height, { protocol: 'HTTP', autoReconnect: true });
|
|
125
168
|
|
|
126
|
-
// Example with options - reconnect every 10 seconds
|
|
127
|
-
await sos.stream.play(uri, x, y, width, height,
|
|
169
|
+
// Example with other options - reconnect every 10 seconds
|
|
170
|
+
await sos.stream.play(uri, x, y, width, height, { protocol: 'HTTP', autoReconnect: true, autoReconnectInterval: 10000 });
|
|
171
|
+
|
|
172
|
+
// Deprecated format
|
|
173
|
+
await sos.stream.play(uri, x, y, width, height, 'HTTP')
|
|
128
174
|
```
|
|
129
175
|
|
|
130
176
|
<div class="row d-flex align-content-stretch force-padding-20">
|
|
@@ -162,6 +208,84 @@ await sos.stream.stop(uri, x, y, width, height);
|
|
|
162
208
|
| `height` | Number | <div class="red">Yes</div> | Stream height on the screen |
|
|
163
209
|
:::
|
|
164
210
|
|
|
211
|
+
## getTracks()
|
|
212
|
+
Get all tracks of the selected stream.
|
|
213
|
+
|
|
214
|
+
### Javascript syntax
|
|
215
|
+
```javascript
|
|
216
|
+
const videoId = {
|
|
217
|
+
uri: 'http://example.com/stream.m3u8',
|
|
218
|
+
x: 0,
|
|
219
|
+
y: 0,
|
|
220
|
+
width: 1920,
|
|
221
|
+
height: 1080,
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
const tracks = await sos.stream.getTracks(videoId); // Promise<ITrackInfo[]>
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### Parameters:
|
|
228
|
+
::: table-responsive
|
|
229
|
+
| Param | Type | Required | Description |
|
|
230
|
+
| -------------- | --------------------------- | :------------------------: | --------------------------------------------- |
|
|
231
|
+
| `videoId` | Object | <div class="red">Yes</div> | Video ID object of selected stream |
|
|
232
|
+
:::
|
|
233
|
+
|
|
234
|
+
### Example of returned value
|
|
235
|
+
```javascript
|
|
236
|
+
[
|
|
237
|
+
{
|
|
238
|
+
trackType: 'VIDEO', // string - AUDIO, VIDEO, TEXT
|
|
239
|
+
mimeType: 'video/mp4', // string
|
|
240
|
+
videoSize: { // object
|
|
241
|
+
width: 1920, // number
|
|
242
|
+
height: 1080, // number
|
|
243
|
+
},
|
|
244
|
+
groupId: '1', // string
|
|
245
|
+
trackIndex: 1, // number
|
|
246
|
+
selected: true, // boolean
|
|
247
|
+
language: 'en', // string
|
|
248
|
+
supported: true, // boolean
|
|
249
|
+
}
|
|
250
|
+
]
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
## selectTrack()
|
|
254
|
+
Select track of the selected stream.
|
|
255
|
+
|
|
256
|
+
### Javascript syntax
|
|
257
|
+
```javascript
|
|
258
|
+
await sos.stream.selectTrack(videoId, trackType, groupId, trackIndex); // Promise<void>
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Parameters:
|
|
262
|
+
::: table-responsive
|
|
263
|
+
| Param | Type | Required | Description |
|
|
264
|
+
| -------------- | --------------------------- | :------------------------: | --------------------------------------------- |
|
|
265
|
+
| `videoId` | Object | <div class="red">Yes</div> | Video ID object of selected stream |
|
|
266
|
+
| `trackType` | String | <div class="red">Yes</div> | Track type - `AUDIO`, `VIDEO`, `TEXT` |
|
|
267
|
+
| `groupId` | String | <div class="red">Yes</div> | Group ID of selected track |
|
|
268
|
+
| `trackIndex` | Number | <div class="red">Yes</div> | Index of selected track |
|
|
269
|
+
:::
|
|
270
|
+
|
|
271
|
+
## resetTrack()
|
|
272
|
+
Reset track of the selected stream.
|
|
273
|
+
|
|
274
|
+
### Javascript syntax
|
|
275
|
+
```javascript
|
|
276
|
+
await sos.stream.resetTrack(videoId, trackType); // Promise<void>
|
|
277
|
+
await sos.stream.resetTrack(videoId, trackType, groupId); // Promise<void>
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
### Parameters:
|
|
281
|
+
::: table-responsive
|
|
282
|
+
| Param | Type | Required | Description |
|
|
283
|
+
| -------------- | --------------------------- | :------------------------: | --------------------------------------------- |
|
|
284
|
+
| `videoId` | Object | <div class="red">Yes</div> | Video ID object of selected stream |
|
|
285
|
+
| `trackType` | String | <div class="red">Yes</div> | Track type - `AUDIO`, `VIDEO`, `TEXT` |
|
|
286
|
+
| `groupId` | String | <div class="yellow">No</div> | Group ID of selected track |
|
|
287
|
+
:::
|
|
288
|
+
|
|
165
289
|
## Event onConnected()
|
|
166
290
|
Calls a listener callback everytime `connected` event is emitted.
|
|
167
291
|
|
|
@@ -222,38 +346,76 @@ sos.stream.onPrepare((event) => {
|
|
|
222
346
|
});
|
|
223
347
|
```
|
|
224
348
|
|
|
349
|
+
## Event onTracksChanged()
|
|
350
|
+
Calls a listener callback everytime `tracks_changed` event is emitted.
|
|
351
|
+
|
|
352
|
+
### Javascript syntax
|
|
353
|
+
```javascript
|
|
354
|
+
sos.stream.onTracksChanged((event) => {
|
|
355
|
+
// do something
|
|
356
|
+
});
|
|
357
|
+
```
|
|
358
|
+
|
|
225
359
|
## Stream events
|
|
226
360
|
All stream events have the same format.
|
|
227
361
|
|
|
228
|
-
`type` property contains string with the event type. Type can be `connected`, `disconnected` or `
|
|
362
|
+
`type` property contains string with the event type. Type can be `connected`, `disconnected`, `error` or `tracks_changed`.
|
|
229
363
|
|
|
230
364
|
`srcArguments` property contains parameters of the source stream, that emitted the event.
|
|
231
365
|
That way, if multiple streams are playing at once, you can associate the events with each stream instance.
|
|
232
366
|
|
|
233
|
-
Example event:
|
|
367
|
+
Example of **connected**, **disconnected** event:
|
|
234
368
|
```json
|
|
235
369
|
{
|
|
236
|
-
"type": "
|
|
370
|
+
"type": "<type>",
|
|
237
371
|
"srcArguments": {
|
|
238
372
|
"uri": "<uri>",
|
|
239
373
|
"x": 0,
|
|
240
374
|
"y": 0,
|
|
241
375
|
"width": 1920,
|
|
242
376
|
"height": 1080,
|
|
243
|
-
"protocol": "
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
377
|
+
"protocol": "HTTP"
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
Example of **tracks_changed** event:
|
|
383
|
+
```json
|
|
384
|
+
{
|
|
385
|
+
"type": "tracks_changed",
|
|
386
|
+
"srcArguments": {
|
|
387
|
+
"uri": "<uri>",
|
|
388
|
+
"x": 0,
|
|
389
|
+
"y": 0,
|
|
390
|
+
"width": 1920,
|
|
391
|
+
"height": 1080,
|
|
392
|
+
"tracks": [] // Array of ITrackInfo
|
|
249
393
|
}
|
|
250
394
|
}
|
|
251
395
|
```
|
|
252
396
|
|
|
397
|
+
Example of **error** event:
|
|
398
|
+
```json
|
|
399
|
+
{
|
|
400
|
+
"type": "error",
|
|
401
|
+
"srcArguments": {
|
|
402
|
+
"uri": "<uri>",
|
|
403
|
+
"x": 0,
|
|
404
|
+
"y": 0,
|
|
405
|
+
"width": 1920,
|
|
406
|
+
"height": 1080,
|
|
407
|
+
"protocol": "HTTP"
|
|
408
|
+
},
|
|
409
|
+
"errorMessage": "Some error message"
|
|
410
|
+
}
|
|
411
|
+
```
|
|
412
|
+
|
|
253
413
|
## Usage with Typescript
|
|
254
414
|
You can also use all these methods with [signageOS TypeScript](https://docs.signageos.io/hc/en-us/articles/4405069154962#signageos-typescript).
|
|
255
415
|
|
|
256
416
|
```typescript
|
|
417
|
+
type StreamProtocol = 'HLS' | 'RTP' | 'HTTP' | 'UDP' | 'RTMP' | 'RTSP';
|
|
418
|
+
type DrmScheme = "CommonPSSH" | "ClearKey" | "Widevine" | "PlayReady" | string;
|
|
257
419
|
interface StreamEvent {
|
|
258
420
|
type: 'connected' | 'disconnected' | 'error' | 'stop' | 'prepare' | 'play',
|
|
259
421
|
srcArguments: {
|
|
@@ -262,40 +424,91 @@ interface StreamEvent {
|
|
|
262
424
|
y: number;
|
|
263
425
|
width: number;
|
|
264
426
|
height: number;
|
|
265
|
-
protocol
|
|
427
|
+
protocol?: StreamProtocol;
|
|
266
428
|
},
|
|
267
|
-
|
|
429
|
+
}
|
|
430
|
+
interface IVideoProperties {
|
|
431
|
+
uri: string;
|
|
432
|
+
x: number;
|
|
433
|
+
y: number;
|
|
434
|
+
width: number;
|
|
435
|
+
height: number;
|
|
436
|
+
}
|
|
437
|
+
type TrackType = 'AUDIO' | 'VIDEO' | 'TEXT';
|
|
438
|
+
type ITrackInfo = IVideoTrack | IAudioTrack | ITextTrack;
|
|
439
|
+
interface ITrack<T extends TrackType> {
|
|
440
|
+
trackType: T;
|
|
441
|
+
mimeType: string;
|
|
442
|
+
groupId: string;
|
|
443
|
+
trackIndex: number;
|
|
444
|
+
selected: boolean;
|
|
445
|
+
language: string | null;
|
|
446
|
+
supported: boolean;
|
|
447
|
+
}
|
|
448
|
+
interface IVideoTrack extends ITrack<'VIDEO'> {
|
|
449
|
+
videoSize: { width: number; height: number };
|
|
450
|
+
}
|
|
451
|
+
interface IAudioTrack extends ITrack<'AUDIO'> {
|
|
452
|
+
channelCount: number;
|
|
453
|
+
}
|
|
454
|
+
interface ITextTrack extends ITrack<'TEXT'> {
|
|
455
|
+
selection: 'default' | 'forced' | 'autoselect';
|
|
456
|
+
}
|
|
457
|
+
prepare(
|
|
458
|
+
uri: string;
|
|
459
|
+
x: number;
|
|
460
|
+
y: number;
|
|
461
|
+
width: number;
|
|
462
|
+
height: number;
|
|
463
|
+
options: {
|
|
464
|
+
protocol: StreamProtocol;
|
|
268
465
|
background?: boolean;
|
|
269
466
|
autoReconnect?: boolean;
|
|
270
467
|
autoReconnectInterval?: number;
|
|
468
|
+
trackSelection?: {
|
|
469
|
+
maxAudioChannelCount?: number;
|
|
470
|
+
minVideoSize?: { width: number; height: number };
|
|
471
|
+
maxVideoSize?: { width: number; height: number };
|
|
472
|
+
preferredAudioLanguages?: string[];
|
|
473
|
+
preferredTextLanguages?: string[];
|
|
474
|
+
};
|
|
475
|
+
drm?: {
|
|
476
|
+
scheme: DrmScheme;
|
|
477
|
+
licenseUri: string;
|
|
478
|
+
licenseRequestHeaders: { [key: string]: string };
|
|
479
|
+
};
|
|
271
480
|
}
|
|
272
|
-
|
|
481
|
+
): Promise<void>;
|
|
273
482
|
play(
|
|
274
|
-
uri:
|
|
275
|
-
x:
|
|
276
|
-
y:
|
|
277
|
-
width:
|
|
278
|
-
height:
|
|
279
|
-
|
|
280
|
-
|
|
483
|
+
uri: string;
|
|
484
|
+
x: number;
|
|
485
|
+
y: number;
|
|
486
|
+
width: number;
|
|
487
|
+
height: number;
|
|
488
|
+
options: {
|
|
489
|
+
protocol: StreamProtocol;
|
|
281
490
|
background?: boolean;
|
|
282
491
|
autoReconnect?: boolean;
|
|
283
492
|
autoReconnectInterval?: number;
|
|
284
493
|
}
|
|
285
494
|
): Promise<void>;
|
|
286
495
|
stop(
|
|
287
|
-
uri:
|
|
288
|
-
x:
|
|
289
|
-
y:
|
|
290
|
-
width:
|
|
291
|
-
height:
|
|
496
|
+
uri: string,
|
|
497
|
+
x: number,
|
|
498
|
+
y: number,
|
|
499
|
+
width: number,
|
|
500
|
+
height: number
|
|
292
501
|
): Promise<void>;
|
|
502
|
+
getTracks(videoId: IVideoProperties): Promise<ITrackInfo[]>;
|
|
503
|
+
selectTrack(videoId: IVideoProperties, trackType: TrackType, groupId: string, trackIndex: number): Promise<void>;
|
|
504
|
+
resetTrack(videoId: IVideoProperties, trackType: TrackType, groupId?: string): Promise<void>;
|
|
293
505
|
onConnected(listener: (event: StreamEvent) => void): void;
|
|
294
506
|
onDisconnected(listener: (event: StreamEvent) => void): void;
|
|
295
|
-
onError(listener: (event:
|
|
507
|
+
onError(listener: (event: StreamErrorEvent) => void): void;
|
|
296
508
|
onPlay(listener: (event: StreamEvent) => void): void;
|
|
297
509
|
onStop(listener: (event: StreamEvent) => void): void;
|
|
298
510
|
onPrepare(listener: (event: StreamEvent) => void): void;
|
|
511
|
+
onTracksChanged(listener: (event: StreamTracksChangedEvent) => void): void;
|
|
299
512
|
```
|
|
300
513
|
|
|
301
514
|
## Errors
|
|
@@ -307,4 +520,8 @@ Although we are doing our best, following errors may occur when working with the
|
|
|
307
520
|
| 41401 | AppletStreamError | Invalid stream protocol type: `protocol` |
|
|
308
521
|
| 51301 | InternalStreamError | Couldn't stop the stream before playing the new one. |
|
|
309
522
|
| 51301 | InternalStreamError | Couldn't stop the stream. |
|
|
523
|
+
| 51302 | InternalStreamError | Couldn't prepare the stream. |
|
|
524
|
+
| 51303 | InternalStreamError | Couldn't get stream tracks. |
|
|
525
|
+
| 51304 | InternalStreamError | Couldn't select stream track. |
|
|
526
|
+
| 51305 | InternalStreamError | Couldn't reset stream track. |
|
|
310
527
|
:::
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Browser.js","sourceRoot":"","sources":["../../../src/FrontApplet/Browser/Browser.ts"],"names":[],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Browser.js","sourceRoot":"","sources":["../../../src/FrontApplet/Browser/Browser.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,yDAAmF;AAEnF,mDAA4C;AAC5C,qCAA8D;AAC9D,mCAAsC;AAItC,MAAqB,OAAO;IAG3B,YAA6B,QAAwB;QAAxB,aAAQ,GAAR,QAAQ,CAAgB;QAFpC,WAAM,GAAiB,IAAI,qBAAY,EAAE,CAAC;IAEH,CAAC;IAE5C,IAAI,CAAC,GAAW,EAAE,UAA4B,EAAE;;;YAC5D,kBAAQ,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC;YACnC,kBAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,oCAAiB,CAAC,CAAC;YAE3D,MAAM,YAAY,GAAG,MAAA,OAAO,CAAC,YAAY,mCAAI,IAAI,CAAC;YAClD,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,+BAC9B,GAAG,IACA,OAAO,KACV,YAAY,EACZ,IAAI,EAAE,MAAM,IACX,CAAC;;KACH;IAEY,KAAK;;YACjB,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;gBAC/B,IAAI,EAAE,OAAO;aACb,CAAC,CAAC;QACJ,CAAC;KAAA;IAED;;;;;;;OAOG;IACI,OAAO,CAAC,QAAqC;QACnD,kBAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC;QAE7C,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,kBAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACnD,OAAO,GAAG,EAAE;YACX,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,kBAAS,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACvD,CAAC,CAAC;IACH,CAAC;IAEM,iBAAiB,CAAC,IAAqB;QAC7C,QAAQ,IAAI,CAAC,IAAI,EAAE;YAClB,KAAK,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,QAAQ,CAAC;gBAC7C,MAAM,KAAK,GAAe;oBACzB,IAAI,EAAE,kBAAS,CAAC,KAAK;oBACrB,MAAM,EAAE,IAAI,CAAC,MAAqB;iBAClC,CAAC;gBACF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;gBACzC,MAAM;YACP,QAAQ;SACR;IACF,CAAC;IAED,iDAAiD;IACpC,QAAQ,CAAC,GAAW,EAAE,UAAsC,EAAE;;YAC1E,OAAO,CAAC,IAAI,CAAC,kHAAkH,CAAC,CAAC;YAEjI,kBAAQ,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,CAAC;YACnC,kBAAQ,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,CAAC;YAE1C,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,+BAC9B,GAAG,IACA,OAAO,KACV,YAAY,EAAE,KAAK,EACnB,IAAI,EAAE,WAAW,IAChB,CAAC;QACJ,CAAC;KAAA;CACD;AApED,0BAoEC"}
|
|
@@ -3,27 +3,34 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.VIOpenLinkOptions = exports.VITheme = void 0;
|
|
4
4
|
exports.VITheme = {
|
|
5
5
|
base: { '?string': ['light', 'dark'] },
|
|
6
|
-
shape: {
|
|
6
|
+
shape: {
|
|
7
|
+
'?object': {
|
|
7
8
|
cornerSize: '?number',
|
|
8
9
|
},
|
|
9
10
|
},
|
|
10
|
-
colors: {
|
|
11
|
+
colors: {
|
|
12
|
+
'?object': {
|
|
11
13
|
primary: '?string',
|
|
12
14
|
background: '?string',
|
|
13
15
|
control: '?string',
|
|
14
16
|
},
|
|
15
17
|
},
|
|
16
|
-
widgets: {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
widgets: {
|
|
19
|
+
'?object': {
|
|
20
|
+
editAddress: {
|
|
21
|
+
'?object': {
|
|
22
|
+
colors: {
|
|
23
|
+
'?object': {
|
|
19
24
|
background: '?string',
|
|
20
25
|
text: '?string',
|
|
21
26
|
},
|
|
22
27
|
},
|
|
23
28
|
},
|
|
24
29
|
},
|
|
25
|
-
buttonClose: {
|
|
26
|
-
|
|
30
|
+
buttonClose: {
|
|
31
|
+
'?object': {
|
|
32
|
+
colors: {
|
|
33
|
+
'?object': {
|
|
27
34
|
background: '?string',
|
|
28
35
|
text: '?string',
|
|
29
36
|
icon: '?string',
|
|
@@ -33,7 +40,8 @@ exports.VITheme = {
|
|
|
33
40
|
text: '?string',
|
|
34
41
|
},
|
|
35
42
|
},
|
|
36
|
-
progress: {
|
|
43
|
+
progress: {
|
|
44
|
+
'?object': {
|
|
37
45
|
color: '?string',
|
|
38
46
|
},
|
|
39
47
|
},
|
|
@@ -45,7 +53,8 @@ exports.VIOpenLinkOptions = {
|
|
|
45
53
|
aclMode: { '?string': ['blacklist', 'whitelist'] },
|
|
46
54
|
readOnlyAddressBar: '?boolean',
|
|
47
55
|
idleTimeout: '?number',
|
|
48
|
-
coordinates: {
|
|
56
|
+
coordinates: {
|
|
57
|
+
'?object': {
|
|
49
58
|
x: 'number',
|
|
50
59
|
y: 'number',
|
|
51
60
|
width: 'number',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IOpenLinkOptions.js","sourceRoot":"","sources":["../../../src/FrontApplet/Browser/IOpenLinkOptions.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"IOpenLinkOptions.js","sourceRoot":"","sources":["../../../src/FrontApplet/Browser/IOpenLinkOptions.ts"],"names":[],"mappings":";;;AAkCa,QAAA,OAAO,GAAG;IACtB,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;IACtC,KAAK,EAAE;QACN,SAAS,EAAE;YACV,UAAU,EAAE,SAAS;SACrB;KACD;IACD,MAAM,EAAE;QACP,SAAS,EAAE;YACV,OAAO,EAAE,SAAS;YAClB,UAAU,EAAE,SAAS;YACrB,OAAO,EAAE,SAAS;SAClB;KACD;IACD,OAAO,EAAE;QACR,SAAS,EAAE;YACV,WAAW,EAAE;gBACZ,SAAS,EAAE;oBACV,MAAM,EAAE;wBACP,SAAS,EAAE;4BACV,UAAU,EAAE,SAAS;4BACrB,IAAI,EAAE,SAAS;yBACf;qBACD;iBACD;aACD;YACD,WAAW,EAAE;gBACZ,SAAS,EAAE;oBACV,MAAM,EAAE;wBACP,SAAS,EAAE;4BACV,UAAU,EAAE,SAAS;4BACrB,IAAI,EAAE,SAAS;4BACf,IAAI,EAAE,SAAS;yBACf;qBACD;oBACD,IAAI,EAAE,EAAE,SAAS,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE;oBAC/D,IAAI,EAAE,SAAS;iBACf;aACD;YACD,QAAQ,EAAE;gBACT,SAAS,EAAE;oBACV,KAAK,EAAE,SAAS;iBAChB;aACD;SACD;KACD;CACD,CAAC;AA8BW,QAAA,iBAAiB,GAAG;IAChC,UAAU,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE;IAClC,OAAO,EAAE,EAAE,SAAS,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC,EAAE;IAClD,kBAAkB,EAAE,UAAU;IAC9B,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE;QACZ,SAAS,EAAE;YACV,CAAC,EAAE,QAAQ;YACX,CAAC,EAAE,QAAQ;YACX,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,QAAQ;SAChB;KACD;IACD,KAAK,EAAE,EAAE,SAAS,EAAE,eAAO,EAAE;IAC7B,YAAY,EAAE,UAAU;IACxB,SAAS,EAAE,UAAU;IACrB,YAAY,EAAE,UAAU;CACxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/FrontApplet/Browser/events.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../../src/FrontApplet/Browser/events.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAEX;AAFD,WAAY,SAAS;IACpB,4BAAe,CAAA;AAChB,CAAC,EAFW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAEpB;AAEY,QAAA,WAAW,GAAG,CAAC,OAAO,CAAC,CAAC;AAUrC,IAAY,WAIX;AAJD,WAAY,WAAW;IACtB,0BAAW,CAAA;IACX,4BAAa,CAAA;IACb,kCAAmB,CAAA;AACpB,CAAC,EAJW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAItB"}
|
|
@@ -24,7 +24,7 @@ class Command {
|
|
|
24
24
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
25
|
this.checkTypeValidity(command.type);
|
|
26
26
|
yield this.postMessage({
|
|
27
|
-
type: this.getMessage(
|
|
27
|
+
type: this.getMessage('dispatch'),
|
|
28
28
|
command,
|
|
29
29
|
});
|
|
30
30
|
});
|
|
@@ -50,17 +50,23 @@ class Command {
|
|
|
50
50
|
}
|
|
51
51
|
checkTypeValidity(type) {
|
|
52
52
|
const regex = /^[a-zA-Z0-9\.\-_]+$/g;
|
|
53
|
-
Validate_1.default({ type })
|
|
53
|
+
Validate_1.default({ type })
|
|
54
|
+
.setError(new AppletCommandError_1.default({
|
|
54
55
|
kind: 'appletCommandError',
|
|
55
56
|
message: 'Type contains invalid characters.',
|
|
56
57
|
code: ErrorCodes_1.default.COMMAND_TYPE_NOT_VALID,
|
|
57
58
|
suggestion: ErrorSuggestions_1.default.COMMAND_TYPE_NOT_VALID,
|
|
58
|
-
}))
|
|
59
|
-
|
|
59
|
+
}))
|
|
60
|
+
.required()
|
|
61
|
+
.string()
|
|
62
|
+
.matchRegExp(regex);
|
|
63
|
+
Validate_1.default({ type })
|
|
64
|
+
.setError(new AppletCommandError_1.default({
|
|
60
65
|
kind: 'appletCommandError',
|
|
61
66
|
message: 'Type is longer then 100 characters.',
|
|
62
67
|
code: ErrorCodes_1.default.COMMAND_TYPE_IS_TOO_LONG,
|
|
63
|
-
}))
|
|
68
|
+
}))
|
|
69
|
+
.lengthMax(100);
|
|
64
70
|
}
|
|
65
71
|
}
|
|
66
72
|
exports.default = Command;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Command.js","sourceRoot":"","sources":["../../../src/FrontApplet/Command/Command.ts"],"names":[],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Command.js","sourceRoot":"","sources":["../../../src/FrontApplet/Command/Command.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAsC;AAKtC,oEAA6D;AAC7D,oDAA6C;AAC7C,gEAAyD;AACzD,mDAA4C;AAE5C,MAAqB,OAAO;IAK3B,YAAoB,aAAqB,EAAU,WAA+B;QAA9D,kBAAa,GAAb,aAAa,CAAQ;QAAU,gBAAW,GAAX,WAAW,CAAoB;QACjF,IAAI,CAAC,YAAY,GAAG,IAAI,qBAAY,EAAE,CAAC;IACxC,CAAC;IAEY,QAAQ,CAAuC,OAAiB;;YAC5E,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACrC,MAAM,IAAI,CAAC,WAAW,CAAC;gBACtB,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;gBACjC,OAAO;aACP,CAAC,CAAC;QACJ,CAAC;KAAA;IAEM,SAAS,CAAuC,QAAyC;QAC/F,kBAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC;QAC7C,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACpD,CAAC;IAEM,iBAAiB,CAAC,IAAqC;QAC7D,QAAQ,IAAI,CAAC,IAAI,EAAE;YAClB,KAAK,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC;gBACzC,MAAM,YAAY,GAAG;oBACpB,IAAI,EAAE,SAAS;oBACf,OAAO,EAAE,IAAI,CAAC,OAAO;iBACrB,CAAC;gBACF,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;gBAChD,MAAM;YACP,QAAQ;SACR;IACF,CAAC;IAEO,UAAU,CAAC,IAAY;QAC9B,OAAO,IAAI,CAAC,aAAa,GAAG,GAAG,GAAG,OAAO,CAAC,cAAc,GAAG,GAAG,GAAG,IAAI,CAAC;IACvE,CAAC;IAEO,iBAAiB,CAAC,IAAY;QACrC,MAAM,KAAK,GAAG,sBAAsB,CAAC;QAErC,kBAAQ,CAAC,EAAE,IAAI,EAAE,CAAC;aAChB,QAAQ,CACR,IAAI,4BAAkB,CAAC;YACtB,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,mCAAmC;YAC5C,IAAI,EAAE,oBAAU,CAAC,sBAAsB;YACvC,UAAU,EAAE,0BAAgB,CAAC,sBAAsB;SACnD,CAAC,CACF;aACA,QAAQ,EAAE;aACV,MAAM,EAAE;aACR,WAAW,CAAC,KAAK,CAAC,CAAC;QAErB,kBAAQ,CAAC,EAAE,IAAI,EAAE,CAAC;aAChB,QAAQ,CACR,IAAI,4BAAkB,CAAC;YACtB,IAAI,EAAE,oBAAoB;YAC1B,OAAO,EAAE,qCAAqC;YAC9C,IAAI,EAAE,oBAAU,CAAC,wBAAwB;SACzC,CAAC,CACF;aACA,SAAS,CAAC,GAAG,CAAC,CAAC;IAClB,CAAC;;AAhEF,0BAiEC;AAhEc,sBAAc,GAAW,SAAS,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import ICommandEvent from './ICommandEvent';
|
|
2
2
|
import ICommand from './ICommand';
|
|
3
|
-
export default ICommandEventListener;
|
|
4
3
|
interface ICommandEventListener<TCommand extends ICommand> {
|
|
5
4
|
(event: ICommandEvent<TCommand>): void;
|
|
6
5
|
}
|
|
6
|
+
export default ICommandEventListener;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { EventEmitter } from
|
|
3
|
-
import IPostMessage from
|
|
4
|
-
import IMessage from
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import IPostMessage from '../IPostMessage';
|
|
4
|
+
import IMessage from '../IMessage';
|
|
5
5
|
interface IDebugSetWeinreMessage extends IMessage {
|
|
6
6
|
enabled: boolean;
|
|
7
7
|
url: string;
|
|
@@ -32,7 +32,7 @@ class Debug extends events_1.EventEmitter {
|
|
|
32
32
|
}
|
|
33
33
|
handleMessageData(data) {
|
|
34
34
|
switch (data.type) {
|
|
35
|
-
case this.getMessage(
|
|
35
|
+
case this.getMessage('configure'):
|
|
36
36
|
this.emit(Debug.DEBUG_CHANGED, {
|
|
37
37
|
enabled: data.enabled,
|
|
38
38
|
});
|
|
@@ -40,7 +40,7 @@ class Debug extends events_1.EventEmitter {
|
|
|
40
40
|
this.window.WeinreServerURL = data.url;
|
|
41
41
|
this.window.WeinreServerId = data.id;
|
|
42
42
|
if (!this.window.__weinreLoaded) {
|
|
43
|
-
require(
|
|
43
|
+
require('weinre/web/target/target-script');
|
|
44
44
|
this.window.__weinreLoaded = true;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -53,10 +53,10 @@ class Debug extends events_1.EventEmitter {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
getMessage(name) {
|
|
56
|
-
return this.messagePrefix +
|
|
56
|
+
return this.messagePrefix + '.' + Debug.MESSAGE_PREFIX + '.' + name;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
exports.default = Debug;
|
|
60
|
-
Debug.MESSAGE_PREFIX =
|
|
61
|
-
Debug.DEBUG_CHANGED =
|
|
60
|
+
Debug.MESSAGE_PREFIX = 'debug';
|
|
61
|
+
Debug.DEBUG_CHANGED = 'debug.changed';
|
|
62
62
|
//# sourceMappingURL=Debug.js.map
|