refs #769 Switch public streaming method
This commit is contained in:
parent
1e50e2dd6d
commit
1d30a5e32c
|
@ -507,20 +507,21 @@ ipcMain.on('stop-local-streaming', (event, _) => {
|
||||||
|
|
||||||
let publicStreaming = null
|
let publicStreaming = null
|
||||||
|
|
||||||
ipcMain.on('start-public-streaming', (event, ac) => {
|
ipcMain.on('start-public-streaming', (event, obj) => {
|
||||||
accountManager.getAccount(ac._id)
|
const { account, useWebsocket } = obj
|
||||||
|
accountManager.getAccount(account._id)
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
log.error(err)
|
log.error(err)
|
||||||
event.sender.send('error-start-public-streaming', err)
|
event.sender.send('error-start-public-streaming', err)
|
||||||
})
|
})
|
||||||
.then((account) => {
|
.then((acct) => {
|
||||||
// Stop old public streaming
|
// Stop old public streaming
|
||||||
if (publicStreaming !== null) {
|
if (publicStreaming !== null) {
|
||||||
publicStreaming.stop()
|
publicStreaming.stop()
|
||||||
publicStreaming = null
|
publicStreaming = null
|
||||||
}
|
}
|
||||||
|
|
||||||
publicStreaming = new StreamingManager(account)
|
publicStreaming = new StreamingManager(acct, useWebsocket)
|
||||||
publicStreaming.start(
|
publicStreaming.start(
|
||||||
'public',
|
'public',
|
||||||
'',
|
'',
|
||||||
|
|
|
@ -296,7 +296,10 @@ const TimelineSpace = {
|
||||||
},
|
},
|
||||||
startPublicStreaming ({ state }) {
|
startPublicStreaming ({ state }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
ipcRenderer.send('start-public-streaming', state.account)
|
ipcRenderer.send('start-public-streaming', {
|
||||||
|
account: state.account,
|
||||||
|
useWebsocket: state.useWebsocket
|
||||||
|
})
|
||||||
ipcRenderer.once('error-start-public-streaming', (event, err) => {
|
ipcRenderer.once('error-start-public-streaming', (event, err) => {
|
||||||
reject(err)
|
reject(err)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue