File tree Expand file tree Collapse file tree
packages/audioplayers/lib/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,9 @@ const _uuid = Uuid();
1919/// hooks for handlers and callbacks.
2020class AudioPlayer {
2121 static final global = GlobalAudioScope ();
22+ static Duration preparationTimeout = const Duration (seconds: 30 );
23+ static Duration seekingTimeout = const Duration (seconds: 30 );
24+
2225 final _platform = AudioplayersPlatformInterface .instance;
2326
2427 /// This is the [AudioCache] instance used by this player.
@@ -291,7 +294,7 @@ class AudioPlayer {
291294 await creatingCompleter.future;
292295
293296 final futureSeekComplete =
294- onSeekComplete.first.timeout (const Duration (seconds : 30 ) );
297+ onSeekComplete.first.timeout (AudioPlayer .seekingTimeout );
295298 final futureSeek = _platform.seek (playerId, position);
296299 // Wait simultaneously to ensure all errors are propagated through the same
297300 // future.
@@ -357,7 +360,7 @@ class AudioPlayer {
357360
358361 final preparedFuture = _onPrepared
359362 .firstWhere ((isPrepared) => isPrepared)
360- .timeout (const Duration (seconds : 30 ) );
363+ .timeout (AudioPlayer .preparationTimeout );
361364 // Need to await the setting the source to propagate immediate errors.
362365 final setSourceFuture = setSource ();
363366
You can’t perform that action at this time.
0 commit comments