1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

completed tuner hosts

This commit is contained in:
Luke Pulverenti 2015-07-21 00:22:46 -04:00
parent 0e4e4da6c8
commit 68526e2c1d
13 changed files with 248 additions and 54 deletions

View file

@ -19,9 +19,10 @@
<a href="syncsettings.html" data-role="button">${TabSettings}</a> <a href="syncsettings.html" data-role="button">${TabSettings}</a>
</div> </div>
<div data-role="controlgroup" data-type="horizontal" class="localnav livetvTabs" data-mini="true" style="display:none;"> <div data-role="controlgroup" data-type="horizontal" class="localnav livetvTabs" data-mini="true" style="display:none;">
<a href="livetvstatus.html" data-role="button">${TabStatus}</a> <a href="livetvstatus.html" data-role="button">${TabTuners}</a>
<a href="#" data-role="button" class="ui-btn-active">${TabServices}</a> <a href="#" data-role="button">${TabGuide}</a>
<a href="livetvsettings.html" data-role="button">${TabSettings}</a> <a href="livetvsettings.html" data-role="button">${TabSettings}</a>
<a href="#" data-role="button" class="ui-btn-active">${TabExternalServices}</a>
</div> </div>
<div data-role="controlgroup" data-type="horizontal" class="localnav notificationsTabs" data-mini="true" style="display:none;"> <div data-role="controlgroup" data-type="horizontal" class="localnav notificationsTabs" data-mini="true" style="display:none;">

View file

@ -18,9 +18,11 @@
</div> </div>
<div class="sectionTabs livetvSectionTabs" style="display:none;"> <div class="sectionTabs livetvSectionTabs" style="display:none;">
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true"> <div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="livetvstatus.html" data-role="button">${TabStatus}</a>
<a href="#" data-role="button" class="ui-btn-active">${TabServices}</a> <a href="livetvstatus.html" data-role="button">${TabTuners}</a>
<a href="#" data-role="button">${TabGuide}</a>
<a href="livetvsettings.html" data-role="button">${TabSettings}</a> <a href="livetvsettings.html" data-role="button">${TabSettings}</a>
<a href="#" data-role="button" class="ui-btn-active">${TabExternalServices}</a>
</div> </div>
</div> </div>

View file

@ -23,14 +23,14 @@
"web-component-tester": "*" "web-component-tester": "*"
}, },
"private": true, "private": true,
"homepage": "https://github.com/polymer/polymer", "homepage": "https://github.com/Polymer/polymer",
"_release": "1.0.7", "_release": "1.0.7",
"_resolution": { "_resolution": {
"type": "version", "type": "version",
"tag": "v1.0.7", "tag": "v1.0.7",
"commit": "b39d0015ce5428232409eb3aca7ddefea899f894" "commit": "b39d0015ce5428232409eb3aca7ddefea899f894"
}, },
"_source": "git://github.com/polymer/polymer.git", "_source": "git://github.com/Polymer/polymer.git",
"_target": "^1.0.0", "_target": "^1.0.0",
"_originalSource": "polymer/polymer" "_originalSource": "Polymer/polymer"
} }

View file

@ -7,6 +7,33 @@
// showCancel // showCancel
// title // title
// If any items have an icon, give them all an icon just to make sure they're all lined up evenly
var renderIcon = options.items.filter(function (o) {
return o.ironIcon;
}).length;
if (renderIcon) {
// iOS supports unicode icons
if ($.browser.safari) {
for (var i = 0, length = options.items.length; i < length; i++) {
var option = options.items[i];
switch (option.ironIcon) {
case 'check':
option.name = '\\u2713 ' + option.name;
break;
default:
option.name = '\\u2001 ' + option.name;
break;
}
}
}
}
var innerOptions = { var innerOptions = {
'title': options.title, 'title': options.title,
'buttonLabels': options.items.map(function (i) { 'buttonLabels': options.items.map(function (i) {
@ -27,7 +54,7 @@
// Results are 1-based // Results are 1-based
if (index >= 1 && options.items.length >= index) { if (index >= 1 && options.items.length >= index) {
options.callback(options.items[index - 1].id); options.callback(options.items[index - 1].id);
} }
} }

View file

@ -153,7 +153,7 @@
@media all and (min-width: 1920px) { @media all and (min-width: 1920px) {
.ehsContent { .ehsContent {
width: 97%; width: 96%;
} }
} }

View file

@ -10,9 +10,10 @@
<div class="content-primary"> <div class="content-primary">
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true"> <div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="livetvstatus.html" data-role="button">${TabStatus}</a> <a href="livetvstatus.html" data-role="button">${TabTuners}</a>
<a href="appservices.html?context=livetv" data-role="button">${TabServices}</a> <a href="#" data-role="button">${TabGuide}</a>
<a href="#" data-role="button" class="ui-btn-active">${TabSettings}</a> <a href="#" data-role="button" class="ui-btn-active">${TabSettings}</a>
<a href="appservices.html?context=livetv" data-role="button">${TabExternalServices}</a>
</div> </div>
<form class="liveTvSettingsForm" style="display: none;"> <form class="liveTvSettingsForm" style="display: none;">
@ -36,7 +37,7 @@
<option value="12">12</option> <option value="12">12</option>
<option value="13">13</option> <option value="13">13</option>
<option value="14">14</option> <option value="14">14</option>
</select> </select>
<div class="fieldDescription">${LabelNumberOfGuideDaysHelp}</div> <div class="fieldDescription">${LabelNumberOfGuideDaysHelp}</div>
</li> </li>
</ul> </ul>

View file

@ -10,28 +10,24 @@
<div class="content-primary"> <div class="content-primary">
<div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true"> <div data-role="controlgroup" data-type="horizontal" class="localnav" data-mini="true">
<a href="#" data-role="button" class="ui-btn-active">${TabStatus}</a> <a href="#" data-role="button" class="ui-btn-active">${TabTuners}</a>
<a href="appservices.html?context=livetv" data-role="button">${TabServices}</a> <a href="#" data-role="button">${TabGuide}</a>
<a href="livetvsettings.html" data-role="button">${TabSettings}</a> <a href="livetvsettings.html" data-role="button">${TabSettings}</a>
<a href="appservices.html?context=livetv" data-role="button">${TabExternalServices}</a>
</div> </div>
<div class="readOnlyContent" style="margin-top: 2em;"> <div class="readOnlyContent" style="margin-top: 2em;">
<div class="liveTvStatusContent" style="display: none;"> <div class="liveTvStatusContent" style="display: none;">
<h2>${HeaderServices}</h2> <h1>${HeaderTunerDevices}</h1>
<div class="servicesList"> <paper-button raised class="submit btnAddDevice block"><iron-icon icon="add"></iron-icon><span>${ButtonAddDevice}</span></paper-button>
</div> <div class="devicesList">
<br />
<div class="refreshGuidePanel">
<button type="button" class="btnRefreshGuide" data-icon="refresh" data-mini="true">${ButtonRefreshGuideData}</button>
<progress max="100" min="0" style="width: 100%;" class="refreshGuideProgress"></progress>
<div style="margin-top: 5px;">${LabelLastResult} <span class="lastRefreshGuideResult"></span></div>
</div> </div>
<br /> <br />
<h2>${HeaderTvTuners}</h2> <br />
<h1>${HeaderTvTuners}</h1>
<table data-role="table" data-mode="reflow" class="tblTuners stripedTable ui-responsive table-stroke"> <table data-role="table" data-mode="reflow" class="tblTuners stripedTable ui-responsive table-stroke">
<thead> <thead>
@ -48,12 +44,45 @@
</table> </table>
</div> </div>
<div class="servicesSection" style="display:none;">
<br />
<br />
<h1>${HeaderExternalServices}</h1>
<div class="servicesList">
</div>
</div>
<div class="noLiveTvServices" style="display: none;"> <div class="noLiveTvServices" style="display: none;">
<p>${LiveTvPluginRequired}</p> <p>${LiveTvPluginRequired}</p>
<p><a href="plugincatalog.html">${LiveTvPluginRequiredHelp}</a></p> <p><a href="plugincatalog.html">${LiveTvPluginRequiredHelp}</a></p>
</div> </div>
<paper-dialog class="dlgAddDevice" entry-animation="fade-in-animation" exit-animation="fade-out-animation" style="height:300px;width:250px;" with-backdrop>
<h2>${HeaderAddDevice}</h2>
<form class="formAddDevice">
<div>
<div>
<label for="selectTunerDeviceType">${LabelType}</label>
<select id="selectTunerDeviceType" data-mini="true">
<option value="hdhomerun">HD Homerun</option>
<option value="m3u">M3U</option>
</select>
</div>
<div>
<br />
<label for="txtDevicePath">${LabelIpAddressPath}</label>
<input type="text" id="txtDevicePath" required="required" />
</div>
</div>
<div class="buttons">
<paper-button dialog-dismiss>${ButtonCancel}</paper-button>
<button data-role="none" type="submit" class="clearButton"><paper-button><span>${ButtonOk}</span></paper-button></button>
</div>
</form>
</paper-dialog>
</div> </div>
</div> </div>
</div> </div>

View file

@ -81,7 +81,6 @@
var context = getParameterByName('context'); var context = getParameterByName('context');
$('.sectionTabs', page).hide(); $('.sectionTabs', page).hide();
$('.' + context + 'SectionTabs', page).show();
if (context == 'sync') { if (context == 'sync') {
Dashboard.setPageTitle(Globalize.translate('TitleSync')); Dashboard.setPageTitle(Globalize.translate('TitleSync'));
@ -96,6 +95,17 @@
page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Notifications'); page.setAttribute('data-helpurl', 'https://github.com/MediaBrowser/Wiki/wiki/Notifications');
} }
}).on('pagebeforeshowready', "#appServicesPage", function () {
// This needs both events for the helpurl to get done at the right time
var page = this;
var context = getParameterByName('context');
$('.sectionTabs', page).hide();
$('.' + context + 'SectionTabs', page).show();
}).on('pageshowready', "#appServicesPage", function () { }).on('pageshowready', "#appServicesPage", function () {
// This needs both events for the helpurl to get done at the right time // This needs both events for the helpurl to get done at the right time

View file

@ -150,7 +150,19 @@
$('.noLiveTvServices', page).show(); $('.noLiveTvServices', page).show();
} }
$('.servicesList', page).html(liveTvInfo.Services.map(getServiceHtml).join('')).trigger('create'); var servicesToDisplay = liveTvInfo.Services.filter(function (s) {
return s.IsVisible;
});
if (servicesToDisplay.length) {
$('.servicesSection', page).show();
} else {
$('.servicesSection', page).hide();
}
$('.servicesList', page).html(servicesToDisplay.map(getServiceHtml).join('')).trigger('create');
var tuners = []; var tuners = [];
for (var i = 0, length = liveTvInfo.Services.length; i < length; i++) { for (var i = 0, length = liveTvInfo.Services.length; i < length; i++) {
@ -162,9 +174,83 @@
renderTuners(page, tuners); renderTuners(page, tuners);
ApiClient.getNamedConfiguration("livetv").done(function (config) {
renderDevices(page, config.TunerHosts);
});
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
} }
function renderDevices(page, devices) {
var html = '';
html += '<ul data-role="listview" data-inset="true" data-split-icon="delete">';
for (var i = 0, length = devices.length; i < length; i++) {
var device = devices[i];
html += '<li>';
html += '<a href="#">';
html += '<h3>';
if (device.Type == 'm3u') {
html += "M3U";
}
else if (device.Type == 'hdhomerun') {
html += "HD Homerun";
} else {
html += device.Type;
}
html += '</h3>';
html += '<p>';
html += device.Url;
html += '</p>';
html += '</a>';
html += '<a href="#" class="btnDeleteDevice">';
html += '</a>';
html += '</li>';
}
html += '</ul>';
var elem = $('.devicesList', page).html(html).trigger('create');
$('.btnDeleteDevice', elem).on('click', function () {
var id = this.getAttribute('data-id');
deleteDevice(page, id);
});
}
function deleteDevice(page, id) {
var message = Globalize.translate('MessageConfirmDeleteTunerDevice');
Dashboard.confirm(message, Globalize.translate('HeaderDeleteDevice'), function (confirmResult) {
if (confirmResult) {
Dashboard.showLoadingMsg();
ApiClient.ajax({
type: "DELETE",
url: ApiClient.getUrl('LiveTv/TunerHosts', {
Id: id
})
}).done(function () {
reload(page);
});
}
});
}
function reload(page) { function reload(page) {
Dashboard.showLoadingMsg(); Dashboard.showLoadingMsg();
@ -176,29 +262,45 @@
}); });
} }
$(document).on('pageshowready', "#liveTvStatusPage", function () { function submitAddDeviceForm(page) {
page.querySelector('.dlgAddDevice').close();
Dashboard.showLoadingMsg();
ApiClient.ajax({
type: "POST",
url: ApiClient.getUrl('LiveTv/TunerHosts'),
data: JSON.stringify({
Type: $('#selectTunerDeviceType', page).val(),
Url: $('#txtDevicePath', page).val()
}),
contentType: "application/json"
}).done(function () {
reload(page);
});
}
$(document).on('pageinitdepends', "#liveTvStatusPage", function () {
var page = this;
$('.btnAddDevice', page).on('click', function () {
page.querySelector('.dlgAddDevice').open();
});
$('.dlgAddDevice', page).on('submit', function () {
submitAddDeviceForm(page);
return false;
});
}).on('pageshowready', "#liveTvStatusPage", function () {
var page = this; var page = this;
reload(page); reload(page);
// on here
$('.btnRefreshGuide', page).taskButton({
mode: 'on',
progressElem: $('.refreshGuideProgress', page),
lastResultElem: $('.lastRefreshGuideResult', page),
taskKey: 'RefreshGuide'
});
}).on('pagebeforehide', "#liveTvStatusPage", function () {
var page = this;
// off here
$('.btnRefreshGuide', page).taskButton({
mode: 'off'
});
}); });
})(jQuery, document, window); })(jQuery, document, window);

