mirror of
https://github.com/streamwall/streamwall.git
synced 2026-01-25 06:32:49 -05:00
Add ability to set stream audio playing in background
This commit is contained in:
@@ -257,6 +257,10 @@ export default class StreamWindow extends EventEmitter {
|
||||
}
|
||||
}
|
||||
|
||||
setViewBackgroundListening(viewIdx, listening) {
|
||||
this.sendViewEvent(viewIdx, listening ? 'BACKGROUND' : 'UNBACKGROUND')
|
||||
}
|
||||
|
||||
setViewBlurred(viewIdx, blurred) {
|
||||
this.sendViewEvent(viewIdx, blurred ? 'BLUR' : 'UNBLUR')
|
||||
}
|
||||
|
||||
@@ -270,6 +270,8 @@ async function main() {
|
||||
const onMessage = async (msg, respond) => {
|
||||
if (msg.type === 'set-listening-view') {
|
||||
streamWindow.setListeningView(msg.viewIdx)
|
||||
} else if (msg.type === 'set-view-background-listening') {
|
||||
streamWindow.setViewBackgroundListening(msg.viewIdx, msg.listening)
|
||||
} else if (msg.type === 'set-view-blurred') {
|
||||
streamWindow.setViewBlurred(msg.viewIdx, msg.blurred)
|
||||
} else if (msg.type === 'set-custom-streams') {
|
||||
|
||||
@@ -141,6 +141,8 @@ const viewStateMachine = Machine(
|
||||
on: {
|
||||
MUTE: '.muted',
|
||||
UNMUTE: '.listening',
|
||||
BACKGROUND: '.background',
|
||||
UNBACKGROUND: '.muted',
|
||||
},
|
||||
states: {
|
||||
muted: {
|
||||
@@ -149,6 +151,13 @@ const viewStateMachine = Machine(
|
||||
listening: {
|
||||
entry: 'unmuteAudio',
|
||||
},
|
||||
background: {
|
||||
on: {
|
||||
// Ignore normal audio swapping.
|
||||
MUTE: {},
|
||||
},
|
||||
entry: 'unmuteAudio',
|
||||
},
|
||||
},
|
||||
},
|
||||
video: {
|
||||
|
||||
Reference in New Issue
Block a user