好早之前写了个小deme,本来都忘了,现在无意中又翻出来了,所以也来记录一下吧!
废话不说了,直接上代码了:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>webRTC</title>
</head>
<body>
<div class="app">
<div class="control">
<img src="./assets/img/播放.png" alt="">
</div>
</div>
<script>
const control = document.querySelector('.control')
control.addEventListener('click', start)
async function start() {
co