Skip to content

Commit

Permalink
Merge pull request #22 from mozartec/feat/capacitor5
Browse files Browse the repository at this point in the history
Feat/capacitor5
  • Loading branch information
Mozart-Alkhateeb authored Jul 25, 2023
2 parents 006ce1d + cf84c7c commit 59a7a45
Show file tree
Hide file tree
Showing 50 changed files with 11,109 additions and 31,639 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.16.1
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Checks microphone permission

**Returns:** <code>Promise&lt;<a href="#permissionstatus">PermissionStatus</a>&gt;</code>

**Since:** 0.0.3

--------------------


Expand All @@ -91,6 +93,8 @@ Requests microphone permission

**Returns:** <code>Promise&lt;<a href="#permissionstatus">PermissionStatus</a>&gt;</code>

**Since:** 0.0.3

--------------------


Expand All @@ -102,6 +106,8 @@ startRecording() => Promise<void>

Starts recoding session if no session is in progress

**Since:** 0.0.3

--------------------


Expand All @@ -115,6 +121,8 @@ Stops recoding session if one is in progress

**Returns:** <code>Promise&lt;<a href="#audiorecording">AudioRecording</a>&gt;</code>

**Since:** 0.0.3

--------------------


Expand All @@ -130,15 +138,15 @@ Stops recoding session if one is in progress

#### AudioRecording

| Prop | Type | Description |
| ------------------ | ------------------- | --------------------------------------------------------------------------------------------------------------- |
| **`base64String`** | <code>string</code> | The base64 encoded string representation of the audio file. |
| **`dataUrl`** | <code>string</code> | The url starting with 'data:audio/aac;base64,' and the base64 encoded string representation of the audio file. |
| **`path`** | <code>string</code> | platform-specific file URL that can be read later using the Filesystem API. |
| **`webPath`** | <code>string</code> | webPath returns a path that can be used to set the src attribute of an audio element can be useful for testing. |
| **`duration`** | <code>number</code> | recoding duration in milliseconds |
| **`format`** | <code>string</code> | file extension (only .m4a supported on this version) |
| **`mimeType`** | <code>string</code> | file encoding "audio/aac" (kAudioFormatMPEG4AAC for iOS) (MPEG_4 / AAC for Android) |
| Prop | Type | Description | Since |
| ------------------ | ------------------- | --------------------------------------------------------------------------------------------------------------- | ----- |
| **`base64String`** | <code>string</code> | The base64 encoded string representation of the audio file. | 0.0.3 |
| **`dataUrl`** | <code>string</code> | The url starting with 'data:audio/aac;base64,' and the base64 encoded string representation of the audio file. | 0.0.3 |
| **`path`** | <code>string</code> | platform-specific file URL that can be read later using the Filesystem API. | 0.0.3 |
| **`webPath`** | <code>string</code> | webPath returns a path that can be used to set the src attribute of an audio element can be useful for testing. | 0.0.3 |
| **`duration`** | <code>number</code> | recoding duration in milliseconds | 0.0.3 |
| **`format`** | <code>string</code> | file extension (only .m4a supported on this version) | 0.0.3 |
| **`mimeType`** | <code>string</code> | file encoding "audio/aac" (kAudioFormatMPEG4AAC for iOS) (MPEG_4 / AAC for Android) | 0.0.3 |


### Type Aliases
Expand Down
13 changes: 6 additions & 7 deletions _demo/AngularMicrophone/.browserslistrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
# You can see what browsers were selected by your queries by running:
# npx browserslist

