Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop (old) Edge support #1076

Merged
merged 1 commit into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,6 @@ module.exports = function(grunt) {
adapterAndNoGlobalObject: {
src: ['./dist/adapter_core5.js'],
dest: './out/adapter_no_global.js'
},
// Use this if you do not want Microsoft Edge shim to be included.
adapterNoEdge: {
src: ['./dist/adapter_core5.js'],
dest: './out/adapter_no_edge.js',
options: {
// These files will be skipped.
ignore: [
'./dist/edge/edge_shim.js'
],
browserifyOptions: {
// Exposes the shim in a global object to the browser.
standalone: 'adapter'
}
}
},
// Use this if you do not want Microsoft Edge shim to be included and
// do not want adapter to expose anything to the global scope.
adapterNoEdgeAndNoGlobalObject: {
src: ['./dist/adapter_core5.js'],
dest: './out/adapter_no_edge_no_global.js',
options: {
ignore: [
'./dist/edge/edge_shim.js'
]
}
}
},
eslint: {
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ 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_edge.js` - same as above but does not include the Microsoft Edge (ORTC) shim.
* `adapter_no_edge_no_global.js` - same as above but is not exposed/visible in the browser (you cannot call/interact with the shims in the browser).
* `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.
Expand Down
7 changes: 1 addition & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ declare module "webrtc-adapter" {
fixNegotiationNeeded(window: Window): void;
}

interface IEdgeShim {
shimPeerConnection(window: Window): void;
shimReplaceTrack(window: Window): void;
}

interface IFirefoxShim {
shimOnTrack(window: Window): void;
shimPeerConnection(window: Window): void;
Expand All @@ -53,7 +48,7 @@ declare module "webrtc-adapter" {
export interface IAdapter {
browserDetails: IBrowserDetails;
commonShim: ICommonShim;
browserShim: IChromeShim | IEdgeShim | IFirefoxShim | ISafariShim | undefined;
browserShim: IChromeShim | IFirefoxShim | ISafariShim | undefined;
extractVersion(uastring: string, expr: string, pos: number): number;
disableLog(disable: boolean): void;
disableWarnings(disable: boolean): void;
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"e2e-tests": "grunt && grunt downloadBrowser && karma start test/karma.conf.js"
},
"dependencies": {
"rtcpeerconnection-shim": "^1.2.15",
"sdp": "^2.12.0"
},
"engines": {
Expand All @@ -49,7 +48,6 @@
"karma-browserify": "^5.2.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.2.0",
"karma-edge-launcher": "^0.4.1",
"karma-firefox-launcher": "^1.3.0",
"karma-mocha": "^1.3.0",
"karma-mocha-reporter": "^2.2.3",
Expand Down
21 changes: 0 additions & 21 deletions src/js/adapter_factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import * as utils from './utils';

// Browser shims.
import * as chromeShim from './chrome/chrome_shim';
import * as edgeShim from './edge/edge_shim';
import * as firefoxShim from './firefox/firefox_shim';
import * as safariShim from './safari/safari_shim';
import * as commonShim from './common_shim';
Expand All @@ -18,7 +17,6 @@ import * as commonShim from './common_shim';
export function adapterFactory({window} = {}, options = {
shimChrome: true,
shimFirefox: true,
shimEdge: true,
shimSafari: true,
}) {
// Utils.
Expand Down Expand Up @@ -95,25 +93,6 @@ export function adapterFactory({window} = {}, options = {

commonShim.shimRTCIceCandidate(window, browserDetails);
commonShim.shimConnectionState(window, browserDetails);
commonShim.shimMaxMessageSize(window, browserDetails);
commonShim.shimSendThrowTypeError(window, browserDetails);
break;
case 'edge':
if (!edgeShim || !edgeShim.shimPeerConnection || !options.shimEdge) {
logging('MS edge shim is not included in this adapter release.');
return adapter;
}
logging('adapter.js shimming edge.');
// Export to the adapter global object visible in the browser.
adapter.browserShim = edgeShim;

edgeShim.shimGetUserMedia(window, browserDetails);
edgeShim.shimGetDisplayMedia(window, browserDetails);
edgeShim.shimPeerConnection(window, browserDetails);
edgeShim.shimReplaceTrack(window, browserDetails);

// the edge shim implements the full RTCIceCandidate object.

commonShim.shimMaxMessageSize(window, browserDetails);
commonShim.shimSendThrowTypeError(window, browserDetails);
break;
Expand Down
89 changes: 0 additions & 89 deletions src/js/edge/edge_shim.js

This file was deleted.

51 changes: 0 additions & 51 deletions src/js/edge/filtericeservers.js

This file was deleted.

24 changes: 0 additions & 24 deletions src/js/edge/getdisplaymedia.js

This file was deleted.

31 changes: 0 additions & 31 deletions src/js/edge/getusermedia.js

This file was deleted.

5 changes: 0 additions & 5 deletions src/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,6 @@ export function detectBrowser(window) {
result.browser = 'chrome';
result.version = extractVersion(navigator.userAgent,
/Chrom(e|ium)\/(\d+)\./, 2);
} else if (navigator.mediaDevices &&
navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)) { // Edge.
result.browser = 'edge';
result.version = extractVersion(navigator.userAgent,
/Edge\/(\d+).(\d+)$/, 2);
} else if (window.RTCPeerConnection &&
navigator.userAgent.match(/AppleWebKit\/(\d+)\./)) { // Safari.
result.browser = 'safari';
Expand Down
9 changes: 0 additions & 9 deletions test/e2e/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,6 @@ describe('establishes a connection', () => {
});

it('with no explicit end-of-candidates', function(done) {
if (window.adapter.browserDetails.browser === 'edge') {
this.timeout(10000);
}
pc1.oniceconnectionstatechange = function() {
if (pc1.iceConnectionState === 'connected' ||
pc1.iceConnectionState === 'completed') {
Expand Down Expand Up @@ -245,12 +242,6 @@ describe('establishes a connection', () => {
});

describe('with datachannel', function() {
beforeEach(function() {
if (window.adapter.browserDetails.browser === 'edge') {
this.skip();
}
});

it('establishes a connection', (done) => {
pc1.oniceconnectionstatechange = function() {
if (pc1.iceConnectionState === 'connected' ||
Expand Down
3 changes: 1 addition & 2 deletions test/e2e/simulcast.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ describe('simulcast', () => {
});

it('using transceivers APIs', function() {
if (window.adapter.browserDetails.browser === 'edge' ||
window.adapter.browserDetails.browser === 'safari') {
if (window.adapter.browserDetails.browser === 'safari') {
this.skip();
}
const constraints = {video: true};
Expand Down
6 changes: 2 additions & 4 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ const os = require('os');

let browsers;
if (process.env.BROWSER) {
if (process.env.BROWSER === 'MicrosoftEdge') {
browsers = ['Edge'];
} else if (process.env.BROWSER === 'safari') {
if (process.env.BROWSER === 'safari') {
browsers = ['Safari'];
} else if (process.env.BROWSER === 'Electron') {
browsers = ['electron'];
Expand All @@ -24,7 +22,7 @@ if (process.env.BROWSER) {
} else if (os.platform() === 'darwin') {
browsers = ['chrome', 'firefox', 'Safari'];
} else if (os.platform() === 'win32') {
browsers = ['chrome', 'firefox', 'Edge'];
browsers = ['chrome', 'firefox'];
} else {
browsers = ['chrome', 'firefox'];
}
Expand Down
2 changes: 1 addition & 1 deletion test/unit/adapter_factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe('adapter factory', () => {
afterEach(() => {
utils.detectBrowser.restore();
});
['Chrome', 'Firefox', 'Safari', 'Edge'].forEach(browser => {
['Chrome', 'Firefox', 'Safari'].forEach(browser => {
it(browser + ' when disabled', () => {
sinon.stub(utils, 'detectBrowser').returns({
browser: browser.toLowerCase()
Expand Down
Loading