From fbb8a6e7ff360f9c83553d0060be046b49c164a1 Mon Sep 17 00:00:00 2001 From: Techywarrior Date: Wed, 27 Mar 2013 12:23:42 -0700 Subject: [PATCH 1/3] hide language, resolution and framerate if not relevant --- dashboard-ui/scripts/Itemdetailpage.js | 30 ++++++++++++++++++-------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/dashboard-ui/scripts/Itemdetailpage.js b/dashboard-ui/scripts/Itemdetailpage.js index 8c54ac4fac..1381ff6290 100644 --- a/dashboard-ui/scripts/Itemdetailpage.js +++ b/dashboard-ui/scripts/Itemdetailpage.js @@ -453,16 +453,18 @@ var page = $.mobile.activePage; var html = ''; + var hasVideo = false; + var hasLanguage = false; html += ''; html += ''; html += ''; html += ''; - html += ''; - html += ''; + html += ''; + html += ''; html += ''; html += ''; - html += ''; + html += ''; html += ''; html += ''; html += ''; @@ -471,18 +473,23 @@ var stream = item.MediaStreams[i]; + if (stream.Type == "Video") { + hasVideo = true; + } + html += ''; html += ''; html += ''; - if (stream.Language) - html += ''; - else html += ''; + if (stream.Language) { + hasLanguage = true; + html += ''; + } else html += ''; if (stream.Type == "Video") { - html += ''; + html += ''; }else { - html += ''; + html += ''; } if (stream.Channels) { @@ -495,7 +502,7 @@ if (stream.Type == "Video") { var framerate = stream.AverageFrameRate || stream.RealFrameRate; - html += ''; + html += ''; }else { html += ''; } @@ -513,6 +520,11 @@ html += '
TypeCodecLanguageResolutionLanguageResolutionChannelsBitrateFramerateFramerateFlags
' + stream.Type + '' + stream.Codec +'' + stream.Language +'' + stream.Language +''+ stream.Width +'/'+ stream.Height +' ('+ stream.AspectRatio +')'+ stream.Width +'/'+ stream.Height +' ('+ stream.AspectRatio +')'+ framerate +''+ framerate +'
'; $('#mediaInfoContent', page).html(html).trigger('create'); + if (!hasLanguage) $('#mediaInfoCollapsible #mediaInfo-table .language', page).hide(); + if (!hadVideo) { + $('#mediaInfoCollapsible #mediaInfo-table .resolution', page).hide(); + $('#mediaInfoCollapsible #mediaInfo-table .framerate', page).hide(); + } $('#mediaInfoCollapsible', page).show(); }, From d578faefb48133c5f33edbd82a82e2fa84092e05 Mon Sep 17 00:00:00 2001 From: Techywarrior Date: Wed, 27 Mar 2013 12:27:00 -0700 Subject: [PATCH 2/3] typo --- dashboard-ui/scripts/Itemdetailpage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard-ui/scripts/Itemdetailpage.js b/dashboard-ui/scripts/Itemdetailpage.js index 1381ff6290..f6903e5559 100644 --- a/dashboard-ui/scripts/Itemdetailpage.js +++ b/dashboard-ui/scripts/Itemdetailpage.js @@ -521,7 +521,7 @@ $('#mediaInfoContent', page).html(html).trigger('create'); if (!hasLanguage) $('#mediaInfoCollapsible #mediaInfo-table .language', page).hide(); - if (!hadVideo) { + if (!hasVideo) { $('#mediaInfoCollapsible #mediaInfo-table .resolution', page).hide(); $('#mediaInfoCollapsible #mediaInfo-table .framerate', page).hide(); } From d95a277bbe0a62787ccbccba3843e213a9c61a7b Mon Sep 17 00:00:00 2001 From: Techywarrior Date: Wed, 27 Mar 2013 12:37:33 -0700 Subject: [PATCH 3/3] change name for embedded image in audio stream --- dashboard-ui/scripts/Itemdetailpage.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dashboard-ui/scripts/Itemdetailpage.js b/dashboard-ui/scripts/Itemdetailpage.js index f6903e5559..cb6fdc6659 100644 --- a/dashboard-ui/scripts/Itemdetailpage.js +++ b/dashboard-ui/scripts/Itemdetailpage.js @@ -477,8 +477,11 @@ hasVideo = true; } + if (item.MediaType == "Audio" && stream.Type == "Video") var type = "Embedded Image"; + else var type = stream.Type; + html += ''; - html += '' + stream.Type + ''; + html += '' + type + ''; html += '' + stream.Codec +''; if (stream.Language) {