{"id":19760133,"url":"https://github.com/videsk/safari-webrtc-bug","last_synced_at":"2026-01-29T21:04:45.657Z","repository":{"id":117346751,"uuid":"486761658","full_name":"videsk/safari-webrtc-bug","owner":"videsk","description":"Bug on Webkit with the SDP transceivers","archived":false,"fork":false,"pushed_at":"2022-04-29T01:57:52.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-08T23:04:28.979Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/videsk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-28T22:06:47.000Z","updated_at":"2022-04-29T01:36:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"58161a99-e747-4ff8-9bc4-88d85666d2fd","html_url":"https://github.com/videsk/safari-webrtc-bug","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/videsk/safari-webrtc-bug","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videsk%2Fsafari-webrtc-bug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videsk%2Fsafari-webrtc-bug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videsk%2Fsafari-webrtc-bug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videsk%2Fsafari-webrtc-bug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/videsk","download_url":"https://codeload.github.com/videsk/safari-webrtc-bug/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videsk%2Fsafari-webrtc-bug/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28884792,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-29T19:55:09.949Z","status":"ssl_error","status_checked_at":"2026-01-29T19:55:08.490Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T03:35:39.382Z","updated_at":"2026-01-29T21:04:45.642Z","avatar_url":"https://github.com/videsk.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Webkit SDP transceivers bug\n\nThe context is when trying to send tracks between peers async. That means sending tracks from peer 1 and when complete the signaling process to `stable`, sending the tracks to peer 2.\n\n```\nnew =\u003e have-local-offer =\u003e stable =\u003e have-remote-offer =\u003e stable\n```\n\n**The bug only happens when the peer 1 is any browser in any OS except iOS and the second one Safari/Firefox/Chrome on iOS, and send tracks async.**\n\nWebkit Bugzilla: https://bugs.webkit.org/show_bug.cgi?id=239882\n\n# How to reproduce it\n\n1. Get user media with audio and video\n2. Create RTCPeerconnection on both peers following the [perfect negotiation](https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Perfect_negotiation).\n3. Execute `peer1.addTrack(track, cameraStream);`\n4. Wait to receive the tracks of peer1 on peer2\n5. Add mute/unmute listener to both track `track.addEventListener('mute', event =\u003e console.log(event.track.kind, 'muted', event));` and `track.addEventListener('unmute', event =\u003e console.log(event.track.kind, 'unmuted', event));`\n6. Execute `peer2.addTrack(track, stream);`\n7. Expect receive tracks **muted**\n\nPoint 7 is where weird things happen. You will receive the tracks as muted, only before transceivers exchange and the direction of `RTCRtpSender` and `RTCRtpReceiver` will be `recvonly`. After transceivers, the tracks will be changed to unmuted, and both transceivers `RTCRtpTransceiver` will change direction value to `sendrecv`, but tracks still empty (no audio, no video).\n\nA human-readable example is the case when Alice calls Bob. Previous to Bob answering the call we show a preview of Alice's camera, when Bob answer we send the Bob tracks. That use case could be complex if you don't create a new RTCPeerconnection on Alice and Bob, that means starting the signaling process again, which is inefficient.\n\n---\n\nIf you try send track synchronous between peers works perfect and transceivers direction is `sendrecv`. So, the first conclusion is meanwhile the signaling process is in the process the transceivers' direction will be set as `sendrecv` if you send tracks at the same time, not asynchronous.\n\n# SDP examples\n- Chrome 100 and Safari 15.2 iOS ([here](chrome100-safari15ios.md)) ❌\n- Chrome 100 and Safari 15.1 macOS ([here](chrome100-safari15mac.md)) ✅\n- Firefox 99 and Safari 15.2 iOS ([here](firefox99-safari15ios.md)) ❌\n- Firefox 99 and Safari 14.1 macOS ([here](firefox99-safari14mac.md)) ✅\n\nAlso, was tested Chrome and Firefox in iOS with the same results as failed examples.\n\n# Conclusion\n\nOnly happens in iOS when sending tracks between peers asynchronous, first from not iOS peer and then from the iOS peer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvidesk%2Fsafari-webrtc-bug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvidesk%2Fsafari-webrtc-bug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvidesk%2Fsafari-webrtc-bug/lists"}