added cast icon to now playing bar to send current media to another client

This commit is contained in:
Luke Pulverenti 2014-01-03 23:53:49 -05:00
parent 1b1feb66cc
commit d994150c28
14 changed files with 87 additions and 114 deletions

View File

@ -99,4 +99,11 @@
/* Fallback */
.ui-nosvg .ui-icon-tv:after {
background-image: url("images/icons/tv.png");
}
.ui-icon-wireless:after {
background-image: url("images/icons/wireless.png");
}
/* Fallback */
.ui-nosvg .ui-icon-wireless:after {
background-image: url("images/icons/wireless.png");
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 345 B

View File

@ -102,10 +102,4 @@
#remoteControlFlyout {
width: 550px;
}
}
@media all and (min-width: 700px) {
#remoteControlFlyout {
width: 650px;
}
}
}

View File

@ -9,7 +9,7 @@
<div class="libraryViewNav">
<a href="moviesrecommended.html">Suggested</a>
<a href="movies.html">Movies</a>
<a href="boxsets.html">Collections</a>
<a href="boxsets.html">Box Sets</a>
<a href="movietrailers.html">Trailers</a>
<a href="moviegenres.html" class="ui-btn-active">Genres</a>
<a href="moviepeople.html">People</a>
@ -20,7 +20,7 @@
<div class="libraryViewNav">
<a href="moviesrecommended.html">Suggested</a>
<a href="movies.html">Movies</a>
<a href="boxsets.html">Collections</a>
<a href="boxsets.html">Box Sets</a>
<a href="movietrailers.html">Trailers</a>
<a href="moviegenres.html">Genres</a>
<a href="moviepeople.html" class="ui-btn-active">People</a>
@ -31,7 +31,7 @@
<div class="libraryViewNav">
<a href="moviesrecommended.html">Suggested</a>
<a href="movies.html">Movies</a>
<a href="boxsets.html">Collections</a>
<a href="boxsets.html">Box Sets</a>
<a href="movietrailers.html">Trailers</a>
<a href="moviegenres.html">Genres</a>
<a href="moviepeople.html">People</a>
@ -149,7 +149,7 @@
<button id="btnRemote" type="button" data-icon="remote" data-inline="true" data-mini="true">Remote</button>
</span>
<span id="editButtonContainer" style="display: none;">
<button id="btnEdit" type="button" data-icon="edit" data-inline="true" data-mini="true">Edit</button>
<a id="btnEdit" data-role="button" data-icon="edit" data-inline="true" data-mini="true" href="#">Edit</a>
</span>
</div>
<div data-role="content">

View File

@ -148,7 +148,7 @@
<button id="btnRemote" type="button" data-icon="remote" data-inline="true" data-mini="true">Remote</button>
</span>
<span id="editButtonContainer" style="display: none;">
<button id="btnEdit" type="button" data-icon="edit" data-inline="true" data-mini="true">Edit</button>
<a id="btnEdit" data-role="button" data-icon="edit" data-inline="true" data-mini="true" href="#">Edit</a>
</span>
</div>
<div data-role="content">

View File

@ -98,9 +98,6 @@
Cancel
</button>
</div>
<p style="border-top: 1px solid #444; padding-top: .5em; margin-top: 2em;">
<button id="btnCancelTimer" type="button" data-mini="true" data-icon="delete">Cancel Series</button>
</p>
</form>
</div>
<script type="text/javascript">

View File

@ -72,7 +72,7 @@
</button>
</li>
</ul>
<p style="border-top: 1px solid #444; padding-top: .5em; margin-top: 2em;">
<p style="border-top: 1px solid #444; padding-top: .5em; margin-top: 3em;">
<button id="btnCancelTimer" type="button" data-mini="true" data-icon="delete">Cancel Recording</button>
</p>
</form>

View File

@ -59,8 +59,6 @@
var name = item.Name;
$('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item));
Dashboard.setPageTitle(name);
$('.itemName', page).html(name);
@ -89,6 +87,9 @@
Dashboard.getCurrentUser().done(function (user) {
var editImagesHref = user.Configuration.IsAdministrator ? 'edititemimages.html' + window.location.search : null;
$('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item, editImagesHref));
if (user.Configuration.IsAdministrator && item.LocationType !== "Offline") {
$('#editButtonContainer', page).show();
} else {
@ -524,17 +525,14 @@
RemoteControl.showMenuForItem({ item: currentItem, context: getParameterByName('context') || '' });
});
$('#btnEdit', page).on('click', function () {
Dashboard.navigate("edititemmetadata.html", true);
});
}).on('pageshow', "#itemByNameDetailPage", function () {
var page = this;
reload(page);
$('#btnEdit', page).attr('href', 'edititemmetadata.html' + window.location.search);
}).on('pagehide', "#itemByNameDetailPage", function () {
currentItem = null;

View File

@ -94,6 +94,10 @@
Dashboard.hideLoadingMsg();
});
$('#btnEdit', page).attr('href', "edititemmetadata.html?id=" + id);
}
function setPeopleHeader(page, item) {
@ -1112,11 +1116,6 @@
ApiClient.markPlayed(Dashboard.getCurrentUserId(), currentItem.Id, new Date());
});
$('#btnEdit', page).on('click', function () {
Dashboard.navigate("edititemmetadata.html?id=" + currentItem.Id);
});
$('#btnRemote', page).on('click', function () {
RemoteControl.showMenuForItem({

View File

@ -2,25 +2,6 @@
var currentItem;
function deleteTimer(page, id) {
Dashboard.confirm("Are you sure you wish to cancel this series?", "Confirm Series Cancellation", function (result) {
if (result) {
Dashboard.showLoadingMsg();
ApiClient.cancelLiveTvSeriesTimer(id).done(function () {
Dashboard.alert('Series cancelled.');
reload(page);
});
}
});
}
function renderTimer(page, item) {
currentItem = item;
@ -131,17 +112,7 @@
});
}
$(document).on('pageinit', "#liveTvSeriesTimerPage", function () {
var page = this;
$('#btnCancelTimer', page).on('click', function () {
deleteTimer(page, currentItem.Id);
});
}).on('pagebeforeshow', "#liveTvSeriesTimerPage", function () {
$(document).on('pagebeforeshow', "#liveTvSeriesTimerPage", function () {
var page = this;

View File

@ -1,6 +1,6 @@
(function ($, document, apiClient) {
function deleteTimer(page, id) {
function deleteSeriesTimer(page, id) {
Dashboard.confirm("Are you sure you wish to cancel this series?", "Confirm Series Cancellation", function (result) {
@ -23,7 +23,7 @@
var html = '';
html += '<ul data-role="listview" data-inset="true">';
html += '<ul data-role="listview" data-inset="true" data-split-icon="delete">';
html += '<li data-role="list-divider">Series Recordings</li>';
@ -46,7 +46,7 @@
html += days.join(', ');
}
if (timer.RecordAnyTime) {
html += ' - Any time.';
@ -63,13 +63,22 @@
html += timer.ChannelName;
}
html += '</p>';
html += '</a>';
html += '<a data-seriestimerid="' + timer.Id + '" href="#" title="Cancel Series" class="btnCancelSeries">Cancel Series</a>';
html += '</li>';
}
html += '</ul>';
$('#items', page).html(html).trigger('create');
var elem = $('#items', page).html(html).trigger('create');
$('.btnCancelSeries', elem).on('click', function() {
deleteSeriesTimer(page, this.getAttribute('data-seriestimerid'));
});
Dashboard.hideLoadingMsg();
}

View File

@ -24,7 +24,24 @@
self.playlist = [];
var currentPlaylistIndex = 0;
var channelsList;
var channelsListPromise;
var channelsListPromiseTime;
function getChannelsListPromise() {
var lastUpdateTime = channelsListPromiseTime || 0;
// Update every three minutes
if (!channelsListPromise || !lastUpdateTime || (new Date().getTime() - lastUpdateTime) > 10800000) {
channelsListPromise = ApiClient.getLiveTvChannels({
userId: Dashboard.getCurrentUserId()
});
}
return channelsListPromise;
}
function requestFullScreen(element) {
// Supports most browsers and their versions.
@ -655,21 +672,12 @@
currentItem = item;
curentDurationTicks = item.RunTimeTicks;
if (!channelsList) {
getChannelsListPromise().done(function (result) {
ApiClient.getLiveTvChannels({
userId: Dashboard.getCurrentUserId()
}).done(function (result) {
channelsList = result.Items;
if (result.Items.length) {
channelsButton.show();
}
});
}
if (result.Items.length) {
channelsButton.show();
}
});
return videoElement[0];
};
@ -1734,11 +1742,14 @@
var flyout = $('#channelsFlyout');
var channels = channelsList || [];
showFlyout(flyout, '#channelsButton');
if (!flyout.is(':visible')) {
getChannelsListPromise().done(function (result) {
flyout.html(getChannelsFlyoutHtml(channels)).scrollTop(0);
showFlyout(flyout, '#channelsButton');
flyout.html(getChannelsFlyoutHtml(result.Items)).scrollTop(0);
});
}
};
self.showAudioTracksFlyout = function () {
@ -1799,6 +1810,14 @@
}
};
self.showSendMediaMenu = function () {
RemoteControl.showMenuForItem({
item: currentItem
});
};
}
window.MediaPlayer = new mediaPlayer();

View File

@ -66,6 +66,8 @@
var html = '<div data-role="popup" id="remoteControlFlyout" data-theme="a">';
html += '<a href="#" data-rel="back" data-role="button" data-icon="delete" data-iconpos="notext" class="ui-btn-right" data-theme="b">Close</a>';
html += '<div class="ui-bar-b" style="text-align:center;">';
html += '<div style="margin:.5em 0;">Remote Control</div>';
html += '</div>';
@ -90,8 +92,6 @@
html += '<span id="browseButtonContainer" style="display:none;"><button onclick="$(\'#fldPlayCommand\').val(\'Browse\');" type="submit" data-icon="eye" data-mini="true" data-inline="true">Browse</button></span>';
html += '<button type="button" data-icon="delete" onclick="$(\'#remoteControlFlyout\').popup(\'close\');" data-mini="true" data-inline="true">Cancel</button>';
html += '</p>';
html += '</form></div>';
@ -385,6 +385,7 @@
function renderPlayFromOptions(elem, item) {
var html = '';
var html = '';
html += '<h4 style="margin: 1em 0 .5em;">Play from scene</h4>';
@ -498,11 +499,7 @@
html += '<thead><tr>';
html += '<th></th>';
html += '<th>Client</th>';
html += '<th>Device</th>';
html += '<th>User</th>';
html += '<th class="nowPlayingCell">Now Playing</th>';
html += '<th class="nowPlayingCell">Time</th>';
html += '</tr></thead>';
html += '<tbody>';
@ -514,32 +511,12 @@
html += '<tr class="trSession" data-queue="' + session.QueueableMediaTypes.join(',') + '" data-sessionid="' + session.Id + '">';
html += '<td class="tdSelectSession"></td>';
html += '<td>' + session.Client + '</td>';
html += '<td>' + session.DeviceName + '</td>';
html += '<td>' + session.DeviceName;
html += '<td class="tdUserName">';
html += session.UserName || '';
html += '</td>';
if (session.NowPlayingItem) {
html += '<td class="nowPlayingCell tdNowPlayingName">';
html += session.NowPlayingItem ? session.NowPlayingItem.Name : '';
html += '</td>';
html += '<td class="nowPlayingCell tdNowPlayingTime">';
html += getSessionNowPlayingTime(session);
html += '</td>';
} else {
html += '<td class="nowPlayingCell"></td>';
html += '<td class="nowPlayingCell"></td>';
if (session.UserName) {
html += ' - ' + session.UserName;
}
html += '</td>';
html += '</tr>';
}
@ -553,7 +530,7 @@
elem.html(html).trigger('create');
$('.tdSelectSession', elem).html('<input type="radio" class="chkClient" name="chkClient" />');
$('.chkClient:first', elem).checked(true);
$('#remoteControlFlyout').popup("reposition", { tolerance: 0 });
@ -986,7 +963,7 @@
function renderSessionsInControlMenu(popup, sessions, options) {
options = options || {};
var deviceId = ApiClient.deviceId();
// don't display the current session
@ -1020,7 +997,7 @@
var session = sessions[i];
var text = session.Client + ' - ' + session.DeviceName;
var text = session.DeviceName;
if (session.UserName) {
text += ' - ' + session.UserName;

View File

@ -1354,6 +1354,8 @@ $(function () {
footerHtml += '<button onclick="MediaPlayer.toggleFullscreen();" id="fullscreenButton" class="mediaButton fullscreenButton" title="Fullscreen" type="button" data-icon="action" data-iconpos="notext" data-inline="true">Fullscreen</button>';
footerHtml += '<button onclick="MediaPlayer.showSendMediaMenu();" id="sendMediaButton" class="mediaButton sendMediaButton" title="Cast" type="button" data-icon="wireless" data-iconpos="notext" data-inline="true">Cast</button>';
footerHtml += '</div>';
footerHtml += '<div id="footerNotifications"></div>';