WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
test 1
s.html (text/html), 1.20 KB, created by
Cameron McCormack (:heycam)
on 2021-10-07 00:06:17 PDT
(
hide
)
Description:
test 1
Filename:
MIME Type:
Creator:
Cameron McCormack (:heycam)
Created:
2021-10-07 00:06:17 PDT
Size:
1.20 KB
patch
obsolete
><!DOCTYPE html> ><table> > <tr><th>source canvas<th>video > <tr> > <td><canvas id="src" width="100" height="100"></canvas> > <td><video id="v" autoplay width="100" height="100"></video> ></table> ><script> >let srcCtx = src.getContext("2d"); >let x = 0; > >function drawFrame() { > srcCtx.fillStyle = "#FFFFCC"; > srcCtx.fillRect(0, 0, 100, 100); > srcCtx.fillStyle = "#800000"; > srcCtx.fillRect(10, 10, 40, 40); > srcCtx.fillStyle = x >= 60 ? "#0000FF" : "#000000"; > srcCtx.fillRect(60, 60, 20, 20); > x = (x + 1) % 120; > requestAnimationFrame(drawFrame); >}; > >requestAnimationFrame(drawFrame); > >let local = new RTCPeerConnection(); >let remote = new RTCPeerConnection(); > >local.onicecandidate = e => remote.addIceCandidate(e.candidate); >remote.onicecandidate = e => local.addIceCandidate(e.candidate); > >local.addTrack(src.captureStream().getVideoTracks()[0]); >remote.ontrack = function(e) { > v.srcObject = new MediaStream([e.track]); >}; >local.createOffer().then(function(desc) { > local.setLocalDescription(desc); > remote.setRemoteDescription(desc).then(function() { > remote.createAnswer().then(function(desc) { > remote.setLocalDescription(desc); > local.setRemoteDescription(desc); > }); > }); >}); ></script>
<!DOCTYPE html> <table> <tr><th>source canvas<th>video <tr> <td><canvas id="src" width="100" height="100"></canvas> <td><video id="v" autoplay width="100" height="100"></video> </table> <script> let srcCtx = src.getContext("2d"); let x = 0; function drawFrame() { srcCtx.fillStyle = "#FFFFCC"; srcCtx.fillRect(0, 0, 100, 100); srcCtx.fillStyle = "#800000"; srcCtx.fillRect(10, 10, 40, 40); srcCtx.fillStyle = x >= 60 ? "#0000FF" : "#000000"; srcCtx.fillRect(60, 60, 20, 20); x = (x + 1) % 120; requestAnimationFrame(drawFrame); }; requestAnimationFrame(drawFrame); let local = new RTCPeerConnection(); let remote = new RTCPeerConnection(); local.onicecandidate = e => remote.addIceCandidate(e.candidate); remote.onicecandidate = e => local.addIceCandidate(e.candidate); local.addTrack(src.captureStream().getVideoTracks()[0]); remote.ontrack = function(e) { v.srcObject = new MediaStream([e.track]); }; local.createOffer().then(function(desc) { local.setLocalDescription(desc); remote.setRemoteDescription(desc).then(function() { remote.createAnswer().then(function(desc) { remote.setLocalDescription(desc); local.setRemoteDescription(desc); }); }); }); </script>
View Attachment As Raw
Actions:
View
Attachments on
bug 231353
: 440479 |
440480
|
440481
|
440483
|
440539
|
441028