Skip to content

Commit f6138fe

Browse files
fix: Seek not applied in play method (#1695)
# Description This PR is fixing the bug in which in web while initialising the play with duration specified, there was no seek happening, which means that it starts from the beginning itself. setting the source before calling seek in play() function, instead of setting it afterwards solves the issue. Closes #1597
1 parent 0119378 commit f6138fe

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/audioplayers/lib/src/audioplayer.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,12 @@ class AudioPlayer {
199199
if (ctx != null) {
200200
await setAudioContext(ctx);
201201
}
202+
203+
await setSource(source);
202204
if (position != null) {
203205
await seek(position);
204206
}
205-
await setSource(source);
207+
206208
await resume();
207209
}
208210

0 commit comments

Comments
 (0)