Bug 1886057 - Replace ToMediaControlKeyStr by GetEnumString r=media-playback-reviewers,padenot

The `ToMediaControlKeyStr` can be replaced by `GetEnumString` since
`GetEnumString` is able to access the enum mapping strings of the
`MediaControlKey` generated by the dom binding in
`EnumStrings<MediaControlKey>::Values`

Differential Revision: https://phabricator.services.mozilla.com/D205006
This commit is contained in:
Chun-Min Chang
2024-03-21 18:19:12 +00:00
parent ca215f1ff9
commit 363a0d7e2b
7 changed files with 11 additions and 41 deletions

View File

@@ -454,7 +454,7 @@ class HTMLMediaElement::MediaControlKeyListener final
void HandleMediaKey(MediaControlKey aKey) override {
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(IsStarted());
MEDIACONTROL_LOG("HandleEvent '%s'", ToMediaControlKeyStr(aKey));
MEDIACONTROL_LOG("HandleEvent '%s'", GetEnumString(aKey).get());
if (aKey == MediaControlKey::Play) {
Owner()->Play();
} else if (aKey == MediaControlKey::Pause) {