Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Fixed [#477](https://github.com/SimformSolutionsPvtLtd/audio_waveforms/issues/477) - Serialize extractor teardown with a lock and clear codec references to prevent stopping an already-released codec on Android
- Partially fixed [#478](https://github.com/SimformSolutionsPvtLtd/audio_waveforms/issues/478) - Guard decode callbacks against released resources to prevent crash while extracting waveform from ID3v2.4 files on Android
- Fixed [#488](https://github.com/SimformSolutionsPvtLtd/audio_waveforms/issues/488) - Auto-retry playback on transient network loss and run extraction setup off the main thread to prevent crashes and ANR on Android
- Fixed [#429](https://github.com/SimformSolutionsPvtLtd/audio_waveforms/issues/429) - Enable constant bitrate seeking so raw ADTS AAC files are seekable on Android

## 2.0.2

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import com.google.android.exoplayer2.ExoPlayer
import com.google.android.exoplayer2.MediaItem
import com.google.android.exoplayer2.PlaybackException
import com.google.android.exoplayer2.Player
import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory
import com.google.android.exoplayer2.source.DefaultMediaSourceFactory
import io.flutter.plugin.common.MethodChannel

class AudioPlayer(
Expand Down Expand Up @@ -54,7 +56,14 @@ class AudioPlayer(
networkRetryCount = 0
stop()
player?.clearMediaItems()
player = ExoPlayer.Builder(appContext).build()
// Enable CBR seeking so headerless streams (raw ADTS .aac) are seekable (#429).
// Formats with their own seek info (Xing MP3, MP4/M4A, WAV) are unaffected.
val extractorsFactory = DefaultExtractorsFactory()
.setConstantBitrateSeekingEnabled(true)
player = ExoPlayer.Builder(
appContext,
DefaultMediaSourceFactory(appContext, extractorsFactory)
).build()
player?.setMediaItem(mediaItem)
player?.prepare()
playerListener = object : Player.Listener {
Expand Down