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

updated browse to command

This commit is contained in:
Luke Pulverenti 2013-05-25 20:53:51 -04:00
parent dd57fce842
commit 3fc8466680
3 changed files with 120 additions and 8 deletions

View file

@ -315,6 +315,11 @@
$('#playlistButton', nowPlayingBar).show();
}
$('#qualityButton', nowPlayingBar).hide();
$('#audioTracksButton', nowPlayingBar).hide();
$('#subtitleButton', nowPlayingBar).hide();
$('#chaptersButton', nowPlayingBar).hide();
$('#mediaElement', nowPlayingBar).html(html);
var audioElement = $("audio", nowPlayingBar);
@ -464,6 +469,23 @@
$('#nextTrackButton', nowPlayingBar).hide();
$('#mediaElement', nowPlayingBar).html(html);
$('#qualityButton', nowPlayingBar).show();
$('#audioTracksButton', nowPlayingBar).show();
if (item.MediaStreams.filter(function (i) {
return i.Type == "Subtitle";
}).length) {
$('#subtitleButton', nowPlayingBar).show();
} else {
$('#subtitleButton', nowPlayingBar).hide();
}
if (item.Chapters.length) {
$('#chaptersButton', nowPlayingBar).show();
} else {
$('#chaptersButton', nowPlayingBar).hide();
}
if ($.browser.msie) {
$('#fullscreenButton', nowPlayingBar).hide();
} else {
@ -885,6 +907,69 @@
self.isPlaying = function () {
return currentMediaElement;
};
function showFlyout(flyout, button) {
$(document.body).off("mousedown.mediaflyout").on("mousedown.mediaflyout", function (e) {
var elem = $(e.target);
var flyoutId = flyout[0].id;
var safeItems = button + ',#' + flyoutId;
if (!elem.is(safeItems) && !elem.parents(safeItems).length) {
flyout.hide();
$(document.body).off("mousedown.hidesearchhints");
}
});
flyout.show();
}
self.showAudioTracksFlyout = function () {
var flyout = $('#audioTracksFlyout');
if (!flyout.is(':visible')) {
showFlyout(flyout, '#audioTracksButton');
}
};
self.showChaptersFlyout = function () {
var flyout = $('#chaptersFlyout');
if (!flyout.is(':visible')) {
showFlyout(flyout, '#chaptersButton');
}
};
self.showQualityFlyout = function () {
var flyout = $('#qualityFlyout');
if (!flyout.is(':visible')) {
showFlyout(flyout, '#qualityButton');
}
};
self.showSubtitleMenu = function () {
var flyout = $('#subtitleFlyout');
if (!flyout.is(':visible')) {
showFlyout(flyout, '#subtitleButton');
}
};
}
window.MediaPlayer = new mediaPlayer();