Temasys / AdapterJS

AdapterJS Javascript Polyfill and Tools for WebRTC - Skylink WebRTC
http://skylink.io/web
Other
428 stars 100 forks source link

AJS-261: Extensions upgrade and allowing configuration of extensions from AdapterJS level #268

Closed oooookk7 closed 7 years ago

oooookk7 commented 7 years ago

Note: New extensions must be approved first, and then the ID and links can be updated to this branch before this PR can be merged. Additionally this blocks the release of ESS-886 since it is tested with this branch.

Summary

This PR is to patch Chrome/IE/Safari "mediaSource" flag not being honoured, and realised that an entire extension update has to be done. This is for us to ensure our polyfills and extensions are up-to-date as of what's the current state of things in implementations. This PR might have huge code changes.

Note that we are not waiting for the extensions to be approved due to time constraints, that will be another mini PR for that.

Changelog:

Testing

Note, we should move these test cases to unit tests.

How is it tested:

This uses the navigator.getUserMedia({ audio: true, video: { mediaSource: xx } }).

Chrome

Use the new extension in development mode.

  1. Ensure that when using the new AdapterJS + new DetectRTC + new Chrome extension, whatever "mediaSource" is provided is presented as expected. Like "tab" should result in displaying a list of browser tabs to select. Like ["tab", "audio"] should result in being able to select browser tabs and select audio, or ["tab", "audio"] should return the audio track, or ["screen", "window"] returns a list of screens or windows to select.

  2. Ensure that when using any old AdapterJS / DetectRTC / Chrome extension with new AdapterJS / DetectRTC / Chrome extension should not affect previous functionalities where "window" and "screen" sources is presented.

Firefox

  1. Ensure that for Firefox 52 when PermissionDenied, the popup installation doesn't trigger.

  2. Ensure that for Firefox 51 and below when PermissionDenied, the popup installation does trigger.

  3. Ensure that "camera", "browser", "application" are valid sources for "mediaSource".

Opera

Use the new extension in development mode.

  1. Ensure that screensharing extension triggers for the list of sources.

Test cases tested:

Chrome extension test:

Extension tested in development mode.

Result AdapterJS DetectRTC Chrome Extension
PASS Branch 0.1.1 0.1.3
PASS Branch 0.1.1 0.1.4
PASS Branch 0.1.2 0.1.3
PASS Branch 0.1.2 0.1.4
PASS 0.14.1 0.1.1 0.1.3
PASS 0.14.1 0.1.1 0.1.4
PASS 0.14.1 0.1.2 0.1.3
PASS 0.14.1 0.1.2 0.1.4

Firefox versions test:

Result Firefox Addon installation popup triggered
PASS 52 No
PASS 49 Yes

Constraints test:

Extensions are tested in development mode, except for Firefox. Note that for the current Chrome extension ljckddiekopnnjoeaiofddfhgnbdoafc as a fallback alternative will not honour the "mediaSource" flag and return ["window", "screen"] as expected. This should be different in the new Chrome extension when approved.

Result Browser Constraints - "mediaSource"
PASS Opera/Chrome "tab"
PASS Opera/Chrome "window"
PASS Opera/Chrome "screen"
PASS Opera/Chrome ["tab", "audio"] audio: false
PASS Opera/Chrome ["tab", "audio"] audio: true
PASS Opera/Chrome ["tab", "screen"]
PASS Opera/Chrome ["tab", "window"]
PASS Opera/Chrome ["window", "screen"]
PASS Opera/Chrome ["window", "screen", "tab"]
PASS Chrome Android ["screen"]
PASS Chrome Android "screen"
PASS Firefox ["screen"]
PASS Firefox "screen"
PASS Firefox ["window"]
PASS Firefox "window"
PASS Firefox ["camera"]
PASS Firefox "camera"
PASS Firefox ["browser"]
PASS Firefox "browser"
PASS Firefox ["application"]
PASS Firefox "application"
PASS Safari/IE "screen"
PASS Safari/IE "window"
PASS Safari/IE ["screen", "window"]
oooookk7 commented 7 years ago

See TWP-704 for plugin. Checked with @miniruwan on the actual way of how it should work and now it works.

oooookk7 commented 7 years ago

@miniruwan removed the if else checks for removing mediaSource flag for plugin.

oooookk7 commented 7 years ago

@johache due to time constraints for urgent release, we are going ahead for the release.