last 1 Chrome version
last 1 Firefox version
last 2 Edge major versions
last 2 Safari major versions
last 2 iOS major versions
Firefox ESR
not IE 11 # Angular supports IE 11 only as an opt-in. To opt-in, remove the 'not' prefix on this line.
Chrome >=79
ChromeAndroid >=79
Firefox >=70
Edge >=79
Safari >=14
iOS >=14
5 changes: 2 additions & 3 deletions _demo/AngularMicrophone/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
{
"files": ["*.ts"],
"parserOptions": {
"project": ["./tsconfig.json", "./e2e/tsconfig.json"],
"project": ["tsconfig.json"],
"createDefaultProgram": true
},
"extends": [
"plugin:@angular-eslint/ng-cli-compat",
"plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
Expand Down
61 changes: 49 additions & 12 deletions _demo/AngularMicrophone/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,63 @@
.tmp
*.tmp
*.tmp.*
*.sublime-project
*.sublime-workspace
.DS_Store
Thumbs.db
UserInterfaceState.xcuserstate
$RECYCLE.BIN/

*.log
log.txt
npm-debug.log*

/.idea
/.ionic
/.sass-cache

/.sourcemaps
/.versions
/.vscode
/coverage
/dist
/node_modules

# Ionic
/.ionic
/www
/platforms
/plugins
/www

# Compiled output
/dist
/tmp
/out-tsc
/bazel-out

# Node
/node_modules
npm-debug.log
yarn-error.log

# IDEs and editors
.idea/
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-project
*.sublime-workspace

# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*


# Miscellaneous
/.angular
/.angular/cache
.sass-cache/
/connect.lock
/coverage
/libpeerconnection.log
testem.log
/typings

# System files
.DS_Store
Thumbs.db
5 changes: 5 additions & 0 deletions _demo/AngularMicrophone/android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,8 @@ capacitor-cordova-android-plugins

# Copied web assets
app/src/main/assets/public

# Generated Config files
app/src/main/assets/capacitor.config.json
app/src/main/assets/capacitor.plugins.json
app/src/main/res/xml/config.xml
1 change: 1 addition & 0 deletions _demo/AngularMicrophone/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apply plugin: 'com.android.application'

android {
namespace "com.mozartec.capacitor.microphone.angular"
compileSdkVersion rootProject.ext.compileSdkVersion
defaultConfig {
applicationId "com.mozartec.capacitor.microphone.angular"
Expand Down
5 changes: 3 additions & 2 deletions _demo/AngularMicrophone/android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}

Expand All @@ -12,6 +12,7 @@ dependencies {
implementation project(':capacitor-app')
implementation project(':capacitor-haptics')
implementation project(':capacitor-keyboard')
implementation project(':capacitor-status-bar')
implementation project(':mozartec-capacitor-microphone')

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mozartec.capacitor.microphone.angular">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand All @@ -13,7 +12,7 @@
<activity
android:exported="true"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
android:name="com.mozartec.capacitor.microphone.angular.MainActivity"
android:name=".MainActivity"
android:label="@string/title_activity_main"
android:theme="@style/AppTheme.NoActionBarLaunch"
android:launchMode="singleTask">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"appId": "com.mozartec.capacitor.microphone.angular",
"appName": "AngularMicrophone",
"webDir": "www",
"bundledWebRuntime": false
"server": {
"androidScheme": "https"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
"pkg": "@capacitor/keyboard",
"classpath": "com.capacitorjs.plugins.keyboard.KeyboardPlugin"
},
{
"pkg": "@capacitor/status-bar",
"classpath": "com.capacitorjs.plugins.statusbar.StatusBarPlugin"
},
{
"pkg": "@mozartec/capacitor-microphone",
"classpath": "com.mozartec.capacitor.microphone.MicrophonePlugin"
Expand Down
6 changes: 3 additions & 3 deletions _demo/AngularMicrophone/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.google.gms:google-services:4.3.13'
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.google.gms:google-services:4.3.15'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
3 changes: 3 additions & 0 deletions _demo/AngularMicrophone/android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@ project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/
include ':capacitor-keyboard'
project(':capacitor-keyboard').projectDir = new File('../node_modules/@capacitor/keyboard/android')

include ':capacitor-status-bar'
project(':capacitor-status-bar').projectDir = new File('../node_modules/@capacitor/status-bar/android')

include ':mozartec-capacitor-microphone'
project(':mozartec-capacitor-microphone').projectDir = new File('../../../android')
2 changes: 0 additions & 2 deletions _demo/AngularMicrophone/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,3 @@ org.gradle.jvmargs=-Xmx1536m
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 14 additions & 4 deletions _demo/AngularMicrophone/android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,10 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
Expand Down Expand Up @@ -143,12 +143,16 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -205,6 +209,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
15 changes: 9 additions & 6 deletions _demo/AngularMicrophone/android/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
Loading

0 comments on commit 59a7a45

Please sign in to comment.