Bug 1273468 - Revert video controls to use prefixed Fullscreen API again. r=dolske

MozReview-Commit-ID: IlxS0MFTxIk

--HG--
extra : source : f7f76f18484a7c53e7213d4fc654b11a93ab4dcf
This commit is contained in:
Xidorn Quan 2016-05-19 19:48:50 +10:00
Родитель 401746f8e8
Коммит d076cfb561
3 изменённых файлов: 12 добавлений и 12 удалений

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

@ -29,10 +29,10 @@ document.addEventListener("keypress", ev => {
ev.preventDefault(); ev.preventDefault();
ev.stopPropagation(); ev.stopPropagation();
if (!document.fullscreenElement) { if (!document.mozFullScreenElement) {
videoElement.requestFullscreen(); videoElement.mozRequestFullScreen();
} else { } else {
document.exitFullscreen(); document.mozCancelFullScreen();
} }
return; return;
} }

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

@ -304,7 +304,7 @@ function runTest(event) {
break; break;
case 24: case 24:
is(event.type, "fullscreenchange", "checking event type"); is(event.type, "mozfullscreenchange", "checking event type");
is(video.volume, 0.6, "Volume should still be 0.6"); is(video.volume, 0.6, "Volume should still be 0.6");
isVolumeSliderShowingCorrectVolume(video.volume); isVolumeSliderShowingCorrectVolume(video.volume);
@ -312,7 +312,7 @@ function runTest(event) {
break; break;
case 25: case 25:
is(event.type, "fullscreenchange", "checking event type"); is(event.type, "mozfullscreenchange", "checking event type");
is(video.volume, 0.6, "Volume should still be 0.6"); is(video.volume, 0.6, "Volume should still be 0.6");
isVolumeSliderShowingCorrectVolume(video.volume); isVolumeSliderShowingCorrectVolume(video.volume);
@ -336,7 +336,7 @@ function canplaythroughevent(event) {
video.addEventListener("volumechange", runTest, false); video.addEventListener("volumechange", runTest, false);
video.addEventListener("seeking", runTest, false); video.addEventListener("seeking", runTest, false);
video.addEventListener("seeked", runTest, false); video.addEventListener("seeked", runTest, false);
document.addEventListener("fullscreenchange", runTest, false); document.addEventListener("mozfullscreenchange", runTest, false);
// Begin the test. // Begin the test.
runTest(event); runTest(event);
} }

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

@ -1007,7 +1007,7 @@
} else { } else {
element.setAttribute("fadeout", true); element.setAttribute("fadeout", true);
if (element.classList.contains("controlBar") && !this.hasError() && if (element.classList.contains("controlBar") && !this.hasError() &&
document.fullscreenElement == this.video) document.mozFullScreenElement == this.video)
this.controlsSpacer.setAttribute("hideCursor", true); this.controlsSpacer.setAttribute("hideCursor", true);
} }
@ -1065,17 +1065,17 @@
}, },
isVideoInFullScreen : function () { isVideoInFullScreen : function () {
return document.fullscreenElement == this.video; return document.mozFullScreenElement == this.video;
}, },
toggleFullscreen : function () { toggleFullscreen : function () {
this.isVideoInFullScreen() ? this.isVideoInFullScreen() ?
document.exitFullscreen() : document.mozCancelFullScreen() :
this.video.requestFullscreen(); this.video.mozRequestFullScreen();
}, },
setFullscreenButtonState : function () { setFullscreenButtonState : function () {
if (this.isAudioOnly || !document.fullscreenEnabled) { if (this.isAudioOnly || !document.mozFullScreenEnabled) {
this.controlBar.setAttribute("fullscreen-unavailable", true); this.controlBar.setAttribute("fullscreen-unavailable", true);
this.adjustControlSize(); this.adjustControlSize();
return; return;
@ -1525,7 +1525,7 @@
addListener(this.videocontrols, "resizevideocontrols", this.adjustControlSize); addListener(this.videocontrols, "resizevideocontrols", this.adjustControlSize);
addListener(this.videocontrols, "transitionend", this.onTransitionEnd); addListener(this.videocontrols, "transitionend", this.onTransitionEnd);
addListener(this.video.ownerDocument, "fullscreenchange", this.onFullscreenChange); addListener(this.video.ownerDocument, "mozfullscreenchange", this.onFullscreenChange);
addListener(this.video, "keypress", this.keyHandler); addListener(this.video, "keypress", this.keyHandler);
addListener(this.videocontrols, "dragstart", function(event) { addListener(this.videocontrols, "dragstart", function(event) {