@capgo/native-audio 7.3.35 → 7.3.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,8 +3,8 @@
3
3
  <a href="https://capgo.app/"><img src='https://raw.githubusercontent.com/Cap-go/capgo/main/assets/capgo_banner.png' alt='Capgo - Instant updates for capacitor'/></a>
4
4
 
5
5
  <div align="center">
6
- <h2><a href="https://capgo.app/?ref=plugin"> ➡️ Get Instant updates for your App with Capgo 🚀</a></h2>
7
- <h2><a href="https://capgo.app/consulting/?ref=plugin"> Fix your annoying bug now, Hire a Capacitor expert 💪</a></h2>
6
+ <h2><a href="https://capgo.app/?ref=plugin"> ➡️ Get Instant updates for your App with Capgo</a></h2>
7
+ <h2><a href="https://capgo.app/consulting/?ref=plugin"> Missing a feature? We’ll build the plugin for you 💪</a></h2>
8
8
  </div>
9
9
 
10
10
  <h3 align="center">Native Audio</h3>
@@ -617,6 +617,7 @@ public class NativeAudio extends Plugin implements AudioManager.OnAudioFocusChan
617
617
  AssetManager am = ctx.getResources().getAssets();
618
618
  AssetFileDescriptor assetFileDescriptor = am.openFd(assetPath);
619
619
  AudioAsset asset = new AudioAsset(this, audioId, assetFileDescriptor, audioChannelNum, volume);
620
+ asset.setCompletionListener(this::dispatchComplete);
620
621
  audioAssetList.put(audioId, asset);
621
622
  call.resolve(status);
622
623
  } catch (IOException e) {
@@ -120,6 +120,8 @@ public class RemoteAudioAsset extends AudioAsset {
120
120
  Log.d(TAG, "Notifying duration: " + durationSec + " seconds");
121
121
  owner.notifyDurationAvailable(assetId, durationSec);
122
122
  }
123
+ } else if (playbackState == Player.STATE_ENDED) {
124
+ notifyCompletion();
123
125
  }
124
126
  }
125
127
 
@@ -180,7 +182,6 @@ public class RemoteAudioAsset extends AudioAsset {
180
182
  Log.e(TAG, "Error playing after prepare", e);
181
183
  }
182
184
  } else if (playbackState == Player.STATE_ENDED) {
183
- owner.dispatchComplete(getAssetId());
184
185
  notifyCompletion();
185
186
  }
186
187
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/native-audio",
3
- "version": "7.3.35",
3
+ "version": "7.3.37",
4
4
  "description": "A native plugin for native audio engine",
5
5
  "license": "MIT",
6
6
  "main": "dist/plugin.cjs.js",