|
本帖最后由 Bizzi 于 2025-3-30 01:54 编辑
I have a following Plugin-Skeleton:
/plugins/<plugin>/manifest.json
- {
- "CodePath": "plugin/main.html",
- // [...] Other Manifest.json Data
- }
复制代码 /plugins/<plugin>/plugin/main.html
- <!DOCTYPE html>
- <html>
- <head>
- <script type="text/javascript">
- (new class Main {
- Socket = null;
-
- constructor() {
- console.log('Main');
-
- [
- 'connectSocket',
- 'connectSDSocket',
- 'connectMiraBoxSDSocket',
- 'connectElgatoStreamDeckSocket',
- ].forEach((name) => {
- window[name] = this.connect.bind(this);
- });
- }
-
- connect(port, uuid, event, info) {
- console.log('connect', arguments);
-
- this.Socket = new WebSocket('ws://127.0.0.1:' + port);
-
- this.Socket.addEventListener('open', () => this.onConnect(port, uuid, event));
- this.Socket.addEventListener('message', this.onReceive.bind(this));
- this.Socket.addEventListener('close', this.onClose.bind(this));
- this.Socket.addEventListener('error', this.onError.bind(this));
- }
-
- send(data) {
- console.warn('[Send]', data);
- this.Socket.send(JSON.stringify(data));
- }
-
- onConnect(port, uuid, event) {
- console.warn('[Connect]', { event: event, uuid: uuid });
- this.send({ event: event, uuid: uuid });
- }
-
- onClose(event) {
- console.warn('[Close]', event);
- }
-
- onError(event) {
- console.error('[Error]', event, event.data);
- }
-
- onReceive(event) {
- let packet = JSON.parse(event.data);
- console.log('[Receive]', packet.action, packet.event, packet);
- }
- }());
- </script>
- </head>
- <body></body>
- </html>
复制代码
When i start the Stream Dock Application, the Plugin will be shown, the Action can be placed and the Property Inspector works.
But only the Main.html will never called the connectElgatoStreamDeckSocket Method:
Why the connect-Methods will never been called by the Stream Dock Application?
Stream Dock Version: 3.10.189.0313
The full code is here: https://github.com/Bizarrus/KnuddelsAdmin
Edit:
The Problem is definitively on the Stream Dock Application.
When the Computer going into the Energy saving mode and will be reactived, the command connectElgatoStreamDeckSocket will be called and the connection will be started:
|
|