@capgo/native-audio
Advanced tools
@@ -321,2 +321,6 @@ @preconcurrency import AVFoundation | ||
| internal func shouldStopCurrentTimeUpdatesWhenNotPlaying() -> Bool { | ||
| true | ||
| } | ||
| public func audioPlayerDidFinishPlaying(_ player: AVAudioPlayer, successfully flag: Bool) { | ||
@@ -349,3 +353,3 @@ owner?.executeOnAudioQueue { [weak self] in | ||
| owner.notifyCurrentTime(self) | ||
| } else { | ||
| } else if self.shouldStopCurrentTimeUpdatesWhenNotPlaying() { | ||
| self.stopCurrentTimeUpdates() | ||
@@ -352,0 +356,0 @@ } |
@@ -15,3 +15,3 @@ @preconcurrency import AVFoundation | ||
| public class NativeAudio: CAPPlugin, AVAudioPlayerDelegate, CAPBridgedPlugin { | ||
| private let pluginVersion: String = "8.3.7" | ||
| private let pluginVersion: String = "8.3.8" | ||
| public let identifier = "NativeAudio" | ||
@@ -18,0 +18,0 @@ public let jsName = "NativeAudio" |
@@ -268,2 +268,17 @@ @preconcurrency import AVFoundation | ||
| override func shouldStopCurrentTimeUpdatesWhenNotPlaying() -> Bool { | ||
| var shouldStop = true | ||
| owner?.executeOnAudioQueue { [weak self] in | ||
| guard let self else { return } | ||
| guard !players.isEmpty && playIndex < players.count else { | ||
| shouldStop = true | ||
| return | ||
| } | ||
| let status = players[playIndex].timeControlStatus | ||
| shouldStop = status != .waitingToPlayAtSpecifiedRate | ||
| } | ||
| return shouldStop | ||
| } | ||
| override func getCurrentTime() -> TimeInterval { | ||
@@ -270,0 +285,0 @@ var result: TimeInterval = 0 |
+1
-1
| { | ||
| "name": "@capgo/native-audio", | ||
| "version": "8.3.7", | ||
| "version": "8.3.8", | ||
| "description": "A native plugin for native audio engine", | ||
@@ -5,0 +5,0 @@ "license": "MPL-2.0", |
+10
-0
@@ -249,3 +249,13 @@ # Native audio | ||
| - **Stop** - Stops audio and clears the notification | ||
| - **Rewind 15s** (Android only) - Skips backward 15 seconds | ||
| - **Forward 15s** (Android only) - Skips forward 15 seconds | ||
| **Android Notification Controls:** | ||
| On Android, the notification displays three action buttons in this order: | ||
| 1. ⏪ **Rewind 15s** - Skip backward 15 seconds | ||
| 2. ▶️/⏸️ **Play/Pause** - Toggle playback (icon updates automatically) | ||
| 3. ⏩ **Forward 15s** - Skip forward 15 seconds | ||
| The skip forward/backward buttons are automatically available when `showNotification: true` is configured. No additional setup is required. | ||
| **Notes:** | ||
@@ -252,0 +262,0 @@ - All metadata fields are optional |
Sorry, the diff of this file is too big to display
677806
1.02%7889
1.41%1180
0.85%