@octane-xplat/audio 0.10.0 → 0.11.1
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/dist/native/index2.js
CHANGED
|
@@ -138,13 +138,13 @@ var createAudioPlayer = () => {
|
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
140
|
interruptionObserver = NSNotificationCenter.defaultCenter.addObserverForNameObjectQueueUsingBlock(AVAudioSessionInterruptionNotification, null, NSOperationQueue.mainQueue, (notification) => {
|
|
141
|
-
if (notification.userInfo
|
|
141
|
+
if (notification.userInfo?.objectForKey(AVAudioSessionInterruptionTypeKey)?.unsignedIntegerValue === interruptionBegan) {
|
|
142
142
|
wasPlayingBeforeInterruption = state === "playing";
|
|
143
143
|
player?.pause();
|
|
144
144
|
state = "paused";
|
|
145
145
|
emit();
|
|
146
146
|
} else if (wasPlayingBeforeInterruption) {
|
|
147
|
-
const options = notification.userInfo
|
|
147
|
+
const options = notification.userInfo?.objectForKey(AVAudioSessionInterruptionOptionKey)?.unsignedIntegerValue ?? 0;
|
|
148
148
|
wasPlayingBeforeInterruption = false;
|
|
149
149
|
if ((options & interruptionShouldResume) !== 0) play();
|
|
150
150
|
}
|
package/package.json
CHANGED
package/src/audio.ios.ts
CHANGED
|
@@ -212,9 +212,9 @@ export const createAudioPlayer = (): AudioPlayer => {
|
|
|
212
212
|
null,
|
|
213
213
|
NSOperationQueue.mainQueue,
|
|
214
214
|
(notification) => {
|
|
215
|
-
const type = notification.userInfo
|
|
215
|
+
const type = notification.userInfo?.objectForKey(
|
|
216
216
|
AVAudioSessionInterruptionTypeKey,
|
|
217
|
-
)
|
|
217
|
+
)?.unsignedIntegerValue
|
|
218
218
|
|
|
219
219
|
if (type === interruptionBegan) {
|
|
220
220
|
wasPlayingBeforeInterruption = state === 'playing'
|
|
@@ -223,7 +223,7 @@ export const createAudioPlayer = (): AudioPlayer => {
|
|
|
223
223
|
emit()
|
|
224
224
|
} else if (wasPlayingBeforeInterruption) {
|
|
225
225
|
const options =
|
|
226
|
-
notification.userInfo
|
|
226
|
+
notification.userInfo?.objectForKey(AVAudioSessionInterruptionOptionKey)
|
|
227
227
|
?.unsignedIntegerValue ?? 0
|
|
228
228
|
|
|
229
229
|
wasPlayingBeforeInterruption = false
|