1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
This commit is contained in:
Luke Pulverenti 2014-03-18 23:24:55 -04:00
commit 233e30e233
6 changed files with 102 additions and 115 deletions

View file

@ -1015,7 +1015,7 @@
}
if (stream.Width || stream.Height) {
attributes.push('<span class="mediaInfoAttribute">' + stream.Width + 'x' + stream.Height + '</span>');
attributes.push('<span class="mediaInfoAttribute" id="mediaWidthHeight" data-width="' + stream.Width + '" data-height="' + stream.Height + '">' + stream.Width + 'x' + stream.Height + '</span>');
}
if (stream.AspectRatio && stream.Codec != "mjpeg") {

View file

@ -18,8 +18,8 @@
var timeout;
var video;
var culturesPromise;
var idleState = true;
var fullscreenExited = false;
var idleState = true;
self.initVideoPlayer = function () {
video = playVideo(item, startPosition, user);
@ -50,6 +50,8 @@
var nowPlayingBar = $("#nowPlayingBar", mediaPlayer);
footer.css("top", null);
mediaElement.html(""); // remove play/pause
mediaPlayer.hide().append(nowPlayingBar); // put elements back where they belong
@ -61,6 +63,11 @@
footer.hide();
}
$("html").css("cursor", "default");
$(".ui-loader").hide();
};
self.exitFullScreen = function() {
@ -146,9 +153,13 @@
$(document).on('webkitfullscreenchange mozfullscreenchange fullscreenchange', function () {
var nowPlayingBar = $('#nowPlayingBar');
$('.itemVideo').off('mousemove keydown scroll', idleHandler);
if (self.isFullScreen()) {
enterFullScreen();
idleState = true;
$('.itemVideo').on('mousemove keydown scroll', idleHandler).trigger('mousemove');
} else {
nowPlayingBar.removeClass("highPosition");
exitFullScreenToWindow();
@ -205,8 +216,36 @@
hideFlyout($('#qualityFlyout'));
});
$("#footer").on("mousemove", "#videoPlayer.fullscreenVideo #itemVideo", function () {
idleHandler(this);
});
});
function idleHandler() {
var video = $(".itemVideo");
var nowPlayingBar = $("#nowPlayingBar");
if (timeout) {
window.clearTimeout(timeout);
}
if (idleState == true) {
video.removeClass("cursor-inactive").addClass("cursor-active");
nowPlayingBar.removeClass("inactive").addClass("active");
}
idleState = false;
timeout = window.setTimeout(function () {
idleState = true;
video.removeClass("cursor-active").addClass("cursor-inactive");
nowPlayingBar.removeClass("active").addClass("inactive");
}, 4000);
}
function requestFullScreen(element) {
// Supports most browsers and their versions.
var requestMethod = element.requestFullScreen || element.webkitRequestFullScreen || element.mozRequestFullScreen || element.msRequestFullScreen;
@ -234,10 +273,9 @@
$("#videoBackdrop", footer).show();
footer.css("height", "0");
footer.css("top", "101%");
var videoPlayer = $("#videoPlayer", footer)
//.hide()
.append(nowPlayingBar);
// Stop playback on browser back button nav
@ -289,10 +327,6 @@
$("html").css("cursor", "default");
//videoPlayer.fadeIn();
checkAspectRatio();
});
$(".mediaFlyoutContainer").on("click", "a", function (e) {
@ -335,21 +369,6 @@
fullscreenExited = false;
};
function checkAspectRatio() {
// Resize player window if 4:3 aspect ratio
var footer = $("#footer");
var videoElement = $("video", footer);
var w = $(videoElement).width();
var h = $(videoElement).height();
if (w / h < 1.7) {
$("#videoPlayer", footer).addClass("aspect43");
}
}
function changeHandler(event) {
document.addEventListener(event, function () {

View file

@ -79,6 +79,8 @@
ApiClient.reportPlaybackStopped(Dashboard.getCurrentUserId(), currentItem.Id, position);
$("#mediaPlayer").hide();
if (currentItem.MediaType == "Video") {
ApiClient.stopActiveEncodings();
if (self.isFullScreen()) {
@ -357,6 +359,8 @@
$('#subtitleButton', nowPlayingBar).hide();
$('#chaptersButton', nowPlayingBar).hide();
$("#mediaPlayer", nowPlayingBar).show();
var mediaElement = $('#mediaElement', footer).html(html);
var audioElement = $("audio", mediaElement);

View file

@ -292,7 +292,7 @@ var Dashboard = {
options.id = options.id || "notification" + new Date().getTime() + parseInt(Math.random());
var footer = $("#footer");
var footer = $("#footer").css("top", "initial").show();
var parentElem = $('#footerNotifications', footer);
@ -312,22 +312,6 @@ var Dashboard = {
elem.slideDown(400);
}
var videoBackdrop = $("#videoBackdrop");
var isPlaying = false;
if (videoBackdrop.is(":visible")) {
videoBackdrop.css("bottom", "48px");
isPlaying = true;
} else {
footer.show();
}
elem.html(options.html).trigger("create");
if (options.timeout) {
@ -344,16 +328,15 @@ var Dashboard = {
}
footer.on("notification.remove notification.hide", function (e) {
setTimeout(function () { // give the DOM time to catch up
if (parentElem.html() == "") {
if (!isPlaying) {
footer.slideUp();
} else {
footer.css({ height: "0" });
videoBackdrop.animate({ bottom: "0" }, 400);
}
if (!parentElem.html()) {
footer.slideUp();
}
}, 50);
});
},