зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1543122 - Add a privileged UAWidget-accessible WebIDL API for triggering Picture-in-Picture. r=jya,Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D26777 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
ab8986d79a
Коммит
b5797d9c16
|
@ -548,5 +548,15 @@ void HTMLVideoElement::EndCloningVisually() {
|
|||
}
|
||||
}
|
||||
|
||||
void HTMLVideoElement::TogglePictureInPicture(ErrorResult& error) {
|
||||
// The MozTogglePictureInPicture event is listen for via the
|
||||
// PictureInPictureChild actor, which is responsible for opening the new
|
||||
// window and starting the visual clone.
|
||||
nsresult rv = DispatchEvent(NS_LITERAL_STRING("MozTogglePictureInPicture"));
|
||||
if (NS_FAILED(rv)) {
|
||||
error.Throw(rv);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -145,6 +145,8 @@ class HTMLVideoElement final : public HTMLMediaElement {
|
|||
|
||||
bool IsCloningElementVisually() const { return !!mVisualCloneTarget; }
|
||||
|
||||
void TogglePictureInPicture(ErrorResult& rv);
|
||||
|
||||
protected:
|
||||
virtual ~HTMLVideoElement();
|
||||
|
||||
|
|
|
@ -69,6 +69,12 @@ partial interface HTMLVideoElement {
|
|||
// <video> element (see cloneElementVisually).
|
||||
[Func="IsChromeOrXBLOrUAWidget"]
|
||||
readonly attribute boolean isCloningElementVisually;
|
||||
|
||||
// Fires the privileged MozTogglePictureInPicture event to enter
|
||||
// Picture-in-Picture. Call this when triggering Picture-in-Picture
|
||||
// from the video controls UAWidget.
|
||||
[Throws, Func="IsChromeOrXBLOrUAWidget"]
|
||||
void togglePictureInPicture();
|
||||
};
|
||||
|
||||
// https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#idl-def-HTMLVideoElement
|
||||
|
|
Загрузка…
Ссылка в новой задаче