From 1d1600bae372b1e07bd12966cd36571b6809d96a Mon Sep 17 00:00:00 2001 From: Gustl22 Date: Thu, 7 Jul 2022 22:15:35 +0200 Subject: [PATCH] fix(web): handle infinite duration (#1192) --- packages/audioplayers_web/lib/wrapped_player.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/audioplayers_web/lib/wrapped_player.dart b/packages/audioplayers_web/lib/wrapped_player.dart index c36f33807..27aa06963 100644 --- a/packages/audioplayers_web/lib/wrapped_player.dart +++ b/packages/audioplayers_web/lib/wrapped_player.dart @@ -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);