@@ -969,7 +969,7 @@ class AudioPlayer {
969
969
void checkInterruption () {
970
970
if (_activationCount != activationNumber) {
971
971
// the platform has changed since we started loading, so abort.
972
- throw PlatformException (code : 'abort' , message : 'Loading interrupted' );
972
+ throw PlayerInterruptedException ( 'Loading interrupted' );
973
973
}
974
974
}
975
975
@@ -992,7 +992,7 @@ class AudioPlayer {
992
992
checkInterruption ();
993
993
if (platform != _platformValue) {
994
994
// the platform has changed since we started loading, so abort.
995
- throw PlatformException (code : 'abort' , message : 'Loading interrupted' );
995
+ throw PlayerInterruptedException ( 'Loading interrupted' );
996
996
}
997
997
// Wait for loading state to pass.
998
998
await processingStateStream
@@ -1464,10 +1464,7 @@ class AudioPlayer {
1464
1464
// An interruption that we can ignore
1465
1465
if (! active) return true ;
1466
1466
// An interruption that should throw
1467
- final e =
1468
- PlatformException (code: 'abort' , message: 'Loading interrupted' );
1469
- durationCompleter.completeError (e);
1470
- throw e;
1467
+ throw PlayerInterruptedException ('Loading interrupted' );
1471
1468
}
1472
1469
1473
1470
// This method updates _active and _platform before yielding to the next
@@ -1708,7 +1705,7 @@ class AudioPlayer {
1708
1705
}
1709
1706
1710
1707
_platform = setPlatform ();
1711
- return durationCompleter.future;
1708
+ return _platform. then ((_) => durationCompleter.future) ;
1712
1709
}
1713
1710
1714
1711
/// Disposes of the given platform.
0 commit comments