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

fix: 🐛 Cannot catch error of preparePlayer (#301) #368

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

jay-simformsolutions
Copy link
Collaborator

Fixed #301

@@ -42,6 +41,12 @@ class AudioPlayer(
player?.addMediaItem(mediaItem)
player?.prepare()
playerListener = object : Player.Listener {

override fun onPlayerError(error: com.google.android.exoplayer2.PlaybackException) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can import this and just use type here


override fun onPlayerError(error: com.google.android.exoplayer2.PlaybackException) {
super.onPlayerError(error)
result.error(Constants.LOG_TAG, error.message, "Exo-Player Error")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exo player error doesn't look informative.

@@ -61,7 +64,7 @@ flutter:
- assets/audios/audio2.mp3
- assets/audios/audio3.mp3
- assets/audios/audio4.mp3

- assets/audios/audio5.mp3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you forget to remove it?

@jay-simformsolutions jay-simformsolutions force-pushed the fix/301/catchError_not_catch_error branch 3 times, most recently from 50f0427 to 1bc547f Compare November 29, 2024 09:18
@jay-simformsolutions jay-simformsolutions force-pushed the fix/301/catchError_not_catch_error branch from 1bc547f to d08dc3c Compare December 2, 2024 06:52
@ujas-m-simformsolutions ujas-m-simformsolutions merged commit 133305e into main Dec 2, 2024
@ujas-m-simformsolutions ujas-m-simformsolutions deleted the fix/301/catchError_not_catch_error branch December 2, 2024 06:55
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

Successfully merging this pull request may close these issues.

Cannot catch error of preparePlayer
2 participants