Commit 6f24c8f
authored
fix(android): reset prepared state on player error (#1425)
In the rare case, that an media player error occurs (like when playing
unsupported media sources), the player still is in the "prepared" state,
although the internal MediaPlayer state isn't anymore. Then it could keep
calling methods, which lead to an illegal MediaPlayer state. By
resetting this variable on a media error, this should not make the
library crash anymore, but still emit the error.
Fixes #1260
Fixes #13311 parent aee480b commit 6f24c8f
1 file changed
Lines changed: 3 additions & 0 deletions
File tree
- packages/audioplayers_android/android/src/main/kotlin/xyz/luan/audioplayers/player
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
269 | 272 | | |
270 | 273 | | |
271 | 274 | | |
| |||
0 commit comments