зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 3 changesets (bug 1620077, bug 1580623) for causing mochitest failures CLOSED TREE
Backed out changeset 981e37f4d18d (bug 1620077) Backed out changeset 0333485a02ed (bug 1580623) Backed out changeset d729f6a0050b (bug 1580623)
This commit is contained in:
Родитель
3342f3308e
Коммит
35bf0da2a1
|
@ -66,19 +66,15 @@ void PlaybackController::Pause() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlaybackController::SeekBackward() {
|
void PlaybackController::SeekBackward() {
|
||||||
const MediaSessionAction action = MediaSessionAction::Seekbackward;
|
// TODO : use media session's action handler if it exists. MediaSessionAction
|
||||||
if (RefPtr<MediaSession> session = GetMediaSession();
|
// doesn't support `seekbackward` yet.
|
||||||
session && session->IsSupportedAction(action)) {
|
return;
|
||||||
session->NotifyHandler(action);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlaybackController::SeekForward() {
|
void PlaybackController::SeekForward() {
|
||||||
const MediaSessionAction action = MediaSessionAction::Seekforward;
|
// TODO : use media session's action handler if it exists. MediaSessionAction
|
||||||
if (RefPtr<MediaSession> session = GetMediaSession();
|
// doesn't support `seekforward` yet.
|
||||||
session && session->IsSupportedAction(action)) {
|
return;
|
||||||
session->NotifyHandler(action);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PlaybackController::PreviousTrack() {
|
void PlaybackController::PreviousTrack() {
|
||||||
|
|
|
@ -96,19 +96,21 @@ void MediaSession::DispatchNotifyHandler(
|
||||||
const MediaSessionActionDetails& aDetails)
|
const MediaSessionActionDetails& aDetails)
|
||||||
: mozilla::Runnable("MediaSession::DispatchNotifyHandler"),
|
: mozilla::Runnable("MediaSession::DispatchNotifyHandler"),
|
||||||
mSession(aSession),
|
mSession(aSession),
|
||||||
mDetails(aDetails) {}
|
mAction(aDetails.mAction) {}
|
||||||
|
|
||||||
MOZ_CAN_RUN_SCRIPT_BOUNDARY NS_IMETHOD Run() override {
|
MOZ_CAN_RUN_SCRIPT_BOUNDARY NS_IMETHOD Run() override {
|
||||||
if (RefPtr<MediaSessionActionHandler> handler =
|
if (RefPtr<MediaSessionActionHandler> handler =
|
||||||
mSession->GetActionHandler(mDetails.mAction)) {
|
mSession->GetActionHandler(mAction)) {
|
||||||
handler->Call(mDetails);
|
MediaSessionActionDetails details;
|
||||||
|
details.mAction = mAction;
|
||||||
|
handler->Call(details);
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RefPtr<const MediaSession> mSession;
|
RefPtr<const MediaSession> mSession;
|
||||||
MediaSessionActionDetails mDetails;
|
MediaSessionAction mAction;
|
||||||
};
|
};
|
||||||
|
|
||||||
RefPtr<nsIRunnable> runnable = new Runnable(this, aDetails);
|
RefPtr<nsIRunnable> runnable = new Runnable(this, aDetails);
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
const gMediaSessionActions = [
|
const gMediaSessionActions = [
|
||||||
"play",
|
"play",
|
||||||
"pause",
|
"pause",
|
||||||
"seekbackward",
|
|
||||||
"seekforward",
|
|
||||||
"previoustrack",
|
"previoustrack",
|
||||||
"nexttrack",
|
"nexttrack",
|
||||||
"stop",
|
"stop",
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
const MediaSessionActions = [
|
const MediaSessionActions = [
|
||||||
"play",
|
"play",
|
||||||
"pause",
|
"pause",
|
||||||
"seekbackward",
|
|
||||||
"seekforward",
|
|
||||||
"previoustrack",
|
"previoustrack",
|
||||||
"nexttrack",
|
"nexttrack",
|
||||||
"stop",
|
"stop",
|
||||||
|
|
|
@ -13,8 +13,6 @@ SimpleTest.waitForExplicitFinish();
|
||||||
const ACTIONS = [
|
const ACTIONS = [
|
||||||
"play",
|
"play",
|
||||||
"pause",
|
"pause",
|
||||||
"seekbackward",
|
|
||||||
"seekforward",
|
|
||||||
"previoustrack",
|
"previoustrack",
|
||||||
"nexttrack",
|
"nexttrack",
|
||||||
"stop",
|
"stop",
|
||||||
|
@ -57,9 +55,6 @@ function generateAction(action) {
|
||||||
|
|
||||||
function generateActionDetails(action) {
|
function generateActionDetails(action) {
|
||||||
let details = { action };
|
let details = { action };
|
||||||
if (action == "seekbackward" || action == "seekforward") {
|
|
||||||
details.seekOffset = 3.14159;
|
|
||||||
}
|
|
||||||
return details;
|
return details;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,12 +13,10 @@ enum MediaSessionPlaybackState {
|
||||||
"playing"
|
"playing"
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: Implement the missing seekto (bug 1621403) and skipad (bug 1582569) actions
|
// TODO: Implement the missing seek* (bug 1580623) and skipad (bug 1582569) actions
|
||||||
enum MediaSessionAction {
|
enum MediaSessionAction {
|
||||||
"play",
|
"play",
|
||||||
"pause",
|
"pause",
|
||||||
"seekbackward",
|
|
||||||
"seekforward",
|
|
||||||
"previoustrack",
|
"previoustrack",
|
||||||
"nexttrack",
|
"nexttrack",
|
||||||
"stop",
|
"stop",
|
||||||
|
@ -70,9 +68,6 @@ dictionary MediaImage {
|
||||||
|
|
||||||
dictionary MediaSessionActionDetails {
|
dictionary MediaSessionActionDetails {
|
||||||
required MediaSessionAction action;
|
required MediaSessionAction action;
|
||||||
// Merge MediaSessionSeekActionDetails here:
|
|
||||||
// https://github.com/w3c/mediasession/issues/234
|
|
||||||
double seekOffset;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: Implement MediaPositionState (bug 1582509)
|
// TODO: Implement MediaPositionState (bug 1582509)
|
||||||
|
|
|
@ -1992,7 +1992,7 @@
|
||||||
# Media Session API
|
# Media Session API
|
||||||
- name: dom.media.mediasession.enabled
|
- name: dom.media.mediasession.enabled
|
||||||
type: bool
|
type: bool
|
||||||
value: @IS_NIGHTLY_BUILD@
|
value: false
|
||||||
mirror: always
|
mirror: always
|
||||||
|
|
||||||
# Enable meta-viewport support in remote APZ-enabled frames.
|
# Enable meta-viewport support in remote APZ-enabled frames.
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
prefs: [dom.media.mediasession.enabled:true]
|
prefs: [dom.media.mediasession.enabled:true]
|
||||||
[setactionhandler.html] # Bug 1621403
|
[setactionhandler.html] # Bug 1580623
|
||||||
[Test that setActionHandler() can be executed for supported actions]
|
[Test that setActionHandler() can be executed for supported actions]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче