Fix audio
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
		
					parent
					
						
							
								b57ef84e66
							
						
					
				
			
			
				commit
				
					
						fa0a8d30e7
					
				
			
		
					 1 changed files with 6 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -35,8 +35,12 @@ declare global {
 | 
			
		|||
export const useMediaStreamTrackCount = (
 | 
			
		||||
  stream: MediaStream
 | 
			
		||||
): [number, number] => {
 | 
			
		||||
  const [audioTrackCount, setAudioTrackCount] = useState(0);
 | 
			
		||||
  const [videoTrackCount, setVideoTrackCount] = useState(0);
 | 
			
		||||
  const [audioTrackCount, setAudioTrackCount] = useState(
 | 
			
		||||
    stream.getAudioTracks().length
 | 
			
		||||
  );
 | 
			
		||||
  const [videoTrackCount, setVideoTrackCount] = useState(
 | 
			
		||||
    stream.getVideoTracks().length
 | 
			
		||||
  );
 | 
			
		||||
 | 
			
		||||
  const tracksChanged = useCallback(() => {
 | 
			
		||||
    setAudioTrackCount(stream.getAudioTracks().length);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue