system_media_controller 0.0.2 copy "system_media_controller: ^0.0.2" to clipboard
system_media_controller: ^0.0.2 copied to clipboard

PlatformAndroid

System Media Control package is a Flutter package that allows you to control the media on the system.(only android)

System Media Controller plugin #

pub package

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();

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();
    }
});
4
likes
150
points
37
downloads

Publisher

unverified uploader

Weekly Downloads

System Media Control package is a Flutter package that allows you to control the media on the system.(only android)

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on system_media_controller