Skip to content

Commit 81c4f00

Browse files
committed
Merge branch 'master' into PeterXu/master
2 parents 7dfcc20 + 1a74bdb commit 81c4f00

15 files changed

+7447
-123
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [ master ]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [ master ]
20+
schedule:
21+
- cron: '29 4 * * 5'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: [ 'javascript' ]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v3
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v2
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
52+
53+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54+
# If this step fails, then you should remove it and run the build manually (see below)
55+
- name: Autobuild
56+
uses: github/codeql-action/autobuild@v2
57+
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
60+
61+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62+
# and modify them (or add more) to build your code if your project
63+
# uses a compiled language
64+
65+
#- run: |
66+
# make bootstrap
67+
# make release
68+
69+
- name: Perform CodeQL Analysis
70+
uses: github/codeql-action/analyze@v2

.github/workflows/main.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Cordova GitHub CI #
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
push:
9+
branches: [ master ]
10+
pull_request:
11+
branches: [ master ]
12+
13+
# Allows you to run this workflow manually from the Actions tab
14+
workflow_dispatch:
15+
16+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17+
jobs:
18+
# This workflow contains a single job called "build"
19+
test:
20+
# The type of runner that the job will run on
21+
runs-on: macOS-11
22+
23+
# Steps represent a sequence of tasks that will be executed as part of the job
24+
steps:
25+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
26+
- uses: actions/checkout@v2
27+
28+
- name: Setup NodeJS 12
29+
uses: actions/setup-node@v1
30+
with:
31+
node-version: "12"
32+
33+
- name: Cache Node.js modules
34+
uses: actions/cache@v2
35+
with:
36+
# npm cache files are stored in `~/.npm` on Linux/macOS
37+
path: ~/.npm
38+
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
39+
restore-keys: |
40+
${{ runner.OS }}-node-
41+
${{ runner.OS }}-
42+
43+
- name: Install Dependencies
44+
run: npm ci
45+
46+
- name: Lint Plugin
47+
run: npm run lint
48+
49+
- name: Build Plugin
50+
run: npm run build
51+
52+
- name: Install Cordova CLI
53+
run: |
54+
mkdir ~/.npm-global
55+
npm config set prefix '~/.npm-global'
56+
export PATH=~/.npm-global/bin:$PATH
57+
npm install cordova@10 -g
58+
59+
- name: Create Cordova app, install plugin then build app
60+
run: |
61+
npm config set prefix '~/.npm-global'
62+
export PATH=~/.npm-global/bin:$PATH
63+
cd ..; cordova create myApp org.apache.cordova.myApp myApp; cd myApp;
64+
cordova platform add ios@latest --verbose
65+
cordova plugin add ../cordova-plugin-iosrtc --verbose
66+
cordova build ios --verbose

.travis.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ env:
88
global:
99
- CORDOVA_PLATFORM=browser
1010
- NODE_VERSION=10
11-
- CORDOVA_VERSION=8
11+
- CORDOVA_VERSION=10
1212
- ANGULAR_CLI_VERSION=8
1313
- IONIC_VERSION=6
14-
- ANDROID_API_LEVEL=28
15-
- ANDROID_SDK_VERSION=28
16-
- ANDROID_BUILD_TOOLS_VERSION=28.0.3
14+
- ANDROID_API_LEVEL=30
15+
- ANDROID_SDK_VERSION=30
16+
- ANDROID_BUILD_TOOLS_VERSION=30.0.3
1717
- ANDROID_ABI=armeabi-v7a
1818
- JAVA_HOME=/usr/lib/jvm/java-8-oracle
1919
install:
@@ -48,15 +48,14 @@ matrix:
4848
- jq
4949
android:
5050
components:
51+
# Uncomment the lines below if you want to
52+
# use the latest revision of Android SDK Tools
5153
- tools
52-
- platform-tools-28.0.2
53-
- platform-tools-29.0.2
54-
# The BuildTools version used by your project
55-
- build-tools-28.0.3
54+
- platform-tools
55+
# The BuildTools version used
5656
- build-tools-29.0.2
57-
# The SDK version used to compile your project
57+
# The SDK version used to compile
5858
- android-29
59-
- android-28
6059
# Additional components
6160
- extra-google-google_play_services
6261
- extra-google-m2repository
@@ -66,12 +65,13 @@ matrix:
6665
licenses:
6766
- android-sdk-preview-license-.+
6867
- android-sdk-license-.+
69-
- android-sdk-license-28
7068
- android-sdk-license-29
7169
- google-gdk-license-.+
7270
before_install:
7371
- export LANG=en_US.UTF-8
7472
- touch $HOME/.android/repositories.cfg
73+
- yes | sdkmanager "platforms;android-$ANDROID_API_LEVEL"
74+
- yes | sdkmanager "build-tools;$ANDROID_BUILD_TOOLS_VERSION"
7575
before_cache:
7676
- "rm -f $HOME/.gradle/caches/modules-2/modules-2.lock"
7777
- "rm -fr $HOME/.gradle/caches/*/plugin-resolution/"

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1+
#### Version 8.0.1
2+
* fix RTCPeerConnection.removeTrack support for sender without track
3+
* add support for local description rollback #704 via @slavchev
4+
15
#### Version 8.0.0
2-
* Implement RTCPeerConnection.addTransceiver #589 via @agelito
6+
* implement RTCPeerConnection.addTransceiver #589 via @agelito
7+
* fix RtpSenders inconsistency after removeTrack call #702 via @RSATom
8+
* fix RTCRtpSender MediaStreamTrack replace #699 via @RSATom
9+
* fix requestPermission returns true if AVAuthorizationStatus is notDetermined #692
10+
* fix crash when used with Janus Audiobridge #691 via @RSATom
11+
* fix Warning [LayoutConstraints] Unable to simultaneously satisfy constraints. #422 via @slavchev
12+
* fixcrash when used with Janus Audiobridge #691 via @RSATom
13+
* extend transceiver/sender/receiver functionality #664 via @slavchev
14+
* fix updateTransceiversState call #661 @ducile
315
* Update to WebRTC.framework M87
416
* Update to WebRTC.framework M84
517

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ This plugin was initially developed at eFace2Face, and later maintained by the c
2828

2929
In order to make this Cordova plugin run into a iOS application some requirements must be satisfied in both development computer and target devices:
3030

31-
* Xcode >= 11.1 (11A1027)
32-
* iOS >= 10.2 (run on lower versions at your own risk, don't report issues)
31+
* Xcode >= 13.2.1 (13C100)
32+
* iOS >= 14.3 (run on lower versions at your own risk, don't report issues)
3333
* `swift-version` => 4.2
34-
* `cordova` >= 7.1.0
35-
* `cordova-ios` >= 4.5.1
34+
* `cordova` >= 11.0.0
35+
* `cordova-ios` >= 6.2.0
3636

3737
### Third-Party Supported Library
3838

@@ -395,7 +395,10 @@ See [CHANGELOG.md](./CHANGELOG.md).
395395
* [Harold Thetiot](https://sylaps.com)
396396

397397
**If you like this project you can support me.**
398-
<a href="https://www.buymeacoffee.com/hthetiot" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-white.png" alt="Buy Me A Coffee" style="height: 51px !important;width: 217px !important;" ></a>
398+
399+
<a href="https://www.buymeacoffee.com/hthetiot" target="_blank">
400+
<img src="https://cdn.buymeacoffee.com/buttons/default-white.png" alt="Buy Me A Coffee" style="height: 51px !important;width: 217px !important;" >
401+
</a>
399402

400403
## License
401404

SECURITY.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
Use this section to tell people about which versions of your project are
6+
currently being supported with security updates.
7+
8+
| Version | Supported |
9+
| ------- | ------------------ |
10+
| 8.x | :white_check_mark: |
11+
| 6.x | :white_check_mark: |
12+
| < 5.x | :x: |
13+
14+
## Reporting a Vulnerability
15+
16+
Use this section to tell people how to report a vulnerability.
17+
18+
Tell them where to go, how often they can expect to get an update on a
19+
reported vulnerability, what to expect if the vulnerability is accepted or
20+
declined, etc.

docs/Building.md

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -89,40 +89,3 @@ end
8989
#### Capacitor
9090

9191
When adding ios support using `npx cap add ios` the bitcode setting mentioned above will need to be set to 'NO' for the App project. Also see above for CocoaPods concerns since `pod install` will run every time you do `npx cap sync ios`
92-
93-
#### Apple Store Submission
94-
95-
You should strip simulator (i386/x86_64) archs from WebRTC binary before submit to Apple Store.
96-
We provide a handy script to do it easily. see below sections.
97-
98-
credit: The script is originally provided via `react-native-webrtc` by [@besarthoxhaj](https://github.com/besarthoxhaj) in [#141](https://github.com/react-native-webrtc/react-native-webrtc/issues/141), thanks!
99-
100-
##### Strip Simulator Archs Usage
101-
102-
The script and example are here: https://github.com/cordova-rtc/cordova-plugin-iosrtc/blob/master/extra/ios_arch.js
103-
104-
1. go to `plugins/cordova-plugin-iosrtc/extra` folder
105-
2. extract all archs first: `node ios_arch.js --extract`
106-
3. re-package device related archs only: `node ios_arch.js --device`
107-
4. delete files generated from `step 2` under `plugins/cordova-plugin-iosrtc/lib/WebRTC.framework/` (e.g. with a command `node ios_arch.js --clean` or manualy `rm plugins/cordova-plugin-iosrtc/lib/WebRTC.framework/WebRTC-*` from application root)
108-
5. you can check current arch use this command `node ios_arch.js --list` or manualy `file plugins/cordova-plugin-iosrtc/lib/WebRTC.framework/WebRTC`
109-
6. Remove ios cordova platform if already added and add ios platform again (e.g. with a command `cordova platform remove ios && cordova platform add ios`) or remove and add only the plugin at your own risk.
110-
111-
###### Capacitor
112-
Using Capacitor; The plugins will be in the node_modules folder so ios_arch will be run in `node_modules/cordova-plugin-iosrtc/extra`
113-
114-
115-
> node node_modules/cordova-plugin-iosrtc/extraios_arch.js --list
116-
> node node_modules/cordova-plugin-iosrtc/extraios_arch.js --simulator
117-
118-
You will need to remove and add ios platform again.
119-
120-
###### Meteor
121-
122-
Using Meteor; The plugins will be in the node_modules folder so ios_arch.js will be run in `.meteor/local/cordova-build/node_modules/cordova-plugin-iosrtc/extra/`
123-
124-
> node .meteor/local/cordova-build/node_modules/cordova-plugin-iosrtc/extra/ios_arch.js --list
125-
> node .meteor/local/cordova-build/node_modules/cordova-plugin-iosrtc/extra/ios_arch.js --simulator
126-
127-
You will need to copy manually the updated WebRTC file, since remove/add platform does not work like cordova:
128-
> cp .meteor/local/cordova-build/node_modules/cordova-plugin-iosrtc/lib/WebRTC.framework/WebRTC .meteor/local/cordova-build/platforms/ios/*/Plugins/cordova-plugin-iosrtc/WebRTC.framework/WebRTC

docs/BuildingLibWebRTC.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,13 @@ There are several ways to get and build the library. We choose a project that pe
66

77
[react-native-webrtc/blob/master/Documentation/BuildingWebRTC.md](https://github.com/react-native-webrtc/react-native-webrtc/blob/master/Documentation/BuildingWebRTC.md#building-webrtc)
88

9+
Once you have WebRTC.framework copy the build into [lib](https://github.com/cordova-rtc/cordova-plugin-iosrtc/blob/master/lib/)
10+
11+
#### Generate xcframework
12+
13+
Once you have WebRTC.framework into [lib](https://github.com/cordova-rtc/cordova-plugin-iosrtc/blob/master/lib/), you need to generate WebRTC.xcframework
14+
15+
The script is here: https://github.com/cordova-rtc/cordova-plugin-iosrtc/blob/master/extra/ios_arch.js
16+
17+
1. go to `plugins/cordova-plugin-iosrtc/extra` folder
18+
2. generate xcframework using: `node ios_arch.js --xcframework`

js/RTCPeerConnection.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ RTCPeerConnection.prototype.setLocalDescription = function (desc) {
273273

274274
debug('setLocalDescription() | success');
275275
// Update localDescription.
276-
self._localDescription = new RTCSessionDescription(data);
276+
self._localDescription = data.type === '' ? null : new RTCSessionDescription(data);
277277
resolve();
278278
}
279279

@@ -555,6 +555,11 @@ RTCPeerConnection.prototype.removeTrack = function (sender) {
555555

556556
track = sender.track;
557557

558+
// No sender track found
559+
if (!track) {
560+
return;
561+
}
562+
558563
function matchLocalTrack(localTrack) {
559564
return localTrack.id === track.id;
560565
}

js/RTCRtpSender.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = RTCRtpSender;
77
* Dependencies.
88
*/
99
var exec = require('cordova/exec'),
10-
MediaStreamTrack = require('./MediaStreamTrack'),
10+
{ MediaStreamTrack } = require('./MediaStreamTrack'),
1111
randomNumber = require('random-number').generator({ min: 10000, max: 99999, integer: true });
1212

1313
function RTCRtpSender(pc, data) {
@@ -17,6 +17,9 @@ function RTCRtpSender(pc, data) {
1717
this._pc = pc;
1818
this.track = data.track ? pc.getOrCreateTrack(data.track) : null;
1919
this.params = data.params || {};
20+
if (this.track) {
21+
this.dtmf = pc.createDTMFSender(this.track);
22+
}
2023
}
2124

2225
RTCRtpSender.prototype.getParameters = function () {

0 commit comments

Comments
 (0)