Commit 1641ccf2 authored by Xiaowu Zhang's avatar Xiaowu Zhang

synchronize sound/video when exit fullscreen

parent 43e728b3
...@@ -264,13 +264,14 @@ ...@@ -264,13 +264,14 @@
if (isFullScreen) { if (isFullScreen) {
cancelFullScreen(); cancelFullScreen();
g.audio.currentTime = g.video.currentTime; g.audio.currentTime = g.video.currentTime;
g.video.currentTime = g.audio.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.audio.play();
g.video.currentTime = g.audio.currentTime; g.video.currentTime = g.audio.currentTime;
} }
command_context.innerHTML = "stop"; command_context.innerHTML = "stop";
......
...@@ -358,15 +358,16 @@ ...@@ -358,15 +358,16 @@
if (isFullScreen) { if (isFullScreen) {
cancelFullScreen(); cancelFullScreen();
g.audio.currentTime = g.video.currentTime; g.audio.currentTime = g.video.currentTime;
g.video.currentTime = g.audio.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.audio.play();
g.video.currentTime = g.audio.currentTime;//consistency 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