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",
{
"port": "4005",
"loggerPort": "9006",
"port": "4001",
"loggerPort": "9002",
"mainConfig": "./webpack.main.config.js",
"devContentSecurityPolicy": "connect-src 'self' http://localhost:5000 ws://localhost:5000 'unsafe-eval'",
"renderer": {
@@ -205,7 +205,7 @@ function StreamRoom({
if (userDetails) {
navigator.mediaDevices
.getUserMedia({
video: true,
video: false,
audio: {
echoCancellation: true,
autoGainControl: true,
@@ -224,15 +224,15 @@ function StreamRoom({
// !TEST STUFF : removing distortion with headphones in
// test distortion to go away on disabling audio
setTimeout(() => {
console.log("stopping audio stream ");
// setTimeout(() => {
// console.log("stopping audio stream ");
userStream.getTracks().forEach((track) => {
track.enabled = !track.enabled;
// userStream.getTracks().forEach((track) => {
// track.enabled = !track.enabled;
track.stop();
});
}, 0);
// track.stop();
// });
// }, 0);
// take the initial list of tunedInUsers without my own id
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
return (
<>
<video
height={"200"}
width={"300"}
autoPlay
ref={userStreamTagRef}
muted
/>
<audio autoPlay muted ref={userStreamTagRef} controls />
this is the video of people
{userPeers &&
Object.entries(userPeers).map(([userId, peer]) => (
@@ -435,13 +429,7 @@ function PeerStreamRenderer({
return (
<>
<video
height={"400"}
width={"500"}
muted={!isBroadcasting}
autoPlay
ref={streamRef}
/>
<audio muted={!isBroadcasting} autoPlay controls ref={streamRef} />
</>
);
}