1
0
Fork 0
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:
Luke Pulverenti 2015-10-17 21:18:29 -04:00
parent 3d0d3247fd
commit ac72577f3b
9 changed files with 67 additions and 49 deletions

View file

@ -64,12 +64,7 @@
if (path) { if (path) {
html += '<paper-item role="menuitem" class="lnkPath lnkDirectory" data-path="' + parentPath + '">'; html += getItem("lnkPath lnkDirectory", parentPath, "Network", '...');
html += '<paper-item-body>';
html += '...';
html += '</paper-item-body>';
html += '<iron-icon icon="arrow-forward"></iron-icon>';
html += '</paper-item>';
} }
for (var i = 0, length = folders.length; i < length; i++) { for (var i = 0, length = folders.length; i < length; i++) {
@ -78,21 +73,11 @@
var cssClass = folder.Type == "File" ? "lnkPath lnkFile" : "lnkPath lnkDirectory"; 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 += getItem(cssClass, folder.Type, folder.Path, folder.Name);
html += '<paper-item-body>';
html += folder.Name;
html += '</paper-item-body>';
html += '<iron-icon icon="arrow-forward"></iron-icon>';
html += '</paper-item>';
} }
if (!path) { if (!path) {
html += '<paper-item role="menuitem" class="lnkPath lnkDirectory" data-path="Network">'; html += getItem("lnkPath lnkDirectory", "", "Network", Globalize.translate('ButtonNetwork'));
html += '<paper-item-body>';
html += Globalize.translate('ButtonNetwork');
html += '</paper-item-body>';
html += '<iron-icon icon="arrow-forward"></iron-icon>';
html += '</paper-item>';
} }
$('.results', page).html(html); $('.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) { function getEditorHtml(options, systemInfo) {
var html = ''; var html = '';

View file

@ -55,10 +55,7 @@
html += '<paper-icon-item role="menuitem" class="lnkPath">'; 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 += '<paper-item-body>';
html += path; html += path;

View file

@ -87,9 +87,12 @@
// without this safari will scroll the background instead of the dialog contents // 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 // but not needed here since this is already on top of an existing dialog
// but skip it in IE because it's causing the entire browser to hang
if (!$.browser.msie) {
dlg.setAttribute('modal', 'modal'); 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.setAttribute('noAutoFocus', 'noAutoFocus');
dlg.entryAnimation = 'scale-up-animation'; dlg.entryAnimation = 'scale-up-animation';
dlg.exitAnimation = 'fade-out-animation'; dlg.exitAnimation = 'fade-out-animation';

View file

@ -166,7 +166,7 @@
}).fail(function () { }).fail(function () {
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
Dashboard.alert({ Dashboard.alert({
message: Globalize.translate('ErrorSavingTvProvider') message: Globalize.translate('ErrorAddingListingsToSchedulesDirect')
}); });
}); });

View file

@ -3,5 +3,5 @@
} }
paper-fab.keyboard-focus.paper-fab-0 { paper-fab.keyboard-focus.paper-fab-0 {
/*background: #444;*/ background: #444;
} }

View file

@ -125,7 +125,10 @@
var isVlc = AppInfo.isNativeApp && $.browser.android; var isVlc = AppInfo.isNativeApp && $.browser.android;
var bitrateSetting = AppSettings.maxStreamingBitrate(); 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 = {}; var profile = {};
@ -135,28 +138,21 @@
profile.DirectPlayProfiles = []; profile.DirectPlayProfiles = [];
if (canPlayH264()) { if (supportedFormats.indexOf('h264') != -1) {
profile.DirectPlayProfiles.push({ profile.DirectPlayProfiles.push({
Container: 'mp4,m4v', Container: 'mp4,m4v',
Type: 'Video', Type: 'Video',
VideoCodec: 'h264', VideoCodec: 'h264',
AudioCodec: 'aac,mp3' AudioCodec: 'aac,mp3' + (canPlayAc3 ? ',ac3' : '')
}); });
} }
if ($.browser.chrome) { if ($.browser.chrome) {
profile.DirectPlayProfiles.push({ profile.DirectPlayProfiles.push({
Container: 'mkv', Container: 'mkv,mov',
Type: 'Video', Type: 'Video',
VideoCodec: 'h264', VideoCodec: 'h264',
AudioCodec: 'aac,mp3' AudioCodec: 'aac,mp3' + (canPlayAc3 ? ',ac3' : '')
});
profile.DirectPlayProfiles.push({
Container: 'mov',
Type: 'Video',
VideoCodec: 'h264',
AudioCodec: 'aac,mp3'
}); });
} }
@ -207,7 +203,7 @@
profile.TranscodingProfiles.push({ profile.TranscodingProfiles.push({
Container: 'ts', Container: 'ts',
Type: 'Video', Type: 'Video',
AudioCodec: 'aac', AudioCodec: 'aac' + (canPlayAc3 ? ',ac3' : ''),
VideoCodec: 'h264', VideoCodec: 'h264',
Context: 'Streaming', Context: 'Streaming',
Protocol: 'hls' Protocol: 'hls'
@ -1827,7 +1823,6 @@
function canPlayH264() { function canPlayH264() {
var userAgent = navigator.userAgent.toLowerCase(); var userAgent = navigator.userAgent.toLowerCase();
if (userAgent.indexOf('firefox') != -1) { if (userAgent.indexOf('firefox') != -1) {
if (userAgent.indexOf('windows') != -1) { if (userAgent.indexOf('windows') != -1) {
return true; return true;
@ -1838,14 +1833,35 @@
return true; return true;
} }
self._canPlayWebm = null; var supportedFormats;
self.canPlayWebm = function () { function getSupportedFormats() {
if (self._canPlayWebm == null) { if (supportedFormats) {
self._canPlayWebm = document.createElement('video').canPlayType('video/webm').replace(/no/, ''); return supportedFormats;
}
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;
} }
return self._canPlayWebm;
};
self.canAutoPlayAudio = function () { self.canAutoPlayAudio = function () {

View file

@ -1622,6 +1622,8 @@ var Dashboard = {
name = "Opera"; name = "Opera";
} else if ($.browser.mozilla) { } else if ($.browser.mozilla) {
name = "Firefox"; name = "Firefox";
} else if ($.browser.edge) {
name = "Edge";
} }
if ($.browser.version) { if ($.browser.version) {

View file

@ -921,5 +921,6 @@
"HeaderTryDragAndDrop": "Try Drag and Drop", "HeaderTryDragAndDrop": "Try Drag and Drop",
"TryDragAndDropMessage": "To re-arrange playlist items, just drag and drop. Try it!", "TryDragAndDropMessage": "To re-arrange playlist items, just drag and drop. Try it!",
"HeaderTryMicrosoftEdge": "Try Microsoft Edge", "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."
} }

View file

@ -902,7 +902,8 @@
jQuery.uaMatch = function (ua) { jQuery.uaMatch = function (ua) {
ua = ua.toLowerCase(); ua = ua.toLowerCase();
var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || var match = /(edge)[ \/]([\w.]+)/.exec(ua) ||
/(chrome)[ \/]([\w.]+)/.exec(ua) ||
/(safari)[ \/]([\w.]+)/.exec(ua) || /(safari)[ \/]([\w.]+)/.exec(ua) ||
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
/(msie) ([\w.]+)/.exec(ua) || /(msie) ([\w.]+)/.exec(ua) ||
@ -945,7 +946,7 @@
browser[matched.platform] = true; 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; browser.safari = true;
} }