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,
Uint8Array, Audio, loopEventListener, jQuery, promiseEventListener*/
/*jslint nomen: true*/
/*jslint nomen: true, maxlen:180 */
(function(window, rJS, RSVP, loopEventListener, $, promiseEventListener) {
"use strict";
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 @@
}
command_context.innerHTML = "stop";
}), loopEventListener(video, "dblclick", false, function(event) {
if (document.webkitIsFullScreen) {
document.webkitCancelFullScreen();
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) {
cancelFullScreen();
} else {
video.webkitRequestFullScreen();
requestFullScreen();
}
}), loopEventListener(bar_context, "mousemove", false, function(event) {
var time = getTime(bar_context, event.clientX);
......
/*global window, rJS, RSVP, console, URL, Math, parseInt, document, jIO,
Uint8Array, Audio, loopEventListener, jQuery, promiseEventListener*/
/*jslint nomen: true*/
/*jslint nomen: true, maxlen:180 */
(function (window, rJS, RSVP, loopEventListener, $, promiseEventListener) {
"use strict";
......@@ -334,10 +334,16 @@
command_context.innerHTML = "stop";
}),
loopEventListener(video, "dblclick", false, function (event) {
if (document.webkitIsFullScreen) {
document.webkitCancelFullScreen();
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) {
cancelFullScreen();
} else {
video.webkitRequestFullScreen();
requestFullScreen();
}
}),
......
......@@ -17,8 +17,9 @@ canvas#can{
height: 20%;
}
video::-webkit-media-controls-enclosure {
display: none !important;
video::-webkit-media-controls-enclosure {
display: none !important;
}
progress.bar {
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