mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1858977 - Remove dead code to lock orientation on video controls. r=smaug,webidl,reusable-components-reviewers,mconley,hjones
mozLockOrientation etc haven't done anything for a while. Depends on D193212 Differential Revision: https://phabricator.services.mozilla.com/D193213
This commit is contained in:
parent
44ec0247df
commit
d7b9e936c7
@ -93,7 +93,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
HTMLVideoElement::HTMLVideoElement(already_AddRefed<NodeInfo>&& aNodeInfo)
|
||||
: HTMLMediaElement(std::move(aNodeInfo)),
|
||||
mIsOrientationLocked(false),
|
||||
mVideoWatchManager(this, AbstractThread::MainThread()) {
|
||||
DecoderDoctorLogger::LogConstruction(this);
|
||||
}
|
||||
|
@ -112,14 +112,6 @@ class HTMLVideoElement final : public HTMLMediaElement {
|
||||
|
||||
already_AddRefed<VideoPlaybackQuality> GetVideoPlaybackQuality();
|
||||
|
||||
bool MozOrientationLockEnabled() const {
|
||||
return StaticPrefs::media_videocontrols_lock_video_orientation();
|
||||
}
|
||||
|
||||
bool MozIsOrientationLocked() const { return mIsOrientationLocked; }
|
||||
|
||||
void SetMozIsOrientationLocked(bool aLock) { mIsOrientationLocked = aLock; }
|
||||
|
||||
already_AddRefed<Promise> CloneElementVisually(HTMLVideoElement& aTarget,
|
||||
ErrorResult& rv);
|
||||
|
||||
@ -157,8 +149,6 @@ class HTMLVideoElement final : public HTMLMediaElement {
|
||||
|
||||
RefPtr<WakeLock> mScreenWakeLock;
|
||||
|
||||
bool mIsOrientationLocked;
|
||||
|
||||
WatchManager<HTMLVideoElement> mVideoWatchManager;
|
||||
|
||||
private:
|
||||
|
@ -55,14 +55,6 @@ partial interface HTMLVideoElement {
|
||||
// True if the video has an audio track available.
|
||||
readonly attribute boolean mozHasAudio;
|
||||
|
||||
// Attributes for builtin video controls to lock screen orientation.
|
||||
// True if video controls should lock orientation when fullscreen.
|
||||
[Pref="media.videocontrols.lock-video-orientation", Func="IsChromeOrUAWidget"]
|
||||
readonly attribute boolean mozOrientationLockEnabled;
|
||||
// True if screen orientation is locked by video controls.
|
||||
[Pref="media.videocontrols.lock-video-orientation", Func="IsChromeOrUAWidget"]
|
||||
attribute boolean mozIsOrientationLocked;
|
||||
|
||||
// Clones the frames playing in this <video> to the target. Cloning ends
|
||||
// when either node is removed from their DOM trees. Throws if one or
|
||||
// both <video> elements are not attached to a DOM tree.
|
||||
|
@ -10505,11 +10505,6 @@
|
||||
value: true
|
||||
mirror: always
|
||||
|
||||
- name: media.videocontrols.lock-video-orientation
|
||||
type: bool
|
||||
value: false
|
||||
mirror: always
|
||||
|
||||
# Media Seamless Looping
|
||||
- name: media.seamless-looping
|
||||
type: RelaxedAtomicBool
|
||||
|
@ -90,9 +90,6 @@ skip-if = [
|
||||
"os == 'linux'", #Bug 1366957
|
||||
]
|
||||
|
||||
["test_videocontrols_orientation.html"]
|
||||
skip-if = ["true"] # Bug 1483656
|
||||
|
||||
["test_videocontrols_scrubber_position.html"]
|
||||
|
||||
["test_videocontrols_scrubber_position_nopreload.html"]
|
||||
|
@ -1,63 +0,0 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<title>Video controls test</title>
|
||||
<script src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script src="/tests/SimpleTest/EventUtils.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
|
||||
</head>
|
||||
<body>
|
||||
<p id="display"></p>
|
||||
|
||||
<div id="content">
|
||||
<video id="video" controls mozNoDynamicControls preload="metadata"></video>
|
||||
</div>
|
||||
|
||||
<pre id="test">
|
||||
<script class="testbody" type="text/javascript">
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
var video = document.getElementById("video");
|
||||
|
||||
let onLoaded = event => {
|
||||
SpecialPowers.pushPrefEnv(
|
||||
{"set": [["full-screen-api.allow-trusted-requests-only", false],
|
||||
["media.videocontrols.lock-video-orientation", true]]},
|
||||
startMediaLoad);
|
||||
};
|
||||
window.addEventListener("load", onLoaded);
|
||||
|
||||
let startMediaLoad = () => {
|
||||
// Kick off test once video has loaded, in its canplaythrough event handler.
|
||||
video.src = "video.ogg";
|
||||
video.addEventListener("canplaythrough", runTest);
|
||||
};
|
||||
|
||||
function runTest() {
|
||||
is(document.mozFullScreenElement, null, "should not be in fullscreen initially");
|
||||
isnot(window.screen.orientation.type, "landscape-primary", "should not be in landscape");
|
||||
isnot(window.screen.orientation.type, "landscape-secondary", "should not be in landscape");
|
||||
|
||||
let originalOnChange = window.screen.orientation.onchange;
|
||||
|
||||
window.screen.orientation.onchange = () => {
|
||||
is(document.mozFullScreenElement, video, "should be in fullscreen");
|
||||
ok(window.screen.orientation.type === "landscape-primary" ||
|
||||
window.screen.orientation.type === "landscape-secondary", "should be in landscape");
|
||||
|
||||
window.screen.orientation.onchange = () => {
|
||||
window.screen.orientation.onchange = originalOnChange;
|
||||
isnot(window.screen.orientation.type, "landscape-primary", "should not be in landscape");
|
||||
isnot(window.screen.orientation.type, "landscape-secondary", "should not be in landscape");
|
||||
SimpleTest.finish();
|
||||
};
|
||||
document.mozCancelFullScreen();
|
||||
};
|
||||
|
||||
video.mozRequestFullScreen();
|
||||
}
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -426,10 +426,6 @@ this.VideoControlsImplWidget = class {
|
||||
}
|
||||
}
|
||||
|
||||
// We should lock the orientation if we are already in
|
||||
// fullscreen.
|
||||
this.updateOrientationState(this.isVideoInFullScreen);
|
||||
|
||||
// The video itself might not be fullscreen, but part of the
|
||||
// document might be, in which case we set this attribute to
|
||||
// apply any styles for the DOM fullscreen case.
|
||||
@ -1754,8 +1750,6 @@ this.VideoControlsImplWidget = class {
|
||||
this.videocontrols.removeAttribute("inDOMFullscreen");
|
||||
}
|
||||
|
||||
this.updateOrientationState(this.isVideoInFullScreen);
|
||||
|
||||
if (this.isVideoInFullScreen) {
|
||||
this.startFadeOut(this.controlBar, true);
|
||||
}
|
||||
@ -1763,36 +1757,6 @@ this.VideoControlsImplWidget = class {
|
||||
this.setFullscreenButtonState();
|
||||
},
|
||||
|
||||
updateOrientationState(lock) {
|
||||
if (!this.video.mozOrientationLockEnabled) {
|
||||
return;
|
||||
}
|
||||
if (lock) {
|
||||
if (this.video.mozIsOrientationLocked) {
|
||||
return;
|
||||
}
|
||||
let dimenDiff = this.video.videoWidth - this.video.videoHeight;
|
||||
if (dimenDiff > 0) {
|
||||
this.video.mozIsOrientationLocked =
|
||||
this.window.screen.mozLockOrientation("landscape");
|
||||
} else if (dimenDiff < 0) {
|
||||
this.video.mozIsOrientationLocked =
|
||||
this.window.screen.mozLockOrientation("portrait");
|
||||
} else {
|
||||
this.video.mozIsOrientationLocked =
|
||||
this.window.screen.mozLockOrientation(
|
||||
this.window.screen.orientation
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (!this.video.mozIsOrientationLocked) {
|
||||
return;
|
||||
}
|
||||
this.window.screen.mozUnlockOrientation();
|
||||
this.video.mozIsOrientationLocked = false;
|
||||
}
|
||||
},
|
||||
|
||||
clickToPlayClickHandler(e) {
|
||||
if (e.button != 0) {
|
||||
return;
|
||||
@ -2964,7 +2928,6 @@ this.VideoControlsImplWidget = class {
|
||||
teardown() {
|
||||
this.Utils.terminate();
|
||||
this.TouchUtils.terminate();
|
||||
this.Utils.updateOrientationState(false);
|
||||
this.l10n.disconnectRoot(this.shadowRoot);
|
||||
this.l10n = null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user