Bug 1580623 - P2: Fire seek{for,back}ward action handler if it's set r=alwu

Depends on D45459

Differential Revision: https://phabricator.services.mozilla.com/D66619

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Chun-Min Chang 2020-03-17 23:39:10 +00:00
Родитель ce354ff512
Коммит acef9be28a
3 изменённых файлов: 14 добавлений и 6 удалений

Просмотреть файл

@ -66,15 +66,19 @@ void PlaybackController::Pause() {
}
void PlaybackController::SeekBackward() {
// TODO : use media session's action handler if it exists. MediaSessionAction
// doesn't support `seekbackward` yet.
return;
const MediaSessionAction action = MediaSessionAction::Seekbackward;
if (RefPtr<MediaSession> session = GetMediaSession();
session && session->IsSupportedAction(action)) {
session->NotifyHandler(action);
}
}
void PlaybackController::SeekForward() {
// TODO : use media session's action handler if it exists. MediaSessionAction
// doesn't support `seekforward` yet.
return;
const MediaSessionAction action = MediaSessionAction::Seekforward;
if (RefPtr<MediaSession> session = GetMediaSession();
session && session->IsSupportedAction(action)) {
session->NotifyHandler(action);
}
}
void PlaybackController::PreviousTrack() {

Просмотреть файл

@ -1,6 +1,8 @@
const gMediaSessionActions = [
"play",
"pause",
"seekbackward",
"seekforward",
"previoustrack",
"nexttrack",
"stop",

Просмотреть файл

@ -11,6 +11,8 @@
const MediaSessionActions = [
"play",
"pause",
"seekbackward",
"seekforward",
"previoustrack",
"nexttrack",
"stop",