Skip to content

Commit a5d971a

Browse files
author
Jens Grønhøj Stigaard
committed
Fixed bug in vmix connection
1 parent 6cbd7b8 commit a5d971a

File tree

1 file changed

+5
-34
lines changed

1 file changed

+5
-34
lines changed

src/plugins/vmix-connection.ts

+5-34
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ export class vMixConnectionPluginStore {
2828
}
2929

3030
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+
}
3136
// @ts-ignore
3237
this.storeVM!.$data.internal.connection = new ConnectionTCP(host)
3338
}
@@ -68,38 +73,4 @@ const vMixConnectionPlugin = {
6873
}
6974
}
7075

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-
10576
export default vMixConnectionPlugin

0 commit comments

Comments
 (0)