Closed Bug 1634190 Opened 4 years ago Closed 4 years ago

[MediaControl-Linux] Only enable `GoNext` or `GoPrevious` when their action handlers exist

Categories

(Core :: Audio/Video: Playback, enhancement, P3)

Desktop
Linux
enhancement

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox81 --- fixed

People

(Reporter: chunmin, Assigned: chunmin)

References

Details

Attachments

(7 files)

CanGoNext or CanGoPrevious should be set on demand:

  • CanGoNext should only be true when media session has an action handler for nexttrack
  • CanGoPrevious should only be true when media session has an action handler for previoustrack

This is what Chromium does.

See Also: → 1635209
  • Remove the dead code which is never executed
  • Return error instead of a fake value from unsupported functions
  • Remove trivial functions that only return a bool value

Depends on D85943

Leave only supported methods and properties in class Method and class Property respectively. As a result, if the query method or property
cannot be mapped to an item in Method or Property, then that query
is not supported. In that case, a G_DBUS_ERROR_NOT_SUPPORTED would be
returned, instead of G_IO_ERROR_FAILED.

Depends on D85944

We only implement MPRIS methods paired with MediaControlKey, so those
methods can be merged into one function with a MediaControlKey
parameter.

Depends on D85945

The supported-media-keys info needs to be passed to the
media-control-key-source. Otherwise the key-source has no idea what keys
are currently supported.

Depends on D85946

Implement the SetSupportedMediaKeys in MPRISServiceHandler.

Depends on D85947

Attachment #9168034 - Attachment description: Bug 1634190 - P5: Update supported media keys upon keys is being monitored → Bug 1634190 - P5: Update supported media keys once keys is being monitored

The g_dbus_connection_emit_signal is called several times at different
places. It's better to do that in one place to lower the maintaining
effort.

Depends on D85948

Pushed by cchang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8291a1d8fcd9
P1: Delete ghost functions r=alwu
https://hg.mozilla.org/integration/autoland/rev/0119f0c8bc51
P2: Prune code paths to improve the readability r=alwu
https://hg.mozilla.org/integration/autoland/rev/143dc81dd17b
P3: Simplify HandleMethodCall and HandleGetProperty r=alwu
https://hg.mozilla.org/integration/autoland/rev/b2190f037d78
P4: Merge different MPRIS methods to one function r=alwu
https://hg.mozilla.org/integration/autoland/rev/3d6075e9f0f9
P5: Update supported media keys once keys is being monitored r=alwu
https://hg.mozilla.org/integration/autoland/rev/85f9d8d484c7
P6: Implement SetSupportedMediaKeys on MPRIS backend r=alwu
https://hg.mozilla.org/integration/autoland/rev/e87dffaba2dd
P7: Add a function to emit properties changed signal r=alwu
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: