mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 618124 - Don't use the play event to start fullscreen video [r=mfinkle]
This commit is contained in:
parent
cfc98c9439
commit
37e8079116
@ -39,12 +39,20 @@ function closeFullScreen() {
|
||||
sendAsyncMessage("Browser:FullScreenVideo:Close");
|
||||
}
|
||||
|
||||
function startPlayback(aEvent) {
|
||||
let target = aEvent.originalTarget;
|
||||
contentObject._sendMouseEvent("mousedown", target, 0, 0);
|
||||
contentObject._sendMouseEvent("mousemove", target, 0, 0);
|
||||
contentObject._sendMouseEvent("mouseup", target, 0, 0);
|
||||
}
|
||||
|
||||
addEventListener("click", function(aEvent) {
|
||||
if (aEvent.target.id == "close")
|
||||
closeFullScreen();
|
||||
}, false);
|
||||
|
||||
addEventListener("CloseVideo", closeFullScreen, false);
|
||||
addEventListener("StartVideo", startPlayback, false);
|
||||
|
||||
addEventListener("PlayVideo", function() {
|
||||
sendAsyncMessage("Browser:FullScreenVideo:Play");
|
||||
|
@ -104,8 +104,7 @@ function init() {
|
||||
showUI();
|
||||
resetIdleTimer();
|
||||
|
||||
video.controls = true;
|
||||
video.play();
|
||||
sendStartEvent(video);
|
||||
}, false);
|
||||
|
||||
// Automatically close this window when the playback ended, unless the user
|
||||
@ -128,6 +127,12 @@ function init() {
|
||||
video.mozLoadFrom(contentVideo);
|
||||
}
|
||||
|
||||
function sendStartEvent(aElt) {
|
||||
let event = document.createEvent("Event");
|
||||
event.initEvent("StartVideo", true, true);
|
||||
aElt.dispatchEvent(event);
|
||||
}
|
||||
|
||||
window.addEventListener("unload", function () {
|
||||
if (video.currentSrc) {
|
||||
contentVideo.currentTime = video.currentTime;
|
||||
@ -221,6 +226,6 @@ function hideUI() {
|
||||
</head>
|
||||
<body class="loadingdata" onload="init();">
|
||||
<span id="close"/>
|
||||
<video/>
|
||||
<video controls="true"/>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user