1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Video player fixes

Mobile playback fixed - video no longer hidden by default and unhidden
on playing
Footer notifications fixed
This commit is contained in:
Tim Hobbs 2014-03-17 15:37:05 -07:00
parent 941824a5fb
commit 96e64c4f1f
5 changed files with 79 additions and 39 deletions

View file

@ -292,7 +292,9 @@ var Dashboard = {
options.id = options.id || "notification" + new Date().getTime() + parseInt(Math.random());
var parentElem = $('#footerNotifications');
var footer = $("#footer").show();
var parentElem = $('#footerNotifications', footer);
var elem = $('#' + options.id, parentElem);
@ -300,7 +302,7 @@ var Dashboard = {
elem = $('<p id="' + options.id + '" class="footerNotification"></p>').appendTo(parentElem);
}
var onclick = removeOnHide ? "$(\"#" + options.id + "\").remove();" : "$(\"#" + options.id + "\").hide();";
var onclick = removeOnHide ? "$(\"#" + options.id + "\").trigger(\"notification.remove\").remove();" : "$(\"#" + options.id + "\").trigger(\"notification.hide\").hide();";
if (options.allowHide !== false) {
options.html += "<span style='margin-left: 1em;'><button type='button' onclick='" + onclick + "' data-icon='delete' data-iconpos='notext' data-mini='true' data-inline='true' data-theme='b'>Hide</button></span>";
@ -310,20 +312,29 @@ var Dashboard = {
elem.show();
}
elem.html(options.html).trigger('create');
elem.html(options.html).trigger("create");
if (options.timeout) {
setTimeout(function () {
if (removeOnHide) {
elem.remove();
elem.trigger("notification.remove").remove();
} else {
elem.hide();
elem.trigger("notification.hide").hide();
}
}, options.timeout);
}
footer.on("notification.remove notification.hide", function (e) {
setTimeout(function () { // give the DOM time to catch up
console.log("html", parentElem.html() == "", this);
if (parentElem.html() == "") {
footer.slideUp();
}
}, 50);
});
},
getConfigurationPageUrl: function (name) {
@ -1306,10 +1317,20 @@ $(ApiClient).on("websocketmessage", Dashboard.onWebSocketMessageReceived);
$(function () {
var footerHtml = '<div id="footer" data-theme="b" class="ui-bar-b" style="display: none;">';
footerHtml += '<div id="mediaPlayer" style="display: none;">';
footerHtml += '<div id="videoBackdrop" style="display: none;">';
footerHtml += '<div id="videoPlayer">';
footerHtml += '<div id="mediaElement"></div>';
footerHtml += '</div>';
footerHtml += '</div>';
footerHtml += '<div id="nowPlayingBar" class="nowPlayingBar">';
footerHtml += '<div class="barBackground ui-bar-b">';
footerHtml += '<div style="display:inline-block;width:12px;"></div>';
footerHtml += '<a id="playlistButton" class="mediaButton playlistButton" href="playlist.html" data-role="button" data-icon="bullets" data-iconpos="notext" data-inline="true" title="Playlist">Playlist</a>';
footerHtml += '<button id="previousTrackButton" class="mediaButton previousTrackButton" title="Previous Track" type="button" onclick="MediaPlayer.previousTrack();" data-icon="previous-track" data-iconpos="notext" data-inline="true">Previous Track</button>';
@ -1351,10 +1372,12 @@ $(function () {
footerHtml += '</div>';
footerHtml += '<div id="footerNotifications"></div>';
footerHtml += '</div>';
footerHtml += '</div>';
footerHtml += '<div id="footerNotifications"></div>';
footerHtml += '</div>';
$(document.body).append(footerHtml);