@capgo/native-audio 8.1.2 → 8.1.4
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.
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
package ee.forgr.audio;
|
|
2
2
|
|
|
3
3
|
import android.content.res.AssetFileDescriptor;
|
|
4
|
-
import android.os.Build;
|
|
5
4
|
import android.os.Handler;
|
|
6
5
|
import android.os.Looper;
|
|
7
6
|
import android.util.Log;
|
|
8
|
-
import androidx.annotation.RequiresApi;
|
|
9
7
|
import java.util.ArrayList;
|
|
10
8
|
|
|
11
9
|
public class AudioAsset {
|
|
@@ -168,7 +166,6 @@ public class AudioAsset {
|
|
|
168
166
|
}
|
|
169
167
|
}
|
|
170
168
|
|
|
171
|
-
@RequiresApi(api = Build.VERSION_CODES.M)
|
|
172
169
|
public void setRate(float rate) throws Exception {
|
|
173
170
|
for (int x = 0; x < audioList.size(); x++) {
|
|
174
171
|
AudioDispatcher audio = audioList.get(x);
|
|
@@ -41,9 +41,7 @@ public class AudioDispatcher
|
|
|
41
41
|
.build()
|
|
42
42
|
);
|
|
43
43
|
mediaPlayer.setVolume(volume, volume);
|
|
44
|
-
|
|
45
|
-
mediaPlayer.setPlaybackParams(mediaPlayer.getPlaybackParams().setSpeed(1.0f));
|
|
46
|
-
}
|
|
44
|
+
mediaPlayer.setPlaybackParams(mediaPlayer.getPlaybackParams().setSpeed(1.0f));
|
|
47
45
|
mediaPlayer.prepare();
|
|
48
46
|
}
|
|
49
47
|
|
|
@@ -96,9 +94,6 @@ public class AudioDispatcher
|
|
|
96
94
|
}
|
|
97
95
|
|
|
98
96
|
public void setRate(float rate) throws Exception {
|
|
99
|
-
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
97
|
mediaPlayer.setPlaybackParams(mediaPlayer.getPlaybackParams().setSpeed(rate));
|
|
103
98
|
}
|
|
104
99
|
|
|
@@ -691,7 +691,7 @@ public class NativeAudio extends Plugin implements AudioManager.OnAudioFocusChan
|
|
|
691
691
|
|
|
692
692
|
if (audioAssetList.containsKey(audioId)) {
|
|
693
693
|
AudioAsset asset = audioAssetList.get(audioId);
|
|
694
|
-
if (asset != null
|
|
694
|
+
if (asset != null) {
|
|
695
695
|
asset.setRate(rate);
|
|
696
696
|
}
|
|
697
697
|
call.resolve();
|
|
@@ -13,7 +13,7 @@ enum MyError: Error {
|
|
|
13
13
|
// swiftlint:disable type_body_length file_length
|
|
14
14
|
@objc(NativeAudio)
|
|
15
15
|
public class NativeAudio: CAPPlugin, AVAudioPlayerDelegate, CAPBridgedPlugin {
|
|
16
|
-
private let pluginVersion: String = "8.1.
|
|
16
|
+
private let pluginVersion: String = "8.1.4"
|
|
17
17
|
public let identifier = "NativeAudio"
|
|
18
18
|
public let jsName = "NativeAudio"
|
|
19
19
|
public let pluginMethods: [CAPPluginMethod] = [
|