Volver al ranking

Shim to insulate apps from spec changes and prefix differences. Latest adapter.js release:

webrtcwebrtc-adapterpolyfill
Crecimiento de estrellas
Estrellas
3.7k
Forks
858
Crecimiento semanal
Issues
7
1k2k3k
feb 2015nov 2018sept 2022jul 2026
Artefactosnpmnpm install adapter
README

WebRTC adapter

adapter.js is a shim to insulate apps from spec changes and prefix differences in WebRTC. The prefix differences are mostly gone these days but differences in behaviour between browsers remain.

This repository used to be part of the WebRTC organisation on github but moved. We aim to keep the old repository updated with new releases.

Install

NPM

npm install webrtc-adapter

Bower

bower install webrtc-adapter

Usage

Javascript

Just import adapter:

import adapter from 'webrtc-adapter';

No further action is required. You might want to use adapters browser detection which detects which webrtc quirks are required. You can look at

adapter.browserDetails.browser

for webrtc engine detection (which will for example detect Opera or the Chromium based Edge as 'chrome') and

adapter.browserDetails.version

for the version according to the user-agent string.

NPM

Copy to desired location in your src tree or use a minify/vulcanize tool (node_modules is usually not published with the code). See webrtc/samples repo as an example on how you can do this.

Prebuilt releases

Web

In the gh-pages branch prebuilt ready to use files can be downloaded/linked directly. Latest version can be found at https://webrtc.github.io/adapter/adapter-latest.js. Specific versions can be found at https://webrtc.github.io/adapter/adapter-N.N.N.js, e.g. https://webrtc.github.io/adapter/adapter-1.0.2.js.

Bower

You will find adapter.js in bower_components/webrtc-adapter/.

NPM

In node_modules/webrtc-adapter/out/ folder you will find 4 files:

  • adapter.js - includes all the shims and is visible in the browser under the global adapter object (window.adapter).
  • adapter_no_global.js - same as adapter.js but is not exposed/visible in the browser (you cannot call/interact with the shims in the browser).

Include the file that suits your need in your project.

Development

Head over to test/README.md and get started developing.

Publish a new version

  • Go to the adapter repository root directory
  • Make sure your repository is clean, i.e. no untracked files etc. Also check that you are on the master branch and have pulled the latest changes.
  • Depending on the impact of the release, either use patch, minor or major in place of <version>. Run npm version <version> -m 'bump to %s' and type in your password lots of times (setting up credential caching is probably a good idea).
  • Create and merge the PR if green in the GitHub web ui
  • Go to the releases tab in the GitHub web ui and edit the tag.
  • Add a summary of the recent commits in the tag summary and a link to the diff between the previous and current version in the description, example.
  • Go back to your checkout and run git pull
  • Run npm publish (you need access to the webrtc-adapter npmjs package). For big changes, consider using a tag version such as next and then change the dist-tag after testing.
  • Done! There should now be a new release published to NPM and the gh-pages branch.

Note: Currently only tested on Linux, not sure about Mac but will definitely not work on Windows.

Publish a hotfix patch versions

In some cases it may be necessary to do a patch version while there are significant changes changes on the master branch. To make a patch release,

  • checkout the latest git tag using git checkout tags/vMajor.minor.patch.
  • checkout a new branch, using a name such as patchrelease-major-minor-patch.
  • cherry-pick the fixes using git cherry-pick some-commit-hash.
  • run npm version patch. This will create a new patch version and publish it on github.
  • check out origin/bumpVersion branch and publish the new version using npm publish.
  • the branch can now safely be deleted. It is not necessary to merge it into the main branch since it only contains cherry-picked commits.
  • after publishing a hotfiix use npm dist-tag to ensure latest still points to the highest version.
Repositorios relacionados
RocketChat/Rocket.Chat

The Secure CommsOS™ for mission-critical operations

TypeScriptnpmOtherchatmeteor
rocket.chat
45.8k13.7k
webtorrent/webtorrent

⚡️ Streaming torrent client for the web

JavaScriptnpmMIT Licensewebtorrentbittorrent
webtorrent.io
31.3k2.9k
jitsi/jitsi-meet

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

TypeScriptnpmApache License 2.0webrtcsfu
jitsi.org/meet
29.6k8k
ossrs/srs

SRS is a simple, high-efficiency, real-time media server supporting RTMP, WebRTC, HLS, HTTP-FLV, HTTP-TS, SRT, MPEG-DASH, and GB28181, with codec support for H.264, H.265, AV1, VP9, AAC, Opus, and G.711.

C++MIT Licensertmplive-streaming
ossrs.io
29.1k5.7k
m1k1o/neko

A self hosted virtual browser that runs in docker and uses WebRTC.

GoGo ModulesApache License 2.0dockervirtual-browser
neko.m1k1o.net
21.7k1.5k
pavlobu/deskreen

Deskreen turns any device with a web browser into a secondary screen for your computer. ⭐️ Star to support our work!

TypeScriptnpmGNU Affero General Public License v3.0second-screenwifi
deskreen.com
21.2k1.2k
livekit/livekit

End-to-end realtime stack for connecting humans and AI

GoGo ModulesApache License 2.0golangwebrtc
docs.livekit.io
19.9k2.2k
SnapDrop/snapdrop

A Progressive Web App for local file sharing

JavaScriptnpmGNU General Public License v3.0webrtcpwa
snapdrop.net
19.7k1.9k
bluenviron/mediamtx

Ready-to-use Media-over-QUIC / SRT / WebRTC / RTSP / RTMP / LL-HLS / MPEG-TS / RTP live media server and media proxy that allows to read, publish, proxy, record and playback real-time video and audio streams.

GoGo ModulesMIT Licensertsprtp
mediamtx.org
19.6k2.3k
ZLMediaKit/ZLMediaKit

WebRTC/RTSP/RTMP/HTTP/HLS/HTTP-FLV/WebSocket-FLV/HTTP-TS/HTTP-fMP4/WebSocket-TS/WebSocket-fMP4/GB28181/SRT/STUN/TURN server and client framework based on C++11

C++Otherrtsprtmp
docs.zlmediakit.com
17.3k4.1k
pion/webrtc

Pure Go implementation of the WebRTC API

GoGo ModulesMIT Licensegogolang
pion.ly
16.7k1.9k
AlexxIT/go2rtc

Ultimate camera streaming application

GoGo ModulesMIT Licenseffmpeghassio
go2rtc.org
13.5k1.2k