Fix pana warnings
This commit is contained in:
parent
26d3e0a612
commit
b836c88dc3
|
@ -71,7 +71,7 @@ abstract class JustAudioPlayer {
|
||||||
case 'seek':
|
case 'seek':
|
||||||
return await seek(args[0]);
|
return await seek(args[0]);
|
||||||
case 'dispose':
|
case 'dispose':
|
||||||
return await dispose();
|
return dispose();
|
||||||
default:
|
default:
|
||||||
throw PlatformException(code: 'Unimplemented');
|
throw PlatformException(code: 'Unimplemented');
|
||||||
}
|
}
|
||||||
|
@ -94,7 +94,7 @@ abstract class JustAudioPlayer {
|
||||||
Future<void> seek(int position);
|
Future<void> seek(int position);
|
||||||
|
|
||||||
@mustCallSuper
|
@mustCallSuper
|
||||||
Future<void> dispose() {
|
void dispose() {
|
||||||
eventController.close();
|
eventController.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +119,6 @@ abstract class JustAudioPlayer {
|
||||||
class Html5AudioPlayer extends JustAudioPlayer {
|
class Html5AudioPlayer extends JustAudioPlayer {
|
||||||
AudioElement _audioElement = AudioElement();
|
AudioElement _audioElement = AudioElement();
|
||||||
Completer<num> _durationCompleter;
|
Completer<num> _durationCompleter;
|
||||||
double _volume = 1.0;
|
|
||||||
double _startPos = 0.0;
|
double _startPos = 0.0;
|
||||||
double _start = 0.0;
|
double _start = 0.0;
|
||||||
double _end;
|
double _end;
|
||||||
|
@ -173,8 +172,7 @@ class Html5AudioPlayer extends JustAudioPlayer {
|
||||||
_audioElement.play();
|
_audioElement.play();
|
||||||
if (duration != null) {
|
if (duration != null) {
|
||||||
_playOperation = CancelableOperation.fromFuture(Future.delayed(Duration(
|
_playOperation = CancelableOperation.fromFuture(Future.delayed(Duration(
|
||||||
milliseconds:
|
milliseconds: duration * 1000 ~/ _audioElement.playbackRate)))
|
||||||
(duration * 1000 / _audioElement.playbackRate).toInt())))
|
|
||||||
.then((_) {
|
.then((_) {
|
||||||
pause();
|
pause();
|
||||||
_playOperation = null;
|
_playOperation = null;
|
||||||
|
@ -209,7 +207,6 @@ class Html5AudioPlayer extends JustAudioPlayer {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> setVolume(double volume) async {
|
Future<void> setVolume(double volume) async {
|
||||||
_volume = volume;
|
|
||||||
_audioElement.volume = volume;
|
_audioElement.volume = volume;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,7 +226,7 @@ class Html5AudioPlayer extends JustAudioPlayer {
|
||||||
double getCurrentPosition() => _audioElement.currentTime;
|
double getCurrentPosition() => _audioElement.currentTime;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> dispose() async {
|
void dispose() {
|
||||||
_interruptPlay();
|
_interruptPlay();
|
||||||
_audioElement.pause();
|
_audioElement.pause();
|
||||||
_audioElement.removeAttribute('src');
|
_audioElement.removeAttribute('src');
|
||||||
|
|
Loading…
Reference in New Issue