@octane-xplat/audio 0.11.0 → 0.12.0

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.
@@ -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.objectForKey(AVAudioSessionInterruptionTypeKey).unsignedIntegerValue === interruptionBegan) {
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.objectForKey(AVAudioSessionInterruptionOptionKey)?.unsignedIntegerValue ?? 0;
147
+ const options = notification.userInfo?.objectForKey(AVAudioSessionInterruptionOptionKey)?.unsignedIntegerValue ?? 0;
148
148
  wasPlayingBeforeInterruption = false;
149
149
  if ((options & interruptionShouldResume) !== 0) play();
150
150
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 1,
3
- "buildId": "7b522e4d-ec23-4c1c-a8c1-ac62d4cf3513",
3
+ "buildId": "b0dae0b3-c313-419c-8a32-7d32c6f9c827",
4
4
  "mode": "production",
5
5
  "capabilities": {
6
6
  "independentHydration": false
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 1,
3
- "buildId": "694890af-6bd1-4341-b292-6fca50e8ade7",
3
+ "buildId": "e8793268-14ca-474b-b96c-069b9927223e",
4
4
  "mode": "production",
5
5
  "capabilities": {
6
6
  "independentHydration": false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octane-xplat/audio",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "Long-form audio playback for Octane xplat",
5
5
  "keywords": [
6
6
  "android",
@@ -42,9 +42,9 @@
42
42
  },
43
43
  "devDependencies": {
44
44
  "@nativescript-community/octane": "0.2.4",
45
- "@nativescript/core": "9.1.2",
45
+ "@nativescript/core": "9.1.3",
46
46
  "@octanejs/vite-plugin": "0.1.61",
47
- "octane": "0.6.3",
47
+ "octane": "0.10.2",
48
48
  "tsrx-typegen": "0.2.2",
49
49
  "typescript": "5.9.3",
50
50
  "vite": "8.3.0"
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.objectForKey(
215
+ const type = notification.userInfo?.objectForKey(
216
216
  AVAudioSessionInterruptionTypeKey,
217
- ).unsignedIntegerValue
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.objectForKey(AVAudioSessionInterruptionOptionKey)
226
+ notification.userInfo?.objectForKey(AVAudioSessionInterruptionOptionKey)
227
227
  ?.unsignedIntegerValue ?? 0
228
228
 
229
229
  wasPlayingBeforeInterruption = false