Skip to content

Commit

Permalink
Merge branch 'master' into initialization-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Jun 28, 2024
2 parents 21d2294 + cc8efa6 commit 6d0dd0a
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 35 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install yarn
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'
node-version: '18'

- name: Install deps
run: yarn install
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ isPlaying(options: { assetId: string; }) => Promise<{ isPlaying: boolean; }>
### addListener('complete', ...)

```typescript
addListener(eventName: 'complete', listenerFunc: (event: { assetId: string; }) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
addListener(eventName: 'complete', listenerFunc: (event: { assetId: string; }) => void) => Promise<PluginListenerHandle>
```

Listen for asset completed playing event
Expand All @@ -383,7 +383,7 @@ Listen for asset completed playing event
| **`eventName`** | <code>'complete'</code> |
| **`listenerFunc`** | <code>(event: { assetId: string; }) =&gt; void</code> |

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

**Since:** 5.0.1

Expand Down
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.0.0'
classpath 'com.android.tools.build:gradle:8.2.1'
}
}

apply plugin: 'com.android.library'

android {
namespace "com.getcapacitor.community.audio.nativeaudio"
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
defaultConfig {
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 34
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
Binary file modified android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
12 changes: 8 additions & 4 deletions android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,6 @@ done
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"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

Expand Down Expand Up @@ -133,10 +130,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
Expand Down Expand Up @@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# 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"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ public void configure(PluginCall call) {
this.audioManager.abandonAudioFocus(this);
}
}
call.resolve();
}

@PluginMethod
Expand Down
1 change: 1 addition & 0 deletions ios/Plugin/Plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class NativeAudio: CAPPlugin {
print("Failed to set setCategory audio")
}
}
call.resolve()
}

@objc func preload(_ call: CAPPluginCall) {
Expand Down
10 changes: 0 additions & 10 deletions ios/PluginTests/PluginTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ import Capacitor

class PluginTests: XCTestCase {

override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}

func testEcho() {
// This is an example of a functional test case for a plugin.
// Use XCTAssert and related functions to verify your tests produce the correct results.
Expand Down
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@capacitor-community/native-audio",
"version": "5.0.1",
"version": "6.0.0",
"description": "A native plugin for native audio engine",
"main": "dist/plugin.js",
"module": "dist/esm/index.js",
Expand Down Expand Up @@ -41,15 +41,15 @@
"license": "MIT",
"dependencies": {},
"devDependencies": {
"@capacitor/android": "^5.0.0",
"@capacitor/ios": "^5.0.0",
"@capacitor/cli": "^5.0.0",
"@capacitor/core": "^5.0.0",
"@capacitor/android": "^6.0.0",
"@capacitor/ios": "^6.0.0",
"@capacitor/cli": "^6.0.0",
"@capacitor/core": "^6.0.0",
"@capacitor/docgen": "0.2.1",
"@ionic/eslint-config": "^0.3.0",
"@ionic/eslint-config": "^0.4.0",
"@ionic/prettier-config": "~3.0.0",
"@ionic/swiftlint-config": "^1.1.2",
"eslint": "^7.11.0",
"eslint": "^8.57.0",
"prettier": "~2.8.8",
"prettier-plugin-java": "~2.1.0",
"rimraf": "^5.0.1",
Expand All @@ -59,7 +59,7 @@
"husky": "^8.0.3"
},
"peerDependencies": {
"@capacitor/core": "^5.0.0"
"@capacitor/core": "^6.0.0"
},
"husky": {
"hooks": {
Expand Down
5 changes: 1 addition & 4 deletions src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ export interface NativeAudio {
*
* @since 5.0.1
*/
addListener(
eventName: 'complete',
listenerFunc: (event: { assetId: string }) => void
): Promise<PluginListenerHandle> & PluginListenerHandle;
addListener(eventName: 'complete', listenerFunc: (event: { assetId: string }) => void): Promise<PluginListenerHandle>;
}

export interface ConfigureOptions {
Expand Down

0 comments on commit 6d0dd0a

Please sign in to comment.