-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(capabilities): Revamp Capabilities #2076
Conversation
90bea1a
to
59a8b35
Compare
I really like the direction this is headed! On the typescript side of things, I was wondering what you think of a format like: await TrackPlayer.updateOptions({
capabilities: {
play: true,
pause: true,
skipToNext: true,
skipToPrevious: {
// optional: enabled: true,
compact: false,
icon: require('./previous.png')
},
seekTo: true
}
})
|
I like the typeability aspect but it's also very rigid - we're setting a contract for the keys and fields in there, which is ok I guess in an API but I think it limits us a bit. Changing these will more easily result in being a breaking change. For example: renaming or adding additional fields will change the typing. Any new keys introduced to objects will have to be ones that are initial set to It also makes the structure a bit complicated - for some capabilities that don't support notification at all we might have something like:
Keep in mind that on Android there are three distinctions. Just because we have a capability for the media it does not mean it has to be in the notification, nor in the compact one -- so those are three cases we have to enable enabling/disabling. In the current proposed solution whether a capability is present or not denotes the capability - and then we have the actual object which dictates if it also appears in the notification/compact. |
This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This PR was closed because it has been stalled for 7 days with no activity. |
This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This PR was closed because it has been stalled for 7 days with no activity. |
This PR revamps the system of capabilities and the
updateOptions
parameters. It associates all related objects together to simplify and give finer control over options.Capabilities now differentiate (particularly on Android) between items that:
The Android side requires to be used in conjunction with: doublesymmetry/KotlinAudio#86