Skip to content

Commit

Permalink
fix(web): handle infinite duration (#1192)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustl22 authored Jul 7, 2022
1 parent c40247e commit 1d1600b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/audioplayers_web/lib/wrapped_player.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class WrappedPlayer {
}
Duration toDuration(num jsNum) => Duration(
milliseconds:
(1000 * (jsNum.toString() == 'NaN' ? 0 : jsNum)).round(),
(1000 * (jsNum.isNaN || jsNum.isInfinite ? 0 : jsNum)).round(),
);

final p = player = AudioElement(currentUrl);
Expand Down

0 comments on commit 1d1600b

Please sign in to comment.