Commit 43e728b3 authored by Xiaowu Zhang's avatar Xiaowu Zhang

take video's currentTime when exit fullscreen

parent 4d7df94c
...@@ -263,16 +263,16 @@ ...@@ -263,16 +263,16 @@
var isFullScreen = document.mozFullScreen || document.webkitIsFullScreen, cancelFullScreen = document.webkitCancelFullScreen.bind(document) || document.mozCancelFullScreen.bind(document), requestFullScreen = video.webkitRequestFullScreen.bind(video) || video.mozRequestFullScreen.bind(video); var isFullScreen = document.mozFullScreen || document.webkitIsFullScreen, cancelFullScreen = document.webkitCancelFullScreen.bind(document) || document.mozCancelFullScreen.bind(document), requestFullScreen = video.webkitRequestFullScreen.bind(video) || video.mozRequestFullScreen.bind(video);
if (isFullScreen) { if (isFullScreen) {
cancelFullScreen(); cancelFullScreen();
g.audio.currentTime = g.video.currentTime;
} else { } else {
requestFullScreen(); requestFullScreen();
} }
}), loopEventListener(video, "play", false, function(event) { }), loopEventListener(video, "play", false, function(event) {
g.audio.play();
if (g.video.currentTime) { if (g.video.currentTime) {
g.audio.currentTime = g.video.currentTime; g.audio.currentTime = g.video.currentTime;
g.video.currentTime = g.audio.currentTime;
} }
g.audio.play();
g.video.currentTime = g.audio.currentTime;
//consistency
command_context.innerHTML = "stop"; command_context.innerHTML = "stop";
}), loopEventListener(video, "pause", false, function(event) { }), loopEventListener(video, "pause", false, function(event) {
g.audio.pause(); g.audio.pause();
......
...@@ -357,17 +357,18 @@ ...@@ -357,17 +357,18 @@
video.mozRequestFullScreen.bind(video); video.mozRequestFullScreen.bind(video);
if (isFullScreen) { if (isFullScreen) {
cancelFullScreen(); cancelFullScreen();
g.audio.currentTime = g.video.currentTime;
} else { } else {
requestFullScreen(); requestFullScreen();
} }
}), }),
loopEventListener(video, "play", false, function (event) { loopEventListener(video, "play", false, function (event) {
g.audio.play();
if (g.video.currentTime) { if (g.video.currentTime) {
g.audio.currentTime = g.video.currentTime; g.audio.currentTime = g.video.currentTime;
g.video.currentTime = g.audio.currentTime;//consistency
} }
g.audio.play();
g.video.currentTime = g.audio.currentTime;//consistency
command_context.innerHTML = "stop"; command_context.innerHTML = "stop";
}), }),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment