Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android only error with NS7 #178

Closed
bradrice opened this issue Dec 4, 2020 · 8 comments
Closed

Android only error with NS7 #178

bradrice opened this issue Dec 4, 2020 · 8 comments

Comments

@bradrice
Copy link

bradrice commented Dec 4, 2020

I've migrated my app to NS7 and one issue I am having is on android. I have an app that has mp3 files associated with lessons. You click through the lessons and pull a new mp3 using a rest service. All of that works fine. What isn't working is I have one template in the lesson sequence that uses a carousel on the same page. When I get to the end of a track, I send a notify click even to advance the slide and start a new audio with image. It was working fine in NS6, but in NS7 I am getting this error on Android only.

ERROR ERROR Error: Uncaught (in promise): Error: java.lang.IllegalArgumentException: Illegal null AudioFocusRequest
JS: _abandonAudioFocus(file: node_modules\nativescript-audio\android\player.js:289:0)
at (file: node_modules\nativescript-audio\android\player.js:120:0)
JS: at ZoneAwarePromise(file: node_modules@nativescript\zone-js\zone-nativescript.js:902:0)
JS: at playFromFile(file: node_modules\nativescript-audio\android\player.js:83:0)
JS: at (file: node_modules\nativescript-audio\android\player.js:133:0)
JS: at ZoneAwarePromise(file: node_modules@nativescript\zone-js\zone-nativescript.js:902:0)
JS: at playFromUrl(file: node_modules\nativescript-audio\android\player.js:132:0)
JS: at playAudioTrack(file: app\core\services\player.service.ts:553:13)
JS: at (file: app\pages\player\templates\carousel\carousel.component.ts:268:35)
JS: at push.../node_modules/@nativescript/zone-js/zone-nativescript.js.ZoneDelegate.invoke(file:///data/data/com.too

@bradrice
Copy link
Author

bradrice commented Dec 9, 2020

I'm closing this. I think it was my own code in calling the playFromURL before it was ready.

@bradrice bradrice closed this as completed Dec 9, 2020
@bradrice
Copy link
Author

bradrice commented Dec 9, 2020

I am reopening this with new info. This seems to throw an error anytime the audio finishes, even if it finishes on it's own.

Unhandled Promise rejection: java.lang.IllegalArgumentException: Illegal null AudioFocusRequest ; Zone: ; Task: null ; Value: Error: java.lang.IllegalArgumentException: Illegal null AudioFocusRequest _abandonAudioFocus(file: node_modules\nativescript-audio\android\player.js:289:0)
JS: at (file: node_modules\nativescript-audio\android\player.js:217:0)
JS: at ZoneAwarePromise(file: node_modules@nativescript\zone-js\zone-nativescript.js:902:0)
JS: at dispose(file: node_modules\nativescript-audio\android\player.js:210:0)
JS: at onError(file: node_modules\nativescript-audio\android\player.js:342:0)

@bradrice bradrice reopened this Dec 9, 2020
@bradrice
Copy link
Author

bradrice commented Dec 11, 2020

The resume function is also failing to gain audio focus.

START
JS: LOG {"_mAudioFocusGranted":false,"_mOnAudioFocusChangeListener":null,"_durationHint":1,"debug":true,"options":{"audioFile":"https://toolingu.com/lms/multi_media/audio/100106_2.mp3","loop":false,"autoPlay":true},"_audioFocusRequest":null,"_mediaPlayer":{},"_events":{"_observers":{}}}
JS: ERROR ERROR Error: Uncaught (in promise): Error: java.lang.NullPointerException: Illegal null focus listener
JS: requestAudioFocus(file: node_modules\nativescript-audio\android\player.js:268:0)
JS: at (file: node_modules\nativescript-audio\android\player.js:155:0)
JS: at ZoneAwarePromise(file: node_modules@nativescript\zone-js\zone-nativescript.js:902:0)
JS: at play(file: node_modules\nativescript-audio\android\player.js:152:0)
JS: at resumePlaying(file: app\core\services\player.service.ts:654:17)
JS: at toggleAudio(file: app\pages\player\audioControls\audio-controls.component.ts:270:39)
JS: at AudioControlsComponent_Template_Button_tap_10_listener(file: app\pages\player\audioControls\audio-controls.component.html:12:83)
JS: at executeListenerWithErrorHandling(file: node_modules@angular\core_ivy_ngcc
\fesm2015\core.js:15214:0)
JS: at wrapListenerIn_markDirtyAndPreventDefault(file: node_modules@angular\core_ivy_ngcc
\fesm2015\core.js:15249:0)

And I'm also getting the same issue when I run the demo app.

@baybal
Copy link

baybal commented Dec 15, 2020

Confirming the issue at 6.2.0

@bradmartin
Copy link
Collaborator

@bradrice try 6.2.1 demo app seems to be functioning correctly with the fix.

@bradrice
Copy link
Author

I am able to get 6.5.3 to work correctly. Will there be a fix for 7 coming?

@bradmartin
Copy link
Collaborator

bradmartin commented Dec 16, 2020

7? I meant the version of this plugin :) 6.2.1 was just published. The latest version will work with NS7, demo app confirmed working with the bug fix just pushed and published.

@bradrice
Copy link
Author

bradrice commented Dec 16, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants