audio stream working i think

This commit is contained in:
talksik
2022-05-08 12:21:45 -05:00
parent 165cffac5d
commit c9c4c18727
2 changed files with 12 additions and 24 deletions
+2 -2
View File
@@ -55,8 +55,8 @@
[ [
"@electron-forge/plugin-webpack", "@electron-forge/plugin-webpack",
{ {
"port": "4005", "port": "4001",
"loggerPort": "9006", "loggerPort": "9002",
"mainConfig": "./webpack.main.config.js", "mainConfig": "./webpack.main.config.js",
"devContentSecurityPolicy": "connect-src 'self' http://localhost:5000 ws://localhost:5000 'unsafe-eval'", "devContentSecurityPolicy": "connect-src 'self' http://localhost:5000 ws://localhost:5000 'unsafe-eval'",
"renderer": { "renderer": {
@@ -205,7 +205,7 @@ function StreamRoom({
if (userDetails) { if (userDetails) {
navigator.mediaDevices navigator.mediaDevices
.getUserMedia({ .getUserMedia({
video: true, video: false,
audio: { audio: {
echoCancellation: true, echoCancellation: true,
autoGainControl: true, autoGainControl: true,
@@ -224,15 +224,15 @@ function StreamRoom({
// !TEST STUFF : removing distortion with headphones in // !TEST STUFF : removing distortion with headphones in
// test distortion to go away on disabling audio // test distortion to go away on disabling audio
setTimeout(() => { // setTimeout(() => {
console.log("stopping audio stream "); // console.log("stopping audio stream ");
userStream.getTracks().forEach((track) => { // userStream.getTracks().forEach((track) => {
track.enabled = !track.enabled; // track.enabled = !track.enabled;
track.stop(); // track.stop();
}); // });
}, 0); // }, 0);
// take the initial list of tunedInUsers without my own id // take the initial list of tunedInUsers without my own id
const everyOtherTunedUserId = tunedInUsers.filter( const everyOtherTunedUserId = tunedInUsers.filter(
@@ -387,13 +387,7 @@ function StreamRoom({
// we only loop through peers that are associated to user Ids which exist in the currentBroadcasters array // we only loop through peers that are associated to user Ids which exist in the currentBroadcasters array
return ( return (
<> <>
<video <audio autoPlay muted ref={userStreamTagRef} controls />
height={"200"}
width={"300"}
autoPlay
ref={userStreamTagRef}
muted
/>
this is the video of people this is the video of people
{userPeers && {userPeers &&
Object.entries(userPeers).map(([userId, peer]) => ( Object.entries(userPeers).map(([userId, peer]) => (
@@ -435,13 +429,7 @@ function PeerStreamRenderer({
return ( return (
<> <>
<video <audio muted={!isBroadcasting} autoPlay controls ref={streamRef} />
height={"400"}
width={"500"}
muted={!isBroadcasting}
autoPlay
ref={streamRef}
/>
</> </>
); );
} }