its actually crisp with audio....and smooth and cool...no need for video if this is smooth

This commit is contained in:
talksik
2022-05-20 11:32:11 -05:00
parent e56c4af1e2
commit 07ee40f4c4
3 changed files with 13 additions and 10 deletions
+2 -2
View File
@@ -42,8 +42,8 @@
[ [
"@electron-forge/plugin-webpack", "@electron-forge/plugin-webpack",
{ {
"port": "4000", "port": "4005",
"loggerPort": "9000", "loggerPort": "9005",
"mainConfig": "./webpack.main.config.js", "mainConfig": "./webpack.main.config.js",
"devContentSecurityPolicy": "connect-src 'self' http://localhost:5000 ws://localhost:5000 https://api.quotable.io/random 'unsafe-eval'", "devContentSecurityPolicy": "connect-src 'self' http://localhost:5000 ws://localhost:5000 https://api.quotable.io/random 'unsafe-eval'",
"renderer": { "renderer": {
@@ -16,11 +16,13 @@ import useTerminalProvider from './TerminalProvider';
import MasterLineData from '@nirvana/core/models/masterLineData.model'; import MasterLineData from '@nirvana/core/models/masterLineData.model';
import { useEffectOnce } from 'react-use'; import { useEffectOnce } from 'react-use';
const videoConstraints = { const videoConstraints = false;
frameRate: 30,
width: { max: 100 }, // {
height: { max: 200 }, // frameRate: 30,
}; // width: { max: 100 },
// height: { max: 200 },
// };
const iceServers = [ const iceServers = [
// { urls: 'stun:stun.l.google.com:19302' }, // { urls: 'stun:stun.l.google.com:19302' },
@@ -175,7 +175,7 @@ export default function LineDetails() {
} }
function StreamPlayer({ peerStream }: { peerStream: MediaStream }) { function StreamPlayer({ peerStream }: { peerStream: MediaStream }) {
const streamRef = useRef<HTMLVideoElement>(null); const streamRef = useRef<HTMLAudioElement>(null);
useEffect(() => { useEffect(() => {
if (streamRef?.current) streamRef.current.srcObject = peerStream; if (streamRef?.current) streamRef.current.srcObject = peerStream;
@@ -183,14 +183,15 @@ function StreamPlayer({ peerStream }: { peerStream: MediaStream }) {
return ( return (
<> <>
<video {/* <video
ref={streamRef} ref={streamRef}
height={300} height={300}
width={400} width={400}
className={'shadow-xl rounded'} className={'shadow-xl rounded'}
autoPlay autoPlay
muted muted
/> /> */}
<audio ref={streamRef} className={'shadow-xl rounded'} autoPlay controls />
</> </>
); );
} }