Commit 8ee6a35a authored by Xiaowu Zhang's avatar Xiaowu Zhang

add firefox fullscreen compatibility

parent ca69a15c
/*global window, rJS, RSVP, console, URL, Math, parseInt, document, jIO, /*global window, rJS, RSVP, console, URL, Math, parseInt, document, jIO,
Uint8Array, Audio, loopEventListener, jQuery, promiseEventListener*/ Uint8Array, Audio, loopEventListener, jQuery, promiseEventListener*/
/*jslint nomen: true*/ /*jslint nomen: true, maxlen:180 */
(function(window, rJS, RSVP, loopEventListener, $, promiseEventListener) { (function(window, rJS, RSVP, loopEventListener, $, promiseEventListener) {
"use strict"; "use strict";
var gk = rJS(window), AudioContext = window.AudioContext || window.webkitAudioContext || window.mozAudiocontext || window.msAudioContext, audioCtx = new AudioContext(), myLoopEventListener = function(target, type, callback, allowDefault) { var gk = rJS(window), AudioContext = window.AudioContext || window.webkitAudioContext || window.mozAudiocontext || window.msAudioContext, audioCtx = new AudioContext(), myLoopEventListener = function(target, type, callback, allowDefault) {
...@@ -247,10 +247,11 @@ ...@@ -247,10 +247,11 @@
} }
command_context.innerHTML = "stop"; command_context.innerHTML = "stop";
}), loopEventListener(video, "dblclick", false, function(event) { }), loopEventListener(video, "dblclick", false, function(event) {
if (document.webkitIsFullScreen) { var isFullScreen = document.mozFullScreen || document.webkitIsFullScreen, cancelFullScreen = document.webkitCancelFullScreen.bind(document) || document.mozCancelFullScreen.bind(document), requestFullScreen = video.webkitRequestFullScreen.bind(video) || video.mozRequestFullScreen.bind(video);
document.webkitCancelFullScreen(); if (isFullScreen) {
cancelFullScreen();
} else { } else {
video.webkitRequestFullScreen(); requestFullScreen();
} }
}), loopEventListener(bar_context, "mousemove", false, function(event) { }), loopEventListener(bar_context, "mousemove", false, function(event) {
var time = getTime(bar_context, event.clientX); var time = getTime(bar_context, event.clientX);
......
/*global window, rJS, RSVP, console, URL, Math, parseInt, document, jIO, /*global window, rJS, RSVP, console, URL, Math, parseInt, document, jIO,
Uint8Array, Audio, loopEventListener, jQuery, promiseEventListener*/ Uint8Array, Audio, loopEventListener, jQuery, promiseEventListener*/
/*jslint nomen: true*/ /*jslint nomen: true, maxlen:180 */
(function (window, rJS, RSVP, loopEventListener, $, promiseEventListener) { (function (window, rJS, RSVP, loopEventListener, $, promiseEventListener) {
"use strict"; "use strict";
...@@ -334,10 +334,16 @@ ...@@ -334,10 +334,16 @@
command_context.innerHTML = "stop"; command_context.innerHTML = "stop";
}), }),
loopEventListener(video, "dblclick", false, function (event) { loopEventListener(video, "dblclick", false, function (event) {
if (document.webkitIsFullScreen) { var isFullScreen = document.mozFullScreen ||
document.webkitCancelFullScreen(); document.webkitIsFullScreen,
cancelFullScreen = document.webkitCancelFullScreen.bind(document) ||
document.mozCancelFullScreen.bind(document),
requestFullScreen = video.webkitRequestFullScreen.bind(video) ||
video.mozRequestFullScreen.bind(video);
if (isFullScreen) {
cancelFullScreen();
} else { } else {
video.webkitRequestFullScreen(); requestFullScreen();
} }
}), }),
......
...@@ -17,8 +17,9 @@ canvas#can{ ...@@ -17,8 +17,9 @@ canvas#can{
height: 20%; height: 20%;
} }
video::-webkit-media-controls-enclosure {
display: none !important; video::-webkit-media-controls-enclosure {
display: none !important;
} }
progress.bar { progress.bar {
position: inherit; position: inherit;
......
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