View file

@ -58,6 +58,7 @@
options.push({ name: '1080p - 8Mbps', maxHeight: 1080, bitrate: 8000001 }); options.push({ name: '1080p - 8Mbps', maxHeight: 1080, bitrate: 8000001 });
options.push({ name: '1080p - 6Mbps', maxHeight: 1080, bitrate: 6000001 }); options.push({ name: '1080p - 6Mbps', maxHeight: 1080, bitrate: 6000001 });
options.push({ name: '1080p - 5Mbps', maxHeight: 1080, bitrate: 5000001 }); options.push({ name: '1080p - 5Mbps', maxHeight: 1080, bitrate: 5000001 });
options.push({ name: '1080p - 4Mbps', maxHeight: 1080, bitrate: 4000002 });
} else if (maxAllowedWidth >= 1260) { } else if (maxAllowedWidth >= 1260) {
options.push({ name: '720p - 10Mbps', maxHeight: 720, bitrate: 10000000 }); options.push({ name: '720p - 10Mbps', maxHeight: 720, bitrate: 10000000 });
@ -119,14 +120,22 @@
})[0].maxHeight; })[0].maxHeight;
} }
var isVlc = AppInfo.isNativeApp && $.browser.android;
var bitrateSetting = AppSettings.maxStreamingBitrate(); var bitrateSetting = AppSettings.maxStreamingBitrate();
if (isVlc) {
// Work around vlc 1080p stutter for now
if ((maxHeight || 1080) >= 1080) {
bitrateSetting = Math.min(bitrateSetting, 4000002);
}
}
var canPlayWebm = self.canPlayWebm(); var canPlayWebm = self.canPlayWebm();
var profile = {}; var profile = {};
profile.MaxStreamingBitrate = bitrateSetting; profile.MaxStreamingBitrate = bitrateSetting;
profile.MaxStaticBitrate = 40000000; profile.MaxStaticBitrate = 4000000;
profile.MusicStreamingTranscodingBitrate = Math.min(bitrateSetting, 192000); profile.MusicStreamingTranscodingBitrate = Math.min(bitrateSetting, 192000);
profile.DirectPlayProfiles = []; profile.DirectPlayProfiles = [];
@ -303,8 +312,6 @@
}] }]
}); });
var isVlc = AppInfo.isNativeApp && $.browser.android;
if (!isVlc) { if (!isVlc) {
profile.CodecProfiles.push({ profile.CodecProfiles.push({
Type: 'VideoAudio', Type: 'VideoAudio',

View file

@ -29,7 +29,7 @@
}); });
} }
function getPluginCardHtml(plugin, pluginConfigurationPages) { function getPluginCardHtml(plugin, getTextLinesCallback, pluginConfigurationPages) {
var configPage = $.grep(pluginConfigurationPages, function (pluginConfigurationPage) { var configPage = $.grep(pluginConfigurationPages, function (pluginConfigurationPage) {
return pluginConfigurationPage.PluginId == plugin.Id; return pluginConfigurationPage.PluginId == plugin.Id;
@ -96,6 +96,10 @@
html += plugin.Version; html += plugin.Version;
html += "</div>"; html += "</div>";
if (getTextLinesCallback) {
html += getTextLinesCallback(plugin);
}
// cardFooter // cardFooter
html += "</div>"; html += "</div>";
@ -108,16 +112,16 @@
return html; return html;
} }
function renderPlugins(page, plugins) { function renderPlugins(page, plugins, getTextLinesCallback) {
ApiClient.getJSON(ApiClient.getUrl("dashboard/configurationpages") + "?pageType=PluginConfiguration").done(function (configPages) { ApiClient.getJSON(ApiClient.getUrl("dashboard/configurationpages") + "?pageType=PluginConfiguration").done(function (configPages) {
populateList(page, plugins, configPages); populateList(page, plugins, getTextLinesCallback, configPages);
}); });
} }
function populateList(page, plugins, pluginConfigurationPages) { function populateList(page, plugins, getTextLinesCallback, pluginConfigurationPages) {
plugins = plugins.sort(function (plugin1, plugin2) { plugins = plugins.sort(function (plugin1, plugin2) {
@ -126,7 +130,7 @@
}); });
var html = plugins.map(function (p) { var html = plugins.map(function (p) {
return getPluginCardHtml(p, pluginConfigurationPages); return getPluginCardHtml(p, getTextLinesCallback, pluginConfigurationPages);
}).join(''); }).join('');
@ -187,7 +191,7 @@
ActionSheetElement.show({ ActionSheetElement.show({
items: menuItems, items: menuItems,
positionTo: card, positionTo: elem,
callback: function (resultId) { callback: function (resultId) {
switch (resultId) { switch (resultId) {

View file

@ -66,6 +66,15 @@ html, body, .ui-btn, .pageTitle {
color: #FF2D55 !important; color: #FF2D55 !important;
} }
.channelTimeslotHeader {
border-right-color: #FF2D55 !important;
}
.channelTimeslotHeader, .timeslotHeader {
background: #FF2D55 !important;
}
.libraryViewNav { .libraryViewNav {
border-top: 1px solid #333 !important; border-top: 1px solid #333 !important;
} }

View file

@ -149,6 +149,8 @@ paper-button .fa {
color: inherit; color: inherit;
width: 100%; width: 100%;
vertical-align: middle; vertical-align: middle;
font-family: inherit;
font-weight: inherit;
} }
.clearLink { .clearLink {