blob: 925dbae6ab46fac89fdbdc0dd270e45ce74a1b15 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
<html>
<head>
<script>
window.addEventListener('load', async () => {
const frame = document.createElement('frame')
document.documentElement.appendChild(frame)
const pc = new RTCPeerConnection({})
await pc.createOffer({ 'offerToReceiveAudio': true })
const [{receiver}] = pc.getTransceivers()
const track = pc.addTrack(receiver.track)
pc.removeTrack(track)
const [track2] = (await frame.contentWindow.navigator.mediaDevices.getUserMedia({
'audio': {},
'fake': true
})).getTracks()
pc.addTrack(track2)
})
</script>
</head>
</html>
|