diff --git a/dashboard-ui/livetvrecording.html b/dashboard-ui/livetvrecording.html
index a1375e3d20..7e35119e94 100644
--- a/dashboard-ui/livetvrecording.html
+++ b/dashboard-ui/livetvrecording.html
@@ -41,9 +41,6 @@
-
-
-
diff --git a/dashboard-ui/scripts/dlnaprofile.js b/dashboard-ui/scripts/dlnaprofile.js
index 9c1897a9f3..2704172efd 100644
--- a/dashboard-ui/scripts/dlnaprofile.js
+++ b/dashboard-ui/scripts/dlnaprofile.js
@@ -67,7 +67,7 @@
}
function renderSubProfiles(page, profile) {
-
+
renderDirectPlayProfiles(page, profile.DirectPlayProfiles);
renderTranscodingProfiles(page, profile.TranscodingProfiles);
renderContainerProfiles(page, profile.ContainerProfiles);
@@ -75,10 +75,11 @@
renderMediaProfiles(page, profile.MediaProfiles);
}
- function editDirectPlayProfile(page, directPlayProfile, isNew) {
+ function editDirectPlayProfile(page, directPlayProfile) {
+ isSubProfileNew = directPlayProfile == null;
+ directPlayProfile = directPlayProfile || {};
currentSubProfile = directPlayProfile;
- isSubProfileNew = isNew;
var popup = $('#popupEditDirectPlayProfile', page).popup('open');
@@ -94,16 +95,16 @@
currentSubProfile.Container = $('#txtDirectPlayContainer', page).val();
currentSubProfile.AudioCodec = $('#txtDirectPlayAudioCodec', page).val();
currentSubProfile.VideoCodec = $('#txtDirectPlayVideoCodec', page).val();
-
+
if (isSubProfileNew) {
currentProfile.DirectPlayProfiles.push(currentSubProfile);
- }
+ }
renderSubProfiles(page, currentProfile);
currentSubProfile = null;
-
+
$('#popupEditDirectPlayProfile', page).popup('close');
}
@@ -432,7 +433,7 @@
}).done(function () {
- Dashboard.navigate('dlnaprofiles.html');
+ Dashboard.alert('Settings saved.');
});
} else {
@@ -503,6 +504,12 @@
});
+ $('.btnAddDirectPlayProfile', page).on('click', function () {
+
+ editDirectPlayProfile(page);
+
+ });
+
}).on('pageshow', "#dlnaProfilePage", function () {
var page = this;
diff --git a/dashboard-ui/scripts/itembynamedetailpage.js b/dashboard-ui/scripts/itembynamedetailpage.js
index b1d7b4901a..7852a86d3e 100644
--- a/dashboard-ui/scripts/itembynamedetailpage.js
+++ b/dashboard-ui/scripts/itembynamedetailpage.js
@@ -81,7 +81,7 @@
Dashboard.getCurrentUser().done(function (user) {
- if (MediaPlayer.canPlay(item, user)) {
+ if (MediaController.canPlay(item)) {
$('#playButtonContainer', page).show();
} else {
$('#playButtonContainer', page).hide();
@@ -518,12 +518,7 @@
$('#btnPlay', page).on('click', function () {
var userdata = currentItem.UserData || {};
- LibraryBrowser.showPlayMenu(this, currentItem.Name, currentItem.Type, "Audio", userdata.PlaybackPositionTicks);
- });
-
- $('#btnRemote', page).on('click', function () {
-
- RemoteControl.showMenuForItem({ item: currentItem, context: getParameterByName('context') || '' });
+ LibraryBrowser.showPlayMenu(this, currentItem.Id, currentItem.Type, false, "Audio", userdata.PlaybackPositionTicks);
});
}).on('pageshow', "#itemByNameDetailPage", function () {
diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js
index cc95f465a4..50b0ec2a27 100644
--- a/dashboard-ui/scripts/itemdetailpage.js
+++ b/dashboard-ui/scripts/itemdetailpage.js
@@ -29,8 +29,6 @@
renderDetails(page, item, context);
LibraryBrowser.renderDetailPageBackdrop(page, item);
- $("#remoteButtonContainer", page).show();
-
if (user.Configuration.IsAdministrator) {
$('#editButtonContainer', page).show();
@@ -38,21 +36,18 @@
$('#editButtonContainer', page).hide();
}
- if (MediaPlayer.canPlay(item, user)) {
+ var externalPlayUrl = getExternalPlayUrl(item);
+ $('#btnPlayExternal', page).attr('href', externalPlayUrl || '#');
- var url = MediaPlayer.getPlayUrl(item);
-
- if (url) {
- $('#playExternalButtonContainer', page).show();
- $('#playButtonContainer', page).hide();
- } else {
- $('#playButtonContainer', page).show();
- $('#playExternalButtonContainer', page).hide();
- }
-
- $('#btnPlayExternal', page).attr('href', url || '#');
-
- } else {
+ if (externalPlayUrl) {
+ $('#playExternalButtonContainer', page).show();
+ $('#playButtonContainer', page).hide();
+ }
+ else if (MediaController.canPlay(item)) {
+ $('#playButtonContainer', page).show();
+ $('#playExternalButtonContainer', page).hide();
+ }
+ else {
$('#playButtonContainer', page).hide();
$('#playExternalButtonContainer', page).hide();
}
@@ -124,6 +119,22 @@
$('#btnEdit', page).attr('href', "edititemmetadata.html?id=" + id);
}
+ function getExternalPlayUrl(item) {
+
+
+ if (item.GameSystem == "Nintendo" && item.MediaType == "Game" && item.ProviderIds.NesBox && item.ProviderIds.NesBoxRom) {
+
+ return "http://nesbox.com/game/" + item.ProviderIds.NesBox + '/rom/' + item.ProviderIds.NesBoxRom;
+ }
+
+ if (item.GameSystem == "Super Nintendo" && item.MediaType == "Game" && item.ProviderIds.NesBox && item.ProviderIds.NesBoxRom) {
+
+ return "http://snesbox.com/game/" + item.ProviderIds.NesBox + '/rom/' + item.ProviderIds.NesBoxRom;
+ }
+
+ return null;
+ };
+
function setPeopleHeader(page, item) {
if (item.Type == "Audio" || item.Type == "MusicAlbum" || item.MediaType == "Book" || item.MediaType == "Photo") {
@@ -1107,7 +1118,7 @@
attributes.push(createAttribute("Layout", stream.ChannelLayout));
}
else if (stream.Channels) {
- attributes.push(createAttribute("Channels", stream.Channels + ' ch'));
+ attributes.push(createAttribute("Channels", stream.Channels + ' ch'));
}
if (stream.BitRate && stream.Codec != "mjpeg") {
@@ -1138,7 +1149,7 @@
if (version.Path) {
html += '
Path' + version.Path + '';
}
-
+
return html;
}
@@ -1162,7 +1173,7 @@
var href = "itemdetails.html?id=" + item.Id;
- var onclick = item.PlayAccess == 'Full' ? ' onclick="MediaPlayer.playById(\'' + item.Id + '\'); return false;"' : "";
+ var onclick = item.PlayAccess == 'Full' ? ' onclick="MediaController.play(\'' + item.Id + '\'); return false;"' : "";
html += '
';
@@ -1286,7 +1297,10 @@
function play(startPosition) {
- MediaPlayer.play([currentItem], startPosition);
+ MediaController.play({
+ items: [currentItem],
+ startPositionTicks: startPosition
+ });
}
function splitVersions(page) {
@@ -1317,7 +1331,7 @@
ApiClient.getLocalTrailers(Dashboard.getCurrentUserId(), currentItem.Id).done(function (trailers) {
- MediaPlayer.play(trailers);
+ MediaController.play({ items: trailers });
});
}
@@ -1335,7 +1349,7 @@
mediaType = "Audio";
}
- LibraryBrowser.showPlayMenu(this, currentItem.Id, currentItem.Type, mediaType, userdata.PlaybackPositionTicks);
+ LibraryBrowser.showPlayMenu(this, currentItem.Id, currentItem.Type, currentItem.IsFolder, mediaType, userdata.PlaybackPositionTicks);
});
$('#btnPlayTrailer', page).on('click', function () {
@@ -1347,19 +1361,6 @@
ApiClient.markPlayed(Dashboard.getCurrentUserId(), currentItem.Id, new Date());
});
- $('#btnRemote', page).on('click', function () {
-
- RemoteControl.showMenuForItem({
-
- item: currentItem,
- context: getContext(currentItem),
-
- themeSongs: $('#themeSongsCollapsible:visible', page).length > 0,
-
- themeVideos: $('#themeVideosCollapsible:visible', page).length > 0
- });
- });
-
$('.btnSplitVersions', page).on('click', function () {
splitVersions(page);
diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js
index 91b3369f87..f4dd3911bd 100644
--- a/dashboard-ui/scripts/librarybrowser.js
+++ b/dashboard-ui/scripts/librarybrowser.js
@@ -211,7 +211,7 @@
html += '';
html += '';
- html += '';
+ html += '';
html += ' | ';
var num = item.IndexNumber;
@@ -287,12 +287,12 @@
return html;
},
- showPlayMenu: function (positionTo, itemId, itemType, mediaType, resumePositionTicks) {
+ showPlayMenu: function (positionTo, itemId, itemType, isFolder, mediaType, resumePositionTicks) {
var isPlaying = MediaPlayer.isPlaying();
- if (!isPlaying && !resumePositionTicks && mediaType != "Audio") {
- MediaPlayer.playById(itemId);
+ if (!isPlaying && !resumePositionTicks && mediaType != "Audio" && !isFolder) {
+ MediaController.play(itemId);
return;
}
@@ -303,38 +303,22 @@
html += '
';
html += '- Play Menu
';
- if (itemType == "MusicArtist") {
- html += '- Play
';
- } else if (itemType != "MusicGenre") {
- html += '- Play
';
+ html += '- Play
';
+
+ if (itemType == "Audio" || itemType == "MusicAlbum" || itemType == "MusicArtist" || itemType == "MusicGenre") {
+ html += '- Instant Mix
';
}
- if (itemType == "Audio") {
- html += '- Instant Mix
';
- }
- else if (itemType == "MusicAlbum") {
- html += '- Instant Mix
';
- html += '- Shuffle
';
- }
- else if (itemType == "MusicArtist") {
- html += '- Instant Mix
';
- html += '- Shuffle
';
- }
- else if (itemType == "MusicGenre") {
- html += '- Instant Mix
';
- html += '- Shuffle
';
+ if (isFolder || itemType == "MusicArtist" || itemType == "MusicGenre") {
+ html += '- Shuffle
';
}
if (resumePositionTicks) {
- html += '- Resume
';
+ html += '- Resume
';
}
- if (isPlaying) {
- if (itemType == "MusicArtist") {
- html += '- Queue
';
- } else if (itemType != "MusicGenre") {
- html += '- Queue
';
- }
+ if (MediaController.canQueueMediaType(mediaType)) {
+ html += '- Queue
';
}
html += '
';
diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js
index 23488ac7a2..5fab7b43cf 100644
--- a/dashboard-ui/scripts/librarylist.js
+++ b/dashboard-ui/scripts/librarylist.js
@@ -102,16 +102,16 @@
var buttonCount = 0;
- if (MediaPlayer.canPlay(item, currentUser)) {
+ if (MediaController.canPlay(item)) {
var resumePosition = (item.UserData || {}).PlaybackPositionTicks || 0;
- var onPlayClick = 'LibraryBrowser.showPlayMenu(this, \'' + item.Id + '\', \'' + item.Type + '\', \'' + item.MediaType + '\', ' + resumePosition + ');return false;';
+ var onPlayClick = 'LibraryBrowser.showPlayMenu(this, \'' + item.Id + '\', \'' + item.Type + '\', ' + item.IsFolder + ', \'' + item.MediaType + '\', ' + resumePosition + ');return false;';
html += '
';
buttonCount++;
if (item.MediaType == "Audio" || item.Type == "MusicAlbum") {
- html += '
';
+ html += '
';
buttonCount++;
}
}
@@ -126,10 +126,6 @@
buttonCount++;
}
- if (!isPortrait || buttonCount < 3) {
- html += '
';
- }
-
html += '