diff --git a/dashboard-ui/cordova/chromecast.js b/dashboard-ui/cordova/chromecast.js
index d1f14013d3..b089d58aef 100644
--- a/dashboard-ui/cordova/chromecast.js
+++ b/dashboard-ui/cordova/chromecast.js
@@ -559,12 +559,7 @@
device.getWebAppLauncher().launchWebApp(ApplicationID).success(function (session) {
Logger.log('launchWebApp success. calling onSessionConnected');
- if ($.browser.android) {
- //tryJoinWebSession(device, true, false);
- setupWebAppSession(device, session, true);
- } else {
- setupWebAppSession(device, session, true);
- }
+ setupWebAppSession(device, session, true);
}).error(function (err1) {
diff --git a/dashboard-ui/cordova/ios/tabbar.js b/dashboard-ui/cordova/ios/tabbar.js
index 6342f53e06..e569565ff9 100644
--- a/dashboard-ui/cordova/ios/tabbar.js
+++ b/dashboard-ui/cordova/ios/tabbar.js
@@ -26,6 +26,9 @@
case 'Sync':
Dashboard.navigate('mysync.html');
break;
+ case 'LiveTv':
+ Dashboard.navigate('livetv.html');
+ break;
case 'Settings':
Dashboard.navigate('mypreferencesmenu.html?userId=' + Dashboard.getCurrentUserId());
break;
@@ -69,6 +72,7 @@
var items = [
{ name: 'Library', label: Globalize.translate('ButtonLibrary'), image: 'tabbar/tab-library.png', options: {} },
+ { name: 'LiveTv', label: Globalize.translate('HeaderLiveTV'), image: 'tabbar/tab-livetv.png', options: {} },
{ name: 'Favorites', label: Globalize.translate('ButtonFavorites'), image: 'tabButton:Favorites', options: {} },
{ name: 'Search', label: Globalize.translate('ButtonSearch'), image: 'tabButton:Search', options: {} },
{ name: 'NowPlaying', label: Globalize.translate('ButtonNowPlaying'), image: 'tabbar/tab-nowplaying.png', options: {} },
@@ -99,7 +103,37 @@
function showUserTabs(user) {
- var tabs = ['Library', 'Favorites', 'Search', 'NowPlaying'];
+ if (!window.ApiClient) {
+ onUserViewResponse(user, []);
+ return;
+ }
+
+ ApiClient.getUserViews({}, user.Id).done(function (result) {
+
+ onUserViewResponse(user, result.Items);
+
+ }).fail(function (result) {
+
+ onUserViewResponse(user, []);
+ });
+
+ }
+
+ function onUserViewResponse(user, views) {
+
+ var tabs = ['Library'];
+
+ if (views.filter(function (v) {
+
+ return v.CollectionType == 'livetv';
+
+ }).length) {
+ tabs.push('LiveTv');
+ }
+
+ tabs.push('Favorites');
+ tabs.push('Search');
+ tabs.push('NowPlaying');
if (user.Policy.EnableSync && Dashboard.capabilities().SupportsSync) {
diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css
index 2bdc9b4c3e..0e6817d49a 100644
--- a/dashboard-ui/css/librarybrowser.css
+++ b/dashboard-ui/css/librarybrowser.css
@@ -1818,7 +1818,8 @@ span.itemCommunityRating:not(:empty) + .userDataIcons {
#criticReviewsContent.hiddenScrollX .paperList {
min-width: 240px;
- max-width: 90%;
+ width: 90%;
+ max-width: 500px;
display: inline-block;
vertical-align: top;
margin: 0 4px 0 0;
diff --git a/dashboard-ui/devices/ios/ios.css b/dashboard-ui/devices/ios/ios.css
index 5ec07ebb40..50c1a61015 100644
--- a/dashboard-ui/devices/ios/ios.css
+++ b/dashboard-ui/devices/ios/ios.css
@@ -86,11 +86,15 @@ body {
flex-grow: 0 !important;
}
-.ui-body-b .paperList {
+.ui-body-b .paperList:not(.criticReviewPaperList) {
background-color: transparent;
box-shadow: none;
}
+.criticReviewPaperList {
+ background-color: #262626;
+}
+
.settingsMenuHeader {
display: none;
}
diff --git a/dashboard-ui/livetv.html b/dashboard-ui/livetv.html
index 8e7193aa3d..473f8a7698 100644
--- a/dashboard-ui/livetv.html
+++ b/dashboard-ui/livetv.html
@@ -31,12 +31,12 @@
@@ -44,7 +44,7 @@
${ButtonMoreItems}
-
+
@@ -52,7 +52,7 @@
${ButtonMoreItems}
-
+
@@ -60,7 +60,7 @@
${ButtonMoreItems}
-
+
diff --git a/dashboard-ui/mypreferenceslanguages.html b/dashboard-ui/mypreferenceslanguages.html
index 730b7cd6c6..96f7299b25 100644
--- a/dashboard-ui/mypreferenceslanguages.html
+++ b/dashboard-ui/mypreferenceslanguages.html
@@ -106,8 +106,8 @@
-
-
+
+
${OptionEnableExternalVideoPlayers}
${LabelExternalPlayersHelp}
diff --git a/dashboard-ui/scripts/globalize.js b/dashboard-ui/scripts/globalize.js
index f2e52fcc09..7b4846aecd 100644
--- a/dashboard-ui/scripts/globalize.js
+++ b/dashboard-ui/scripts/globalize.js
@@ -76,25 +76,9 @@
function getDeviceCulture() {
var deferred = DeferredBuilder.Deferred();
- if (navigator.globalization && navigator.globalization.getPreferredLanguage) {
+ if (AppInfo.isNativeApp) {
- Logger.log('Calling navigator.globalization.getPreferredLanguage');
-
- navigator.globalization.getPreferredLanguage(function (locale) {
-
- var culture = locale.value || '';
- //if ($.browser.safari) {
- culture = navigator.language || navigator.userLanguage || culture;
- //}
- Logger.log('Device culture is ' + culture);
- deferred.resolveWith(null, [culture]);
-
- }, function () {
-
- Logger.log('navigator.globalization.getPreferredLanguage failed');
-
- deferred.resolveWith(null, [navigator.language || navigator.userLanguage]);
- });
+ deferred.resolveWith(null, [navigator.language || navigator.userLanguage]);
} else if (AppInfo.supportsUserDisplayLanguageSetting) {
diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js
index 656502a144..a7d19cc564 100644
--- a/dashboard-ui/scripts/itemdetailpage.js
+++ b/dashboard-ui/scripts/itemdetailpage.js
@@ -1136,7 +1136,7 @@
var review = reviews[i];
- html += '
';
+ html += '
';
html += '
';
if (review.Score != null) {
diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js
index ba44663bb9..f73cc55fd7 100644
--- a/dashboard-ui/scripts/librarybrowser.js
+++ b/dashboard-ui/scripts/librarybrowser.js
@@ -583,7 +583,7 @@
showPlayMenu: function (positionTo, itemId, itemType, isFolder, mediaType, resumePositionTicks) {
- var externalPlayers = AppSettings.enableExternalPlayers();
+ var externalPlayers = AppInfo.supportsExternalPlayers && AppSettings.enableExternalPlayers();
if (!resumePositionTicks && mediaType != "Audio" && !isFolder) {
@@ -727,7 +727,9 @@
}
if (item.CanDownload) {
- commands.push('download');
+ if (AppInfo.supportsDownloading) {
+ commands.push('download');
+ }
}
if (LibraryBrowser.canShare(item, user)) {
diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js
index e277813012..cbca4de872 100644
--- a/dashboard-ui/scripts/librarylist.js
+++ b/dashboard-ui/scripts/librarylist.js
@@ -289,7 +289,7 @@
}
}
- if (mediaType == 'Video' && AppSettings.enableExternalPlayers()) {
+ if (mediaType == 'Video' && AppInfo.supportsExternalPlayers && AppSettings.enableExternalPlayers()) {
items.push({
name: Globalize.translate('ButtonPlayExternalPlayer'),
id: 'externalplayer',
diff --git a/dashboard-ui/scripts/livetvsuggested.js b/dashboard-ui/scripts/livetvsuggested.js
index 833a0e8f67..2cd87eb866 100644
--- a/dashboard-ui/scripts/livetvsuggested.js
+++ b/dashboard-ui/scripts/livetvsuggested.js
@@ -1,5 +1,26 @@
(function ($, document) {
+ function enableScrollX() {
+ return $.browser.mobile && AppInfo.enableAppLayouts;
+ }
+
+ function getPortraitShape() {
+ return enableScrollX() ? 'overflowPortrait' : 'portrait';
+ }
+
+ function getThumbShape() {
+ return enableScrollX() ? 'overflowBackdrop' : 'backdrop';
+ }
+
+ function getSquareShape() {
+ return enableScrollX() ? 'overflowSquare' : 'square';
+ }
+
+ function getLimit() {
+
+ return enableScrollX() ? 12 : 8;
+ }
+
function loadRecommendedPrograms(page) {
Dashboard.showLoadingMsg();
@@ -8,30 +29,15 @@
userId: Dashboard.getCurrentUserId(),
IsAiring: true,
- limit: 16,
+ limit: getLimit() * 2,
ImageTypeLimit: 1,
EnableImageTypes: "Primary"
}).done(function (result) {
- var html = LibraryBrowser.getPosterViewHtml({
- items: result.Items,
- shape: "auto",
- showTitle: true,
- showParentTitle: true,
- centerText: true,
- coverImage: true,
- lazy: true,
- overlayPlayButton: true
-
- });
-
- var elem = page.querySelector('.activeProgramItems');
- elem.innerHTML = html;
- ImageLoader.lazyChildren(elem);
- Dashboard.hideLoadingMsg();
-
+ renderItems(page, result.Items, 'activeProgramItems', 'play');
LibraryBrowser.setLastRefreshed(page);
+ Dashboard.hideLoadingMsg();
});
}
@@ -44,7 +50,7 @@
userId: Dashboard.getCurrentUserId(),
IsAiring: false,
HasAired: false,
- limit: 8,
+ limit: getLimit(),
IsMovie: false,
IsSports: false,
IsKids: false,
@@ -52,22 +58,7 @@
}).done(function (result) {
- var html = LibraryBrowser.getPosterViewHtml({
-
- items: result.Items,
- shape: "auto",
- showTitle: true,
- showParentTitle: true,
- centerText: true,
- coverImage: true,
- lazy: true,
- overlayMoreButton: true
-
- });
-
- var elem = page.querySelector('.upcomingProgramItems');
- elem.innerHTML = html;
- ImageLoader.lazyChildren(elem);
+ renderItems(page, result.Items, 'upcomingProgramItems');
});
ApiClient.getLiveTvRecommendedPrograms({
@@ -75,25 +66,12 @@
userId: Dashboard.getCurrentUserId(),
IsAiring: false,
HasAired: false,
- limit: 8,
+ limit: getLimit(),
IsMovie: true
}).done(function (result) {
- var html = LibraryBrowser.getPosterViewHtml({
- items: result.Items,
- shape: "portrait",
- showTitle: true,
- centerText: true,
- coverImage: true,
- overlayText: false,
- lazy: true,
- overlayMoreButton: true
- });
-
- var elem = page.querySelector('.upcomingTvMovieItems');
- elem.innerHTML = html;
- ImageLoader.lazyChildren(elem);
+ renderItems(page, result.Items, 'upcomingTvMovieItems', null, getPortraitShape());
});
ApiClient.getLiveTvRecommendedPrograms({
@@ -101,25 +79,12 @@
userId: Dashboard.getCurrentUserId(),
IsAiring: false,
HasAired: false,
- limit: 8,
+ limit: getLimit(),
IsSports: true
}).done(function (result) {
- var html = LibraryBrowser.getPosterViewHtml({
- items: result.Items,
- shape: "auto",
- showTitle: true,
- centerText: true,
- coverImage: true,
- overlayText: false,
- lazy: true,
- overlayMoreButton: true
- });
-
- var elem = page.querySelector('.upcomingSportsItems');
- elem.innerHTML = html;
- ImageLoader.lazyChildren(elem);
+ renderItems(page, result.Items, 'upcomingSportsItems');
});
ApiClient.getLiveTvRecommendedPrograms({
@@ -127,28 +92,44 @@
userId: Dashboard.getCurrentUserId(),
IsAiring: false,
HasAired: false,
- limit: 8,
+ limit: getLimit(),
IsKids: true
}).done(function (result) {
- var html = LibraryBrowser.getPosterViewHtml({
- items: result.Items,
- shape: "auto",
- showTitle: true,
- centerText: true,
- coverImage: true,
- overlayText: false,
- lazy: true,
- overlayMoreButton: true
- });
-
- var elem = page.querySelector('.upcomingKidsItems');
- elem.innerHTML = html;
- ImageLoader.lazyChildren(elem);
+ renderItems(page, result.Items, 'upcomingKidsItems');
});
}
+ function renderItems(page, items, sectionClass, overlayButton, shape) {
+
+ var html = LibraryBrowser.getPosterViewHtml({
+ items: items,
+ shape: shape || (enableScrollX() ? getSquareShape() : 'auto'),
+ showTitle: true,
+ centerText: true,
+ coverImage: true,
+ overlayText: false,
+ lazy: true,
+ overlayMoreButton: overlayButton != 'play',
+ overlayPlayButton: overlayButton == 'play'
+ });
+
+ var elem = page.querySelector('.' + sectionClass);
+
+ elem.innerHTML = html;
+ ImageLoader.lazyChildren(elem);
+ }
+
+ function initSuggestedTab(page, tabContent) {
+
+ if (enableScrollX()) {
+ $('.itemsContainer', tabContent).addClass('hiddenScrollX').createCardMenus();
+ } else {
+ $('.itemsContainer', tabContent).removeClass('hiddenScrollX').createCardMenus();
+ }
+ }
+
function renderSuggestedTab(page, tabContent) {
if (LibraryBrowser.needsRefresh(tabContent)) {
@@ -168,6 +149,7 @@
case 0:
renderMethod = 'renderSuggestedTab';
+ initMethod = 'initSuggestedTab';
break;
case 1:
depends.push('scripts/registrationservices');
@@ -225,7 +207,8 @@
});
window.LiveTvPage = {
- renderSuggestedTab: renderSuggestedTab
+ renderSuggestedTab: renderSuggestedTab,
+ initSuggestedTab: initSuggestedTab
};
})(jQuery, document);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/mypreferenceslanguages.js b/dashboard-ui/scripts/mypreferenceslanguages.js
index fe0af34d53..99ebe4c19c 100644
--- a/dashboard-ui/scripts/mypreferenceslanguages.js
+++ b/dashboard-ui/scripts/mypreferenceslanguages.js
@@ -147,7 +147,13 @@
var page = this;
- if (AppInfo.hasKnownExternalPlayerSupport) {
+ if (AppInfo.supportsExternalPlayers) {
+ $('.fldExternalPlayer', page).show();
+ } else {
+ $('.fldExternalPlayer', page).hide();
+ }
+
+ if (AppInfo.supportsExternalPlayerMenu) {
$('.labelNativeExternalPlayers', page).show();
$('.labelGenericExternalPlayers', page).hide();
} else {
diff --git a/dashboard-ui/scripts/sections.js b/dashboard-ui/scripts/sections.js
index 1a43989bd9..5103fc6a54 100644
--- a/dashboard-ui/scripts/sections.js
+++ b/dashboard-ui/scripts/sections.js
@@ -14,6 +14,10 @@
var view = items[i];
+ if (AppInfo.isNativeApp && $.browser.safari && view.CollectionType == 'livetv') {
+ continue;
+ }
+
list.push(view);
if (view.CollectionType == 'livetv') {
diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js
index 1d75efe97e..08115748a7 100644
--- a/dashboard-ui/scripts/site.js
+++ b/dashboard-ui/scripts/site.js
@@ -1801,10 +1801,16 @@ var AppInfo = {};
AppInfo.enableMovieTrailersTab = true;
}
+ AppInfo.supportsExternalPlayers = true;
+
if (isCordova) {
AppInfo.enableAppLayouts = true;
- AppInfo.hasKnownExternalPlayerSupport = true;
+ AppInfo.supportsExternalPlayerMenu = true;
AppInfo.isNativeApp = true;
+
+ if (isIOS) {
+ AppInfo.supportsExternalPlayers = false;
+ }
}
else {
AppInfo.enableFooterNotifications = true;
@@ -1824,6 +1830,8 @@ var AppInfo = {};
}
}
+ AppInfo.supportsDownloading = !AppInfo.isNativeApp || !$.browser.safari;
+
AppInfo.enableUserImage = true;
AppInfo.hasPhysicalVolumeButtons = isCordova || isMobile;
AppInfo.enableBackButton = isIOS && (window.navigator.standalone || AppInfo.isNativeApp);