mirror of
https://github.com/eliasstepanik/vdo.ninja.git
synced 2026-01-18 17:18:34 +00:00
screenshare stop fix
This commit is contained in:
parent
ced13efd5a
commit
41bd0aec7e
18
lib.js
18
lib.js
@ -2445,6 +2445,10 @@ function updateMixerRun(e=false){ // this is the main auto-mixing code. It's a
|
||||
continue;
|
||||
//}
|
||||
}
|
||||
} else if (session.rpcs[i].videoElement.srcObject && ((session.rpcs[i].videoElement.srcObject.getVideoTracks().length==0) || session.rpcs[i].videoMuted)){
|
||||
if (("screenshare" in session.rpcs[i].videoElement) && (session.rpcs[i].videoElement.screenshare)){
|
||||
continue;
|
||||
}
|
||||
}
|
||||
//} else if (!session.directorList.indexOf(i)>=0){ // director is never audio-only. Video if need, yes, but not visualized-audio.
|
||||
// if (session.rpcs[i].videoElement.srcObject && ((session.rpcs[i].videoElement.srcObject.getVideoTracks().length==0) || (session.rpcs[i].videoMuted)) && !session.rpcs[i].directorVideoMuted){
|
||||
@ -20925,21 +20929,20 @@ function midiHotkeysCommand(command, value){
|
||||
}
|
||||
}
|
||||
|
||||
function playbackMIDI(msg){
|
||||
function playbackMIDI(msg, unsafe=false){
|
||||
if (session.midiIn===false && session.midiRemote===false){return;} // just in case; security
|
||||
else if ((session.midiOut===session.midiIn) && (session.midiRemote===false)){return;} // avoid feedback loops
|
||||
//msg.midi.d = e.data;
|
||||
//msg.midi.s = e.timestamp;
|
||||
//msg.midi.t = e.type;
|
||||
log(msg);
|
||||
if (session.midiIn===true){
|
||||
if ("d" in msg){
|
||||
for (var i in WebMidi.outputs){
|
||||
try {
|
||||
if ("c" in msg){
|
||||
WebMidi.outputs[i].channels[msg.c].send(msg.d[0], [msg.d[1], msg.d[2]]);
|
||||
WebMidi.outputs[i].channels[msg.c].send(msg.d);
|
||||
} else {
|
||||
WebMidi.outputs[i].send(msg.d[0], [msg.d[1], msg.d[2]]);
|
||||
WebMidi.outputs[i].send(msg.d);
|
||||
}
|
||||
} catch(e){errorlog(e);}
|
||||
}
|
||||
@ -20949,13 +20952,16 @@ function playbackMIDI(msg){
|
||||
var i = parseInt(session.midiIn)-1;
|
||||
if ("d" in msg){
|
||||
if ("c" in msg){
|
||||
WebMidi.outputs[i].channels[msg.c].send(msg.d[0], [msg.d[1], msg.d[2]]);
|
||||
WebMidi.outputs[i].channels[msg.c].send(msg.d);
|
||||
} else {
|
||||
WebMidi.outputs[i].send(msg.d[0], [msg.d[1], msg.d[2]]);
|
||||
WebMidi.outputs[i].send(msg.d);
|
||||
}
|
||||
}
|
||||
} catch(e){errorlog(e);};
|
||||
}
|
||||
|
||||
if (unsafe){return;} // I don't know how midi remote works in reverse, so lets ignore it
|
||||
|
||||
if (session.midiRemote==4){
|
||||
if (msg.d[0] == 176){
|
||||
midiHotkeysCommand(msg.d[1], msg.d[2]);
|
||||
|
||||
28
main.js
28
main.js
@ -405,8 +405,8 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
|
||||
session.midiOut = parseInt(urlParams.get('midipush')) || parseInt(urlParams.get('midiout')) || parseInt(urlParams.get('mo')) || true;
|
||||
}
|
||||
|
||||
if (urlParams.has('midipull') || urlParams.has('midiin') || urlParams.has('mi')){
|
||||
session.midiIn = parseInt(urlParams.get('midipull')) || parseInt(urlParams.get('midiin')) || parseInt(urlParams.get('mi')) || true;
|
||||
if (urlParams.has('midipull') || urlParams.has('midiin') || urlParams.has('midin') || urlParams.has('mi')){
|
||||
session.midiIn = parseInt(urlParams.get('midipull')) || parseInt(urlParams.get('midiin')) || parseInt(urlParams.get('midin')) || parseInt(urlParams.get('mi')) || true;
|
||||
}
|
||||
|
||||
if (urlParams.has('midichannel')){
|
||||
@ -3532,9 +3532,19 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
|
||||
if (e.message && e.message.channel){
|
||||
msg.midi.c = e.message.channel;
|
||||
}
|
||||
var list = [];
|
||||
for (var UUID in session.pcs){
|
||||
if (session.pcs[UUID].allowMIDI){
|
||||
session.sendMessage(msg, UUID);
|
||||
if (session.sendMessage(msg, UUID)){
|
||||
list.push(UUID);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var UUID in session.rpcs){
|
||||
if (session.rpcs[UUID].allowMIDI){ // specific to gstreamer code aplication
|
||||
if (!list.includes(UUID)){
|
||||
session.sendRequest(msg, UUID)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -3551,9 +3561,19 @@ async function main(){ // main asyncronous thread; mostly initializes the user s
|
||||
if (e.message && e.message.channel){
|
||||
msg.midi.c = e.message.channel;
|
||||
}
|
||||
var list = [];
|
||||
for (var UUID in session.pcs){
|
||||
if (session.pcs[UUID].allowMIDI){
|
||||
session.sendMessage(msg, UUID);
|
||||
if (session.sendMessage(msg, UUID)){
|
||||
list.push(UUID);
|
||||
}
|
||||
}
|
||||
}
|
||||
for (var UUID in session.rpcs){
|
||||
if (session.rpcs[UUID].allowMIDI){ // specific to gstreamer code aplication
|
||||
if (!list.includes(UUID)){
|
||||
session.sendRequest(msg, UUID)
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user