• Stars
    star
    3,627
  • Rank 12,208 (Top 0.3 %)
  • Language
    JavaScript
  • License
    BSD 3-Clause "New...
  • Created almost 10 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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.

More Repositories

1

tfObjWebrtc

Tensorflow Object Detection API Web Service wrapper that works on any <video> tag and WebRTC streams
Python
179
star
2

WebRTC-Camera-Resolution

WebRTC Camera Resolution Finder
JavaScript
128
star
3

sdp-anatomy

Source code for webrtcHacks' Anatomy of a SDP
JavaScript
87
star
4

jitsiLocalRecorder

100% browser-based, local audio & screen recording for Jitsi Meet
JavaScript
77
star
5

facetouchmonitor

monitor how often you touch your face with WebRTC and tensorflow.js
JavaScript
71
star
6

webrtc_baby_monitor

A motion detecting baby monitor from webrtcHacks
JavaScript
67
star
7

transparent-virtual-background

Transparent backgrounds with WebRTC
HTML
66
star
8

ChadWallaceHart.com

Source for ChadWallaceHart.com
JavaScript
47
star
9

aiy_vision_web_server

Show camera feed and annotations of the AIY Vision Kit in a webpage
Python
44
star
10

webrtcnotify

JavaScript
10
star
11

first-steps-ortc

First steps with ORTC
HTML
10
star
12

webcodecPacketLoss

simulate packet loss effects with webcodecs
HTML
9
star
13

still-image-from-webcam-stream-approaches

Different ways of getting an image from a webcam stream
HTML
8
star
14

webrtcPresenceMonitor

Send a webhook when getUserMedia is active and inactive
JavaScript
7
star
15

smart-gallery

HTML
5
star
16

canvasMirror

5
star
17

gitHub-WebRTC-analysis

An analysis of WebRTC trends on GitHub
4
star
18

videoFileStream

Experiments in streaming a video file to WebRTC
HTML
2
star
19

fuzzit

C
1
star
20

cssMirror

Mirroring a getUserMedia video capture with CSS
HTML
1
star
21

chromestatus

grab datasets from chromestatus and display them a bit nicer
HTML
1
star
22

WebRTC-tool-directory

Repository for webrtcHacks tool directory
1
star