Skip to content

Commit 4cb9a66

Browse files
authored
Merge pull request #3556 from NoelDeMartin/MOBILE-2314
MOBILE-2314: Audio Recorder improvements
2 parents 2bacbe7 + 52cfb18 commit 4cb9a66

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1396
-448
lines changed

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ WORKDIR /app
66
# Prepare node dependencies
77
RUN apt-get update && apt-get install libsecret-1-0 -y
88
COPY package*.json ./
9+
COPY patches ./patches
10+
RUN echo "unsafe-perm=true" > ./.npmrc
911
RUN npm ci --no-audit
1012

1113
# Build source

angular.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,19 @@
4242
"input": "src/theme/theme.scss"
4343
}
4444
],
45-
"scripts": []
45+
"scripts": [],
46+
"webWorkerTsConfig": "tsconfig.worker.json"
4647
},
4748
"configurations": {
4849
"production": {
4950
"fileReplacements": [
5051
{
5152
"replace": "src/testing/testing.module.ts",
5253
"with": "src/testing/testing.module.prod.ts"
54+
},
55+
{
56+
"replace": "src/core/features/emulator/emulator.module.ts",
57+
"with": "src/core/features/emulator/emulator.module.prod.ts"
5358
}
5459
],
5560
"optimization": {

config.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,6 @@
196196
<param name="android-package" value="com.adobe.phonegap.push.PushPlugin" />
197197
</feature>
198198
</config-file>
199-
<config-file parent="/*" target="res/xml/config.xml">
200-
<feature name="Media">
201-
<param name="android-package" value="org.apache.cordova.media.AudioHandler" />
202-
</feature>
203-
</config-file>
204199
<config-file parent="/*" target="AndroidManifest.xml">
205200
<uses-feature android:name="android.hardware.bluetooth" android:required="false" />
206201
</config-file>

package-lock.json

Lines changed: 19 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"build": "ionic build",
2525
"build:prod": "NODE_ENV=production ionic build --prod",
2626
"build:test": "NODE_ENV=testing ionic build --configuration=testing",
27-
"dev:android": "ionic cordova run android --livereload",
27+
"dev:android": "ionic cordova run android --livereload --external --ssl",
2828
"dev:ios": "ionic cordova run ios",
2929
"prod:android": "NODE_ENV=production ionic cordova run android --prod",
3030
"prod:ios": "NODE_ENV=production ionic cordova run ios --prod",
@@ -63,7 +63,6 @@
6363
"@ionic-native/ionic-webview": "5.36.0",
6464
"@ionic-native/keyboard": "5.36.0",
6565
"@ionic-native/local-notifications": "5.36.0",
66-
"@ionic-native/media": "5.36.0",
6766
"@ionic-native/media-capture": "5.36.0",
6867
"@ionic-native/network": "5.36.0",
6968
"@ionic-native/push": "5.36.0",
@@ -104,7 +103,6 @@
104103
"cordova-plugin-file": "6.0.2",
105104
"cordova-plugin-geolocation": "4.1.0",
106105
"cordova-plugin-ionic-keyboard": "2.2.0",
107-
"cordova-plugin-media": "5.0.4",
108106
"cordova-plugin-media-capture": "3.0.3",
109107
"cordova-plugin-network-information": "3.0.0",
110108
"cordova-plugin-prevent-override": "1.0.1",
@@ -122,6 +120,7 @@
122120
"mathjax": "2.7.9",
123121
"moment": "2.29.4",
124122
"moment-timezone": "0.5.38",
123+
"mp3-mediarecorder": "^4.0.5",
125124
"nl.kingsquare.cordova.background-audio": "1.0.1",
126125
"ogv": "1.8.9",
127126
"rxjs": "6.5.5",
@@ -224,9 +223,6 @@
224223
"ANDROID_SUPPORT_V4_VERSION": "26.+"
225224
},
226225
"cordova-plugin-media-capture": {},
227-
"cordova-plugin-media": {
228-
"KEEP_AVAUDIOSESSION_ALWAYS_ACTIVE": "NO"
229-
},
230226
"cordova-plugin-network-information": {},
231227
"@moodlehq/cordova-plugin-qrscanner": {},
232228
"cordova-plugin-splashscreen": {},
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
diff --git a/node_modules/event-target-shim/index.d.ts b/node_modules/event-target-shim/index.d.ts
2+
index 7a5bfc7..ba5e7d8 100644
3+
--- a/node_modules/event-target-shim/index.d.ts
4+
+++ b/node_modules/event-target-shim/index.d.ts
5+
@@ -359,7 +359,7 @@ export declare namespace defineCustomEventTarget {
6+
/**
7+
* The interface of CustomEventTarget.
8+
*/
9+
- type CustomEventTarget<TEventMap extends Record<string, Event>, TMode extends "standard" | "strict"> = EventTarget<TEventMap, TMode> & defineEventAttribute.EventAttributes<any, TEventMap>;
10+
+ type CustomEventTarget<TEventMap extends Record<string, Event>, TMode extends "standard" | "strict"> = EventTarget<TEventMap, TMode> & defineEventAttribute.EventAttributes<any>;
11+
}
12+
/**
13+
* Define an event attribute.
14+
@@ -368,14 +368,12 @@ export declare namespace defineCustomEventTarget {
15+
* @param _eventClass Unused, but to infer `Event` class type.
16+
* @deprecated Use `getEventAttributeValue`/`setEventAttributeValue` pair on your derived class instead because of static analysis friendly.
17+
*/
18+
-export declare function defineEventAttribute<TEventTarget extends EventTarget, TEventType extends string, TEventConstrucor extends typeof Event>(target: TEventTarget, type: TEventType, _eventClass?: TEventConstrucor): asserts target is TEventTarget & defineEventAttribute.EventAttributes<TEventTarget, Record<TEventType, InstanceType<TEventConstrucor>>>;
19+
+export declare function defineEventAttribute<TEventTarget extends EventTarget, TEventType extends string, TEventConstrucor extends typeof Event>(target: TEventTarget, type: TEventType, _eventClass?: TEventConstrucor): asserts target is TEventTarget & defineEventAttribute.EventAttributes<TEventTarget>;
20+
export declare namespace defineEventAttribute {
21+
/**
22+
* Definition of event attributes.
23+
*/
24+
- type EventAttributes<TEventTarget extends EventTarget<any, any>, TEventMap extends Record<string, Event>> = {
25+
- [P in string & keyof TEventMap as `on${P}`]: EventTarget.CallbackFunction<TEventTarget, TEventMap[P]> | null;
26+
- };
27+
+ type EventAttributes<TEventTarget extends EventTarget<any, any>> = Record<string, EventTarget.CallbackFunction<TEventTarget, any> | null>;
28+
}
29+
/**
30+
* Set the warning handler.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
diff --git a/node_modules/mp3-mediarecorder/dist/index.es.js b/node_modules/mp3-mediarecorder/dist/index.es.js
2+
index 7a96961..82ec4e8 100644
3+
--- a/node_modules/mp3-mediarecorder/dist/index.es.js
4+
+++ b/node_modules/mp3-mediarecorder/dist/index.es.js
5+
@@ -357,8 +357,7 @@ class Event$1 {
6+
InitEventWasCalledWhileDispatching.warn();
7+
return;
8+
}
9+
- internalDataMap.set(this, {
10+
- ...data,
11+
+ internalDataMap.set(this, Object.assign({}, data, {
12+
type: String(type),
13+
bubbles: Boolean(bubbles),
14+
cancelable: Boolean(cancelable),
15+
@@ -366,8 +365,8 @@ class Event$1 {
16+
currentTarget: null,
17+
stopPropagationFlag: false,
18+
stopImmediatePropagationFlag: false,
19+
- canceledFlag: false,
20+
- });
21+
+ canceledFlag: false
22+
+ }));
23+
}
24+
}
25+
//------------------------------------------------------------------------------
26+
diff --git a/node_modules/mp3-mediarecorder/dist/index.es5.js b/node_modules/mp3-mediarecorder/dist/index.es5.js
27+
index 0caa82d..aa46cc2 100644
28+
--- a/node_modules/mp3-mediarecorder/dist/index.es5.js
29+
+++ b/node_modules/mp3-mediarecorder/dist/index.es5.js
30+
@@ -418,7 +418,7 @@ class Event$1 {
31+
return;
32+
}
33+
34+
- internalDataMap.set(this, { ...data,
35+
+ internalDataMap.set(this, Object.assign({}, data, {
36+
type: String(type),
37+
bubbles: Boolean(bubbles),
38+
cancelable: Boolean(cancelable),
39+
@@ -427,7 +427,7 @@ class Event$1 {
40+
stopPropagationFlag: false,
41+
stopImmediatePropagationFlag: false,
42+
canceledFlag: false
43+
- });
44+
+ }));
45+
}
46+
47+
} //------------------------------------------------------------------------------
48+
diff --git a/node_modules/mp3-mediarecorder/dist/index.js b/node_modules/mp3-mediarecorder/dist/index.js
49+
index f7a517e..5f7f415 100644
50+
--- a/node_modules/mp3-mediarecorder/dist/index.js
51+
+++ b/node_modules/mp3-mediarecorder/dist/index.js
52+
@@ -418,7 +418,7 @@ class Event$1 {
53+
return;
54+
}
55+
56+
- internalDataMap.set(this, { ...data,
57+
+ internalDataMap.set(this, Object.assign({}, data, {
58+
type: String(type),
59+
bubbles: Boolean(bubbles),
60+
cancelable: Boolean(cancelable),
61+
@@ -427,7 +427,7 @@ class Event$1 {
62+
stopPropagationFlag: false,
63+
stopImmediatePropagationFlag: false,
64+
canceledFlag: false
65+
- });
66+
+ }));
67+
}
68+
69+
} //------------------------------------------------------------------------------
70+
diff --git a/node_modules/mp3-mediarecorder/dist/index.umd.js b/node_modules/mp3-mediarecorder/dist/index.umd.js
71+
index 3f5f2a2..dd7783d 100644
72+
--- a/node_modules/mp3-mediarecorder/dist/index.umd.js
73+
+++ b/node_modules/mp3-mediarecorder/dist/index.umd.js
74+
@@ -418,7 +418,7 @@ class Event$1 {
75+
return;
76+
}
77+
78+
- internalDataMap.set(this, { ...data,
79+
+ internalDataMap.set(this, Object.assign({}, data, {
80+
type: String(type),
81+
bubbles: Boolean(bubbles),
82+
cancelable: Boolean(cancelable),
83+
@@ -427,7 +427,7 @@ class Event$1 {
84+
stopPropagationFlag: false,
85+
stopImmediatePropagationFlag: false,
86+
canceledFlag: false
87+
- });
88+
+ }));
89+
}
90+
91+
} //------------------------------------------------------------------------------

scripts/copy-assets.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const ASSETS = {
2727
'/node_modules/mathjax/jax/output/SVG': '/lib/mathjax/jax/output/SVG',
2828
'/node_modules/mathjax/jax/output/PreviewHTML': '/lib/mathjax/jax/output/PreviewHTML',
2929
'/node_modules/mathjax/localization': '/lib/mathjax/localization',
30+
'/node_modules/mp3-mediarecorder/dist/vmsg.wasm': '/lib/vmsg/vmsg.wasm',
3031
'/src/core/features/h5p/assets': '/lib/h5p',
3132
'/node_modules/ogv/dist': '/lib/ogv',
3233
'/node_modules/video.js/dist/video-js.min.css': '/lib/video.js/video-js.min.css',

scripts/langindex.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,9 +1742,11 @@
17421742
"core.filenotfound": "resource",
17431743
"core.fileuploader.addfiletext": "repository",
17441744
"core.fileuploader.audio": "local_moodlemobileapp",
1745+
"core.fileuploader.audiotitle": "tiny_recordrtc",
17451746
"core.fileuploader.camera": "local_moodlemobileapp",
17461747
"core.fileuploader.confirmuploadfile": "local_moodlemobileapp",
17471748
"core.fileuploader.confirmuploadunknownsize": "local_moodlemobileapp",
1749+
"core.fileuploader.discardrecording": "local_moodlemobileapp",
17481750
"core.fileuploader.errorcapturingaudio": "local_moodlemobileapp",
17491751
"core.fileuploader.errorcapturingimage": "local_moodlemobileapp",
17501752
"core.fileuploader.errorcapturingvideo": "local_moodlemobileapp",
@@ -1758,11 +1760,18 @@
17581760
"core.fileuploader.fileuploaded": "local_moodlemobileapp",
17591761
"core.fileuploader.invalidfiletype": "repository",
17601762
"core.fileuploader.maxbytesfile": "local_moodlemobileapp",
1763+
"core.fileuploader.microphonepermissiondenied": "local_moodlemobileapp",
1764+
"core.fileuploader.microphonepermissionrestricted": "local_moodlemobileapp",
17611765
"core.fileuploader.more": "data",
1766+
"core.fileuploader.pauserecording": "local_moodlemobileapp",
17621767
"core.fileuploader.photoalbums": "local_moodlemobileapp",
17631768
"core.fileuploader.readingfile": "local_moodlemobileapp",
17641769
"core.fileuploader.readingfileperc": "local_moodlemobileapp",
1770+
"core.fileuploader.resumerecording": "local_moodlemobileapp",
17651771
"core.fileuploader.selectafile": "local_moodlemobileapp",
1772+
"core.fileuploader.startrecording": "tiny_recordrtc",
1773+
"core.fileuploader.startrecordinginstructions": "local_moodlemobileapp",
1774+
"core.fileuploader.stoprecording": "tiny_recordrtc",
17661775
"core.fileuploader.uploadafile": "local_moodlemobileapp",
17671776
"core.fileuploader.uploading": "local_moodlemobileapp",
17681777
"core.fileuploader.uploadingperc": "local_moodlemobileapp",

src/addons/mod/data/fields/checkbox/services/handler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
import {
1516
AddonModDataEntryField,
1617
AddonModDataField,

0 commit comments

Comments
 (0)