mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 18:57:25 +01:00
player: Add stop method.
This commit is contained in:
parent
92828849f9
commit
be1a41a90e
2 changed files with 10 additions and 0 deletions
|
|
@ -47,6 +47,11 @@ public class MusicusPlayerPlugin: FlutterPlugin, MethodCallHandler {
|
||||||
} else if (call.method == "pause") {
|
} else if (call.method == "pause") {
|
||||||
mediaPlayer?.pause()
|
mediaPlayer?.pause()
|
||||||
result.success(null)
|
result.success(null)
|
||||||
|
} else if (call.method == "stop") {
|
||||||
|
uri = null
|
||||||
|
mediaPlayer?.release()
|
||||||
|
mediaPlayer = null
|
||||||
|
result.success(null)
|
||||||
} else {
|
} else {
|
||||||
result.notImplemented()
|
result.notImplemented()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,4 +40,9 @@ class MusicusPlayer {
|
||||||
Future<void> pause() async {
|
Future<void> pause() async {
|
||||||
await _channel.invokeMethod('pause');
|
await _channel.invokeMethod('pause');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Stop the player.
|
||||||
|
Future<void> stop() async {
|
||||||
|
await _channel.invokeMethod('stop');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue