зеркало из https://github.com/mozilla/gecko-dev.git
Bug 842782 - p2: introduce attributes for orientation lock to video element. r=jwwang,smaug
MozReview-Commit-ID: odq1y9qH1
This commit is contained in:
Родитель
d40baf7687
Коммит
bad6535260
|
@ -47,6 +47,7 @@ NS_IMPL_ELEMENT_CLONE(HTMLVideoElement)
|
|||
HTMLVideoElement::HTMLVideoElement(already_AddRefed<NodeInfo>& aNodeInfo)
|
||||
: HTMLMediaElement(aNodeInfo)
|
||||
, mUseScreenWakeLock(true)
|
||||
, mIsOrientationLocked(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "mozilla/dom/HTMLMediaElement.h"
|
||||
#include "MediaPrefs.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
@ -139,6 +140,22 @@ public:
|
|||
|
||||
already_AddRefed<VideoPlaybackQuality> GetVideoPlaybackQuality();
|
||||
|
||||
|
||||
bool MozOrientationLockEnabled() const
|
||||
{
|
||||
return MediaPrefs::VideoOrientationLockEnabled();
|
||||
}
|
||||
|
||||
bool MozIsOrientationLocked() const
|
||||
{
|
||||
return mIsOrientationLocked;
|
||||
}
|
||||
|
||||
void SetMozIsOrientationLocked(bool aLock)
|
||||
{
|
||||
mIsOrientationLocked = aLock;
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual ~HTMLVideoElement();
|
||||
|
||||
|
@ -151,6 +168,8 @@ protected:
|
|||
bool mUseScreenWakeLock;
|
||||
RefPtr<WakeLock> mScreenWakeLock;
|
||||
|
||||
bool mIsOrientationLocked;
|
||||
|
||||
private:
|
||||
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||
GenericSpecifiedValues* aGenericData);
|
||||
|
|
|
@ -49,6 +49,14 @@ partial interface HTMLVideoElement {
|
|||
// True if the video should use a screen wake lock.
|
||||
[Pref="dom.wakelock.enabled", Func="Navigator::HasWakeLockSupport"]
|
||||
attribute boolean mozUseScreenWakeLock;
|
||||
|
||||
// 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="IsChromeOrXBL"]
|
||||
readonly attribute boolean mozOrientationLockEnabled;
|
||||
// True if screen orientation is locked by video controls.
|
||||
[Pref="media.videocontrols.lock-video-orientation", Func="IsChromeOrXBL"]
|
||||
attribute boolean mozIsOrientationLocked;
|
||||
};
|
||||
|
||||
// https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#idl-def-HTMLVideoElement
|
||||
|
|
Загрузка…
Ссылка в новой задаче