@@ -28,6 +28,11 @@ export class vMixConnectionPluginStore {
28
28
}
29
29
30
30
setConnection ( host : string ) {
31
+ // Shutdown/Destroy old connection?
32
+ if ( this . storeVM ! . $data . internal . connection ) {
33
+ console . log ( 'Shutdown old connection!' , this . storeVM ! . $data . internal . connection )
34
+ this . storeVM ! . $data . internal . connection . shutdown ( )
35
+ }
31
36
// @ts -ignore
32
37
this . storeVM ! . $data . internal . connection = new ConnectionTCP ( host )
33
38
}
@@ -68,38 +73,4 @@ const vMixConnectionPlugin = {
68
73
}
69
74
}
70
75
71
- // // Global property - is connected?
72
- // Vue.prototype.connected = false
73
- // // Vue.prototype.connected = function () {
74
- // // console.log('Is connected?')
75
- // // if (!this.$vMixConnection) {
76
- // // return false
77
- // // }
78
-
79
- // // return this.$vMixConnection!.connected()
80
- // // }
81
-
82
- // // Global method - set vMix connection
83
- // Vue.prototype.setVmixConnection = function (
84
- // host: string,
85
- // options: object = {},
86
- // keepListeners: boolean = false
87
- // ) {
88
- // if (keepListeners) {
89
- // console.log('Take care of listeners...')
90
- // }
91
-
92
- // this.$vMixConnection = new ConnectionTCP(host, options)
93
- // this.$vMixConnection.on('connect', () => {
94
- // console.log('Connected')
95
- // this.connected = true
96
- // })
97
- // this.$vMixConnection.on('error', () => {
98
- // console.log('Error')
99
- // this.connected = false
100
- // })
101
- // }
102
-
103
- // }
104
-
105
76
export default vMixConnectionPlugin
0 commit comments