export const requireMedia = async (constraints: MediaStreamConstraints) => {
  if (!navigator) throw new Error('浏览器版本过低，无法开始直播')
  return navigator.mediaDevices.getUserMedia(constraints)
}

export const removeMedia = async (mediaStreams: MediaStream | null, tracks: MediaStreamTrack[]) => {
  if (!navigator) throw new Error('浏览器版本过低')
  if (!mediaStreams) return []
  return (tracks || []).map(track => mediaStreams.removeTrack(track))
}

export const joinRoom = async (roomId: string) => {

}
