mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
support ac3 audio in edge browser
This commit is contained in:
parent
3d0d3247fd
commit
ac72577f3b
9 changed files with 67 additions and 49 deletions
|
@ -64,12 +64,7 @@
|
|||
|
||||
if (path) {
|
||||
|
||||
html += '<paper-item role="menuitem" class="lnkPath lnkDirectory" data-path="' + parentPath + '">';
|
||||
html += '<paper-item-body>';
|
||||
html += '...';
|
||||
html += '</paper-item-body>';
|
||||
html += '<iron-icon icon="arrow-forward"></iron-icon>';
|
||||
html += '</paper-item>';
|
||||
html += getItem("lnkPath lnkDirectory", parentPath, "Network", '...');
|
||||
}
|
||||
|
||||
for (var i = 0, length = folders.length; i < length; i++) {
|
||||
|
@ -78,21 +73,11 @@
|
|||
|
||||
var cssClass = folder.Type == "File" ? "lnkPath lnkFile" : "lnkPath lnkDirectory";
|
||||
|
||||
html += '<paper-item role="menuitem" class="' + cssClass + '" data-type="' + folder.Type + '" data-path="' + folder.Path + '">';
|
||||
html += '<paper-item-body>';
|
||||
html += folder.Name;
|
||||
html += '</paper-item-body>';
|
||||
html += '<iron-icon icon="arrow-forward"></iron-icon>';
|
||||
html += '</paper-item>';
|
||||
html += getItem(cssClass, folder.Type, folder.Path, folder.Name);
|
||||
}
|
||||
|
||||
if (!path) {
|
||||
html += '<paper-item role="menuitem" class="lnkPath lnkDirectory" data-path="Network">';
|
||||
html += '<paper-item-body>';
|
||||
html += Globalize.translate('ButtonNetwork');
|
||||
html += '</paper-item-body>';
|
||||
html += '<iron-icon icon="arrow-forward"></iron-icon>';
|
||||
html += '</paper-item>';
|
||||
html += getItem("lnkPath lnkDirectory", "", "Network", Globalize.translate('ButtonNetwork'));
|
||||
}
|
||||
|
||||
$('.results', page).html(html);
|
||||
|
@ -108,6 +93,19 @@
|
|||
});
|
||||
}
|
||||
|
||||
function getItem(cssClass, type, path, name) {
|
||||
|
||||
var html = '';
|
||||
html += '<paper-item role="menuitem" class="' + cssClass + '" data-type="' + type + '" data-path="' + path + '">';
|
||||
html += '<paper-item-body>';
|
||||
html += name;
|
||||
html += '</paper-item-body>';
|
||||
html += '<iron-icon icon="arrow-forward"></iron-icon>';
|
||||
html += '</paper-item>';
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
function getEditorHtml(options, systemInfo) {
|
||||
|
||||
var html = '';
|
||||
|
|
|
@ -55,10 +55,7 @@
|
|||
|
||||
html += '<paper-icon-item role="menuitem" class="lnkPath">';
|
||||
|
||||
if (!$.browser.msie) {
|
||||
// Not sure why, but this is causing the entire browser to hang
|
||||
html += '<paper-fab class="listAvatar" style="background:#52B54B;" icon="folder" item-icon></paper-fab>';
|
||||
}
|
||||
html += '<paper-fab class="listAvatar" style="background:#52B54B;" icon="folder" item-icon></paper-fab>';
|
||||
|
||||
html += '<paper-item-body>';
|
||||
html += path;
|
||||
|
|
|
@ -87,9 +87,12 @@
|
|||
|
||||
// without this safari will scroll the background instead of the dialog contents
|
||||
// but not needed here since this is already on top of an existing dialog
|
||||
dlg.setAttribute('modal', 'modal');
|
||||
// but skip it in IE because it's causing the entire browser to hang
|
||||
if (!$.browser.msie) {
|
||||
dlg.setAttribute('modal', 'modal');
|
||||
}
|
||||
|
||||
// seeing max call stack size exceeded in the debugger with this
|
||||
//// seeing max call stack size exceeded in the debugger with this
|
||||
dlg.setAttribute('noAutoFocus', 'noAutoFocus');
|
||||
dlg.entryAnimation = 'scale-up-animation';
|
||||
dlg.exitAnimation = 'fade-out-animation';
|
||||
|
|
|
@ -166,7 +166,7 @@
|
|||
}).fail(function () {
|
||||
Dashboard.hideLoadingMsg();
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorSavingTvProvider')
|
||||
message: Globalize.translate('ErrorAddingListingsToSchedulesDirect')
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
}
|
||||
|
||||
paper-fab.keyboard-focus.paper-fab-0 {
|
||||
/*background: #444;*/
|
||||
background: #444;
|
||||
}
|
||||
|
|
|
@ -125,7 +125,10 @@
|
|||
var isVlc = AppInfo.isNativeApp && $.browser.android;
|
||||
var bitrateSetting = AppSettings.maxStreamingBitrate();
|
||||
|
||||
var canPlayWebm = self.canPlayWebm();
|
||||
var supportedFormats = getSupportedFormats();
|
||||
|
||||
var canPlayWebm = supportedFormats.indexOf('webm') != -1;
|
||||
var canPlayAc3 = supportedFormats.indexOf('ac3') != -1;
|
||||
|
||||
var profile = {};
|
||||
|
||||
|
@ -135,28 +138,21 @@
|
|||
|
||||
profile.DirectPlayProfiles = [];
|
||||
|
||||
if (canPlayH264()) {
|
||||
if (supportedFormats.indexOf('h264') != -1) {
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: 'mp4,m4v',
|
||||
Type: 'Video',
|
||||
VideoCodec: 'h264',
|
||||
AudioCodec: 'aac,mp3'
|
||||
AudioCodec: 'aac,mp3' + (canPlayAc3 ? ',ac3' : '')
|
||||
});
|
||||
}
|
||||
|
||||
if ($.browser.chrome) {
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: 'mkv',
|
||||
Container: 'mkv,mov',
|
||||
Type: 'Video',
|
||||
VideoCodec: 'h264',
|
||||
AudioCodec: 'aac,mp3'
|
||||
});
|
||||
|
||||
profile.DirectPlayProfiles.push({
|
||||
Container: 'mov',
|
||||
Type: 'Video',
|
||||
VideoCodec: 'h264',
|
||||
AudioCodec: 'aac,mp3'
|
||||
AudioCodec: 'aac,mp3' + (canPlayAc3 ? ',ac3' : '')
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -207,7 +203,7 @@
|
|||
profile.TranscodingProfiles.push({
|
||||
Container: 'ts',
|
||||
Type: 'Video',
|
||||
AudioCodec: 'aac',
|
||||
AudioCodec: 'aac' + (canPlayAc3 ? ',ac3' : ''),
|
||||
VideoCodec: 'h264',
|
||||
Context: 'Streaming',
|
||||
Protocol: 'hls'
|
||||
|
@ -1827,7 +1823,6 @@
|
|||
function canPlayH264() {
|
||||
|
||||
var userAgent = navigator.userAgent.toLowerCase();
|
||||
|
||||
if (userAgent.indexOf('firefox') != -1) {
|
||||
if (userAgent.indexOf('windows') != -1) {
|
||||
return true;
|
||||
|
@ -1838,14 +1833,35 @@
|
|||
return true;
|
||||
}
|
||||
|
||||
self._canPlayWebm = null;
|
||||
self.canPlayWebm = function () {
|
||||
var supportedFormats;
|
||||
function getSupportedFormats() {
|
||||
|
||||
if (self._canPlayWebm == null) {
|
||||
self._canPlayWebm = document.createElement('video').canPlayType('video/webm').replace(/no/, '');
|
||||
if (supportedFormats) {
|
||||
return supportedFormats;
|
||||
}
|
||||
return self._canPlayWebm;
|
||||
};
|
||||
|
||||
var list = [];
|
||||
var elem = document.createElement('video');
|
||||
|
||||
if (elem.canPlayType('video/webm').replace(/no/, '')) {
|
||||
list.push('webm');
|
||||
}
|
||||
if (elem.canPlayType('audio/mp4; codecs="ac-3"').replace(/no/, '')) {
|
||||
list.push('ac3');
|
||||
}
|
||||
|
||||
var canPlayH264 = true;
|
||||
var userAgent = navigator.userAgent.toLowerCase();
|
||||
if (userAgent.indexOf('firefox') != -1 && userAgent.indexOf('windows') == -1) {
|
||||
canPlayH264 = false;
|
||||
}
|
||||
|
||||
if (canPlayH264) {
|
||||
list.push('h264');
|
||||
}
|
||||
supportedFormats = list;
|
||||
return list;
|
||||
}
|
||||
|
||||
self.canAutoPlayAudio = function () {
|
||||
|
||||
|
|
|
@ -1622,6 +1622,8 @@ var Dashboard = {
|
|||
name = "Opera";
|
||||
} else if ($.browser.mozilla) {
|
||||
name = "Firefox";
|
||||
} else if ($.browser.edge) {
|
||||
name = "Edge";
|
||||
}
|
||||
|
||||
if ($.browser.version) {
|
||||
|
|
|
@ -921,5 +921,6 @@
|
|||
"HeaderTryDragAndDrop": "Try Drag and Drop",
|
||||
"TryDragAndDropMessage": "To re-arrange playlist items, just drag and drop. Try it!",
|
||||
"HeaderTryMicrosoftEdge": "Try Microsoft Edge",
|
||||
"MessageTryMicrosoftEdge": "For a better experience on Windows 10, try the new Microsoft Edge Browser."
|
||||
"MessageTryMicrosoftEdge": "For a better experience on Windows 10, try the new Microsoft Edge Browser.",
|
||||
"ErrorAddingListingsToSchedulesDirect": "There was an error adding the lineup to your Schedules Direct account. Schedules Direct only allows a limited number of lineups per account. You may need to log into the Schedules Direct website and remove others listings from your account before proceeeding."
|
||||
}
|
||||
|
|
5
dashboard-ui/thirdparty/browser.js
vendored
5
dashboard-ui/thirdparty/browser.js
vendored
|
@ -902,7 +902,8 @@
|
|||
jQuery.uaMatch = function (ua) {
|
||||
ua = ua.toLowerCase();
|
||||
|
||||
var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
|
||||
var match = /(edge)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(chrome)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(safari)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(msie) ([\w.]+)/.exec(ua) ||
|
||||
|
@ -945,7 +946,7 @@
|
|||
browser[matched.platform] = true;
|
||||
}
|
||||
|
||||
if (userAgent.toLowerCase().indexOf("webkit") != -1 && !browser.chrome && !browser.msie) {
|
||||
if (userAgent.toLowerCase().indexOf("webkit") != -1 && !browser.chrome && !browser.msie && !browser.edge) {
|
||||
browser.safari = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue