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
@@ -16,11 +16,13 @@ import useTerminalProvider from './TerminalProvider';
import MasterLineData from '@nirvana/core/models/masterLineData.model';
import { useEffectOnce } from 'react-use';
const videoConstraints = {
frameRate: 30,
width: { max: 100 },
height: { max: 200 },
};
const videoConstraints = false;
// {
// frameRate: 30,
// width: { max: 100 },
// height: { max: 200 },
// };
const iceServers = [
// { urls: 'stun:stun.l.google.com:19302' },
@@ -175,7 +175,7 @@ export default function LineDetails() {
}
function StreamPlayer({ peerStream }: { peerStream: MediaStream }) {
const streamRef = useRef<HTMLVideoElement>(null);
const streamRef = useRef<HTMLAudioElement>(null);
useEffect(() => {
if (streamRef?.current) streamRef.current.srcObject = peerStream;
@@ -183,14 +183,15 @@ function StreamPlayer({ peerStream }: { peerStream: MediaStream }) {
return (
<>
<video
{/* <video
ref={streamRef}
height={300}
width={400}
className={'shadow-xl rounded'}
autoPlay
muted
/>
/> */}
<audio ref={streamRef} className={'shadow-xl rounded'} autoPlay controls />
</>
);
}