For those who are interested: yes it works. You can reuse the Microphone and Camera singleton instances and publish to multiple NetStream instances.
reuse Microphone for multiple NetStream instances?
-
29-06-2022 - |
문제
Does anyone know if it's possible to attach a Microphone instance to multiple NetStream instances? I'm calling attachAudio on two different NetStream instances and I don't get an error message but it's not working either. What's the expected behavior with the following code example?
NetStream stream1 = new NetStream(connection1);
NetStream stream2 = new NetStream(connection2);
Microphone mic = Microphone.getMicrophone(-1);
stream1.attachAudio(mic);
stream2.attachAudio(mic);
stream1.publish();
stream2.publish();
해결책
제휴하지 않습니다 StackOverflow