Comments (7)
Getting this too, so far no luck finding out why... it seems in debug mode the app doesn't crash even on device, only in release.
from nativescript-audio.
@tomtastico I made a super hacky(and bad) fix that in no way should be taken to production unless extremely urgent. However, in my case it was urgent so I was left with no choice.
You can check out my fork and to add it to project use tns plugin add https://github.com/aaayushsingh/nativescript-audio
But avoid this unless necessary
from nativescript-audio.
In the end we switched to this fork of nativescript-sound
https://github.com/forgm/nativescript-sound and it works fine with no crashes in iOS. We don't need audio recording so this is enough for us.
from nativescript-audio.
@farfromrefug Thank you for guidance. I am trying this right now. If it works then I will send PR.
from nativescript-audio.
The issue can be replicated multiple times. When running with Xcode, it gives EXC_BAD_ACCESS
I tried tinkering with the code and the issue occurs with the AVAudioSessionDelegate. You can also see this in the screenshots of the crash log below that the error occurs at finishedPlaying.
My initial thought was this was because the WeakRef was somehow getting garbage collected(this was a past known issue with NativeScript) and attempts to access were thus resulting in EXC_BAD_ACCESS but I tried to change that and the crashes were still happening. If we however comment out the line that adds delegate to AVAudioPlayer, The app doesn't crash after the audio finishes playing.
Still not 100% sure about the cause of the error
from nativescript-audio.
@aaayushsingh did you find good solution ?
from nativescript-audio.
@aaayushsingh @govi2010 reading your comment on the cause of the issue i think it is because the delegate is not retained on the JS side.
Changing
this._player.delegate = TNSPlayerDelegate.initWithOwner(this);
to
this.delegate = TNSPlayerDelegate.initWithOwner(this);
this._player.delegate = this.delegate;
could make it not crash however you must add the clearing of the delegate once the object is released
from nativescript-audio.
Related Issues (20)
- 'setAudioStreamType' and 'abandonAudioFocus' are deprecated.
- High severity vulnerabilites reported by npm audit HOT 1
- Demo code crashes: Uncaught (in promise): Error: Could not find module './3.js'
- Can't build demo app HOT 2
- NS7 issue with ios audio HOT 10
- Android only error with NS7 HOT 8
- NS7: EXC_CRASH before audio starts playing
- Android/ios no sound HOT 5
- Is pitch change currently possible?
- Using seekTo while playing from url terminates the playback HOT 1
- JS ERROR Error: Class "AVAudioPlayer" referenced by type encoding not found at runtime
- Please tag releases
- android.media.AudioFocusRequest.Builder crash HOT 3
- how to play two files simultaneously? HOT 1
- Still playing in background HOT 2
- No sound in simulator (iOS) HOT 3
- Can not play audio from my app/assets/audios folder
- Could not request audio focus nativescript-audio version 6.2.6 on Android 14
- ios NSOSStatusErrorDomain HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativescript-audio.