0 purchases
system media controller
System Media Controller plugin #
System Media Control package is a Flutter package that allows you to control the media on the system.
currently available for Android only
Usage #
To use this plugin, add system_media_controller as a dependency in your pubspec.yaml file.
Examples:
you can control current system media.
final _systemMediaController = SystemMediaController();
_systemMediaController.play();
_systemMediaController.pause();
_systemMediaController.skipNext();
_systemMediaController.skipPrevious();
_systemMediaController.fastForward();
_systemMediaController.rewind();
copied to clipboard
With FCM #
If you use FCM(silent notification) with another Platforms(like Flutter Web), you can control the media being played on mobile from the another platforms.
// example fcm
Map silentNotification = {
'message': {
'data': {
'action': 'play'
}
}
}
FirebaseMessaging.onBackgroundMessage((message){
/// ...another code
final String? action = message.data['action'];
if(action == 'play'){
_systemMediaController.play();
}
});
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.