From 85a11e81cffddc2f597fb3dbb9c31ffae5ef684e Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 19 Sep 2016 11:41:35 -0400 Subject: [PATCH] always supply SeriesTimerId --- .../cardbuilder/cardbuilder.js | 48 +++- .../emby-itemscontainer.js | 69 ++++- .../emby-toggle/emby-toggle.css | 17 ++ .../emby-webcomponents/guide/guide.js | 6 +- .../indicators/indicators.js | 4 +- .../emby-webcomponents/itemcontextmenu.js | 2 +- .../recordingcreator/recordingfields.js | 242 ++++++++++++++++++ .../recordingfields.template.html | 27 ++ .../recordingcreator/recordinghelper.js | 67 +++++ .../emby-webcomponents/shortcuts.js | 68 +---- .../subtitleeditor.template.html | 2 +- dashboard-ui/css/site.css | 8 + dashboard-ui/scripts/htmlmediarenderer.js | 15 +- dashboard-ui/scripts/mediaplayer-video.js | 5 +- dashboard-ui/scripts/mediaplayer.js | 4 +- dashboard-ui/scripts/site.js | 2 + 16 files changed, 499 insertions(+), 87 deletions(-) create mode 100644 dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.js create mode 100644 dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.template.html create mode 100644 dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordinghelper.js diff --git a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js index ac2e9edc10..ff6d52dfcd 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js +++ b/dashboard-ui/bower_components/emby-webcomponents/cardbuilder/cardbuilder.js @@ -1421,10 +1421,56 @@ define(['datetime', 'imageLoader', 'connectionManager', 'itemHelper', 'mediaInfo } } + function onTimerCreated(programId, newTimerId, itemsContainer) { + + var cells = itemsContainer.querySelectorAll('.card[data-id="' + programId + '"]'); + + for (var i = 0, length = cells.length; i < length; i++) { + var cell = cells[i]; + var icon = cell.querySelector('.timerIndicator'); + if (!icon) { + var indicatorsElem = ensureIndicators(cell); + indicatorsElem.insertAdjacentHTML('beforeend', ''); + } + cell.setAttribute('data-timerid', newTimerId); + } + } + + function onTimerCancelled(id, itemsContainer) { + + var cells = itemsContainer.querySelectorAll('.card[data-timerid="' + id + '"]'); + + for (var i = 0, length = cells.length; i < length; i++) { + var cell = cells[i]; + var icon = cell.querySelector('.timerIndicator'); + if (icon) { + icon.parentNode.removeChild(icon); + } + cell.removeAttribute('data-timerid'); + } + } + + function onSeriesTimerCancelled(id, itemsContainer) { + + var cells = itemsContainer.querySelectorAll('.card[data-seriestimerid="' + id + '"]'); + + for (var i = 0, length = cells.length; i < length; i++) { + var cell = cells[i]; + var icon = cell.querySelector('.timerIndicator'); + if (icon) { + icon.parentNode.removeChild(icon); + } + cell.removeAttribute('data-seriestimerid'); + } + } + return { getCardsHtml: getCardsHtml, buildCards: buildCards, onUserDataChanged: onUserDataChanged, - getDefaultColorClass: getDefaultColorClass + getDefaultColorClass: getDefaultColorClass, + onTimerCreated: onTimerCreated, + onTimerCancelled: onTimerCancelled, + onSeriesTimerCancelled: onSeriesTimerCancelled }; }); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/emby-itemscontainer/emby-itemscontainer.js b/dashboard-ui/bower_components/emby-webcomponents/emby-itemscontainer/emby-itemscontainer.js index 1f2c80f0dd..49cf07ee05 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/emby-itemscontainer/emby-itemscontainer.js +++ b/dashboard-ui/bower_components/emby-webcomponents/emby-itemscontainer/emby-itemscontainer.js @@ -183,6 +183,57 @@ }); } + function onTimerCreated(e, apiClient, data) { + + var itemsContainer = this; + + var programId = data.ProgramId; + // This could be null, not supported by all tv providers + var newTimerId = data.Id; + + require(['cardBuilder'], function (cardBuilder) { + cardBuilder.onTimerCreated(programId, newTimerId, itemsContainer); + }); + } + + function onSeriesTimerCreated(e, apiClient, data) { + var itemsContainer = this; + } + + function onTimerCancelled(e, apiClient, data) { + var itemsContainer = this; + var id = data.Id; + + require(['cardBuilder'], function (cardBuilder) { + cardBuilder.onTimerCancelled(id, itemsContainer); + }); + } + + function onSeriesTimerCancelled(e, apiClient, data) { + var itemsContainer = this; + var id = data.Id; + + require(['cardBuilder'], function (cardBuilder) { + cardBuilder.onSeriesTimerCancelled(id, itemsContainer); + }); + } + + function addNotificationEvent(instance, name, handler) { + + var localHandler = handler.bind(instance); + events.on(serverNotifications, name, localHandler); + instance[name] = localHandler; + } + + function removeNotificationEvent(instance, name) { + + var handler = instance[name]; + if (handler) { + events.off(serverNotifications, 'UserDataChanged', handler); + instance[name] = null; + } + } + ItemsContainerProtoType.attachedCallback = function () { this.addEventListener('click', onClick); @@ -203,9 +254,11 @@ itemShortcuts.on(this, getShortcutOptions()); - var userDataHandler = onUserDataChanged.bind(this); - events.on(serverNotifications, 'UserDataChanged', userDataHandler); - this.userDataHandler = userDataHandler; + addNotificationEvent(this, 'UserDataChanged', onUserDataChanged); + addNotificationEvent(this, 'TimerCreated', onTimerCreated); + addNotificationEvent(this, 'SeriesTimerCreated', onSeriesTimerCreated); + addNotificationEvent(this, 'TimerCancelled', onTimerCancelled); + addNotificationEvent(this, 'SeriesTimerCancelled', onSeriesTimerCancelled); }; ItemsContainerProtoType.detachedCallback = function () { @@ -218,11 +271,11 @@ this.removeEventListener('contextmenu', disableEvent); itemShortcuts.off(this, getShortcutOptions()); - var userDataHandler = this.userDataHandler; - if (userDataHandler) { - events.off(serverNotifications, 'UserDataChanged', userDataHandler); - this.userDataHandler = null; - } + removeNotificationEvent(this, 'UserDataChanged'); + removeNotificationEvent(this, 'TimerCreated'); + removeNotificationEvent(this, 'SeriesTimerCreated'); + removeNotificationEvent(this, 'TimerCancelled'); + removeNotificationEvent(this, 'SeriesTimerCancelled'); }; document.registerElement('emby-itemscontainer', { diff --git a/dashboard-ui/bower_components/emby-webcomponents/emby-toggle/emby-toggle.css b/dashboard-ui/bower_components/emby-webcomponents/emby-toggle/emby-toggle.css index 60804f79a8..387197c15c 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/emby-toggle/emby-toggle.css +++ b/dashboard-ui/bower_components/emby-webcomponents/emby-toggle/emby-toggle.css @@ -54,6 +54,10 @@ background: rgba(82,181,75, 0.5); } +.mdl-switch__input.red:checked + .mdl-switch__label + .mdl-switch__track { + background: rgba(204,51,51, 0.5); +} + .mdl-switch__input[disabled] + .mdl-switch__label + .mdl-switch__track { background: rgba(0,0,0, 0.12); cursor: auto; @@ -80,6 +84,12 @@ box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.14), 0 3px 3px -2px rgba(0, 0, 0, 0.2), 0 1px 8px 0 rgba(0, 0, 0, 0.12); } +.mdl-switch__input.red:checked + .mdl-switch__label + .mdl-switch__track + .mdl-switch__thumb { + background: rgb(204,51,51); + left: 1.146em; + box-shadow: 0 3px 4px 0 rgba(0, 0, 0, 0.14), 0 3px 3px -2px rgba(0, 0, 0, 0.2), 0 1px 8px 0 rgba(0, 0, 0, 0.12); +} + .mdl-switch__input[disabled] + .mdl-switch__label + .mdl-switch__track + .mdl-switch__thumb { background: rgb(189,189,189); cursor: auto; @@ -109,12 +119,19 @@ background-color: rgba(82,181,75, 0.26); } +.mdl-switch__input.red:checked:focus + .mdl-switch__label + .mdl-switch__track + .mdl-switch__thumb > .mdl-switch__focus-helper { + box-shadow: 0 0 0px 20px rgba(204,51,51, 0.26); + background-color: rgba(204,51,51, 0.26); +} + .mdl-switch__label { position: relative; cursor: pointer; line-height: 1.72em; margin: 0; left: 1.52em; + display: inline-flex; + align-items: center; } .mdl-switch__input[disabled] .mdl-switch__label { diff --git a/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js b/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js index b0bfd2b63e..7bfecbfe9d 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js +++ b/dashboard-ui/bower_components/emby-webcomponents/guide/guide.js @@ -396,10 +396,10 @@ } if (program.SeriesTimerId) { - html += 'fiber_smart_record'; + html += ''; } else if (program.TimerId) { - html += 'fiber_manual_record'; + html += ''; } if (addAccent) { @@ -778,7 +778,7 @@ var icon = cell.querySelector('.timerIcon'); if (!icon) { - cell.insertAdjacentHTML('beforeend', 'fiber_manual_record'); + cell.insertAdjacentHTML('beforeend', ''); } if (newTimerId) { diff --git a/dashboard-ui/bower_components/emby-webcomponents/indicators/indicators.js b/dashboard-ui/bower_components/emby-webcomponents/indicators/indicators.js index 71250246ac..cd9c090809 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/indicators/indicators.js +++ b/dashboard-ui/bower_components/emby-webcomponents/indicators/indicators.js @@ -99,10 +99,10 @@ define(['css!./indicators.css', 'material-icons'], function () { function getTimerIndicator(item) { if (item.SeriesTimerId) { - return 'fiber_smart_record'; + return ''; } if (item.TimerId) { - return 'fiber_manual_record'; + return ''; } return ''; diff --git a/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js b/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js index 64252f3b1a..ea2db09cc0 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js +++ b/dashboard-ui/bower_components/emby-webcomponents/itemcontextmenu.js @@ -168,7 +168,7 @@ define(['apphost', 'globalize', 'connectionManager', 'itemHelper', 'embyRouter', } } - if (item.Type == 'Program' && (!item.TimerId && !item.SeriesTimerId)) { + if (item.Type == 'Program') { commands.push({ name: Globalize.translate('sharedcomponents#Record'), diff --git a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.js b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.js new file mode 100644 index 0000000000..b4f705fa3e --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.js @@ -0,0 +1,242 @@ +define(['globalize', 'connectionManager', 'require', 'loading', 'apphost', 'recordingHelper', 'emby-toggle'], function (globalize, connectionManager, require, loading, appHost, recordingHelper) { + + function getRegistration(apiClient, programId, feature) { + + loading.show(); + + return apiClient.getJSON(apiClient.getUrl('LiveTv/Registration', { + + ProgramId: programId, + Feature: feature + + })).then(function (result) { + + loading.hide(); + return result; + + }, function () { + + loading.hide(); + + return { + TrialVersion: true, + IsValid: true, + IsRegistered: false + }; + }); + } + + function showConvertRecordingsUnlockMessage(context, apiClient) { + + apiClient.getPluginSecurityInfo().then(function (regInfo) { + + if (regInfo.IsMBSupporter) { + context.querySelector('.convertRecordingsContainer').classList.add('hide'); + } else { + context.querySelector('.convertRecordingsContainer').classList.remove('hide'); + } + + }, function () { + + context.querySelector('.convertRecordingsContainer').classList.remove('hide'); + }); + } + + function showSeriesRecordingFields(context, programId, apiClient) { + + getRegistration(apiClient, programId, 'seriesrecordings').then(function (regInfo) { + + if (regInfo.IsRegistered) { + context.querySelector('.supporterContainer').classList.add('hide'); + context.querySelector('.convertRecordingsContainer').classList.add('hide'); + + } else { + + context.querySelector('.supporterContainerText').innerHTML = globalize.translate('sharedcomponents#MessageActiveSubscriptionRequiredSeriesRecordings'); + context.querySelector('.supporterContainer').classList.remove('hide'); + context.querySelector('.convertRecordingsContainer').classList.add('hide'); + } + }); + } + + function showSingleRecordingFields(context, programId, apiClient) { + + getRegistration(apiClient, programId, 'dvr').then(function (regInfo) { + + if (regInfo.IsRegistered) { + context.querySelector('.supporterContainer').classList.add('hide'); + showConvertRecordingsUnlockMessage(context, apiClient); + } else { + + context.querySelector('.supporterContainerText').innerHTML = globalize.translate('sharedcomponents#DvrSubscriptionRequired'); + context.querySelector('.supporterContainer').classList.remove('hide'); + context.querySelector('.convertRecordingsContainer').classList.add('hide'); + } + }); + } + + function showRecordingFieldsContainer(context, programId, apiClient) { + + getRegistration(apiClient, programId, 'dvr').then(function (regInfo) { + + if (regInfo.IsRegistered) { + context.querySelector('.recordingFields').classList.remove('hide'); + } else { + + context.querySelector('.recordingFields').classList.add('hide'); + } + }); + } + + function loadData(parent, program, apiClient) { + + if (program.IsSeries) { + parent.querySelector('.chkRecordSeriesContainer').classList.remove('hide'); + } else { + parent.querySelector('.chkRecordSeriesContainer').classList.add('hide'); + } + + parent.querySelector('.chkRecord').checked = program.TimerId != null; + parent.querySelector('.chkRecordSeries').checked = program.SeriesTimerId != null; + + if (program.SeriesTimerId != null) { + showSeriesRecordingFields(parent, program.Id, apiClient); + } else { + showSingleRecordingFields(parent, program.Id, apiClient); + } + + //var seriesTimerPromise = program.SeriesTimerId ? + // apiClient.getLiveTvSeriesTimer(program.SeriesTimerId) : + // apiClient.getLiveTvProgram(program.Id, apiClient.getCurrentUserId()); + + //seriesTimerPromise.then(function (seriesTimer) { + + //}); + } + + function fetchData(instance) { + + var options = instance.options; + var apiClient = connectionManager.getApiClient(options.serverId); + + showRecordingFieldsContainer(options.parent, options.programId, apiClient); + + return apiClient.getLiveTvProgram(options.programId, apiClient.getCurrentUserId()).then(function (program) { + + instance.TimerId = program.TimerId; + instance.SeriesTimerId = program.SeriesTimerId; + + loadData(options.parent, program, apiClient); + }); + } + + function recordingEditor(options) { + this.options = options; + this.embed(); + } + + function onSupporterButtonClick() { + if (appHost.supports('externalpremium')) { + shell.openUrl('https://emby.media/premiere'); + } else { + + } + } + + function onRecordChange(e) { + + this.changed = true; + + var self = this; + var options = this.options; + var apiClient = connectionManager.getApiClient(options.serverId); + + var isChecked = e.target.checked; + + if (e.target.checked) { + if (!this.TimerId && !this.SeriesTimerId) { + recordingHelper.createRecording(apiClient, options.programId, false).then(function () { + fetchData(self); + }); + } + } else { + if (this.TimerId) { + recordingHelper.cancelTimer(apiClient, this.TimerId, true).then(function () { + fetchData(self); + }); + } + } + } + + function onRecordSeriesChange(e) { + + this.changed = true; + + var self = this; + var options = this.options; + var apiClient = connectionManager.getApiClient(options.serverId); + + var isChecked = e.target.checked; + + if (e.target.checked) { + showSeriesRecordingFields(options.parent, options.programId, apiClient); + + if (!this.SeriesTimerId) { + + var promise = this.TimerId ? + recordingHelper.changeRecordingToSeries(apiClient, this.TimerId, options.programId) : + recordingHelper.createRecording(apiClient, options.programId, true); + + promise.then(function () { + fetchData(self); + }); + } + } else { + + showSingleRecordingFields(options.parent, options.programId, apiClient); + + if (this.SeriesTimerId) { + apiClient.cancelLiveTvSeriesTimer(this.SeriesTimerId).then(function () { + fetchData(self); + }); + } + } + } + + recordingEditor.prototype.embed = function () { + + var self = this; + + return new Promise(function (resolve, reject) { + + require(['text!./recordingfields.template.html'], function (template) { + + var options = self.options; + var context = options.parent; + context.innerHTML = globalize.translateDocument(template, 'sharedcomponents'); + + var supporterButtons = context.querySelectorAll('.btnSupporter'); + for (var i = 0, length = supporterButtons.length; i < length; i++) { + if (appHost.supports('externalpremium')) { + supporterButtons[i].classList.remove('hide'); + } else { + supporterButtons[i].classList.add('hide'); + } + supporterButtons[i].addEventListener('click', onSupporterButtonClick); + } + + context.querySelector('.chkRecord').addEventListener('change', onRecordChange.bind(self)); + context.querySelector('.chkRecordSeries').addEventListener('change', onRecordSeriesChange.bind(self)); + + fetchData(self).then(resolve); + }); + }); + }; + + recordingEditor.prototype.hasChanged = function () { + + return this.changed; + }; + + return recordingEditor; +}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.template.html b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.template.html new file mode 100644 index 0000000000..2049fcf367 --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordingfields.template.html @@ -0,0 +1,27 @@ +
+

${HeaderConvertYourRecordings}

+
${PromoConvertRecordingsToStreamingFormat}
+
+ +
+
+
+
+ +
+
+ + + + +
\ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordinghelper.js b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordinghelper.js new file mode 100644 index 0000000000..8128e60beb --- /dev/null +++ b/dashboard-ui/bower_components/emby-webcomponents/recordingcreator/recordinghelper.js @@ -0,0 +1,67 @@ +define(['globalize', 'loading'], function (globalize, loading) { + + function changeRecordingToSeries(apiClient, timerId, programId) { + + loading.show(); + + apiClient.getItem(apiClient.getCurrentUserId(), programId).then(function (item) { + + if (item.IsSeries) { + // cancel, then create series + cancelTimer(apiClient, timerId, false).then(function () { + apiClient.getNewLiveTvTimerDefaults({ programId: programId }).then(function (timerDefaults) { + + apiClient.createLiveTvSeriesTimer(timerDefaults).then(function () { + + loading.hide(); + sendToast(globalize.translate('sharedcomponents#SeriesRecordingScheduled')); + }); + }); + }); + } else { + // cancel + cancelTimer(apiClient, timerId, true); + } + }); + } + + function cancelTimer(apiClient, timerId, hideLoading) { + loading.show(); + return apiClient.cancelLiveTvTimer(timerId).then(function () { + + if (hideLoading) { + loading.hide(); + sendToast(globalize.translate('sharedcomponents#RecordingCancelled')); + } + }); + } + + function createRecording(apiClient, programId, isSeries) { + + loading.show(); + return apiClient.getNewLiveTvTimerDefaults({ programId: programId }).then(function (item) { + + var promise = isSeries ? + apiClient.createLiveTvSeriesTimer(item) : + apiClient.createLiveTvTimer(item); + + return promise.then(function () { + + loading.hide(); + sendToast(globalize.translate('sharedcomponents#RecordingScheduled')); + }); + }); + } + + function sendToast(msg) { + require(['toast'], function (toast) { + toast(msg); + }); + } + + return { + cancelTimer: cancelTimer, + createRecording: createRecording, + changeRecordingToSeries: changeRecordingToSeries + }; +}); \ No newline at end of file diff --git a/dashboard-ui/bower_components/emby-webcomponents/shortcuts.js b/dashboard-ui/bower_components/emby-webcomponents/shortcuts.js index 80a07a0934..e49465e41c 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/shortcuts.js +++ b/dashboard-ui/bower_components/emby-webcomponents/shortcuts.js @@ -1,4 +1,4 @@ -define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'globalize', 'loading', 'dom'], function (playbackManager, inputManager, connectionManager, embyRouter, globalize, loading, dom) { +define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'globalize', 'loading', 'dom', 'recordingHelper'], function (playbackManager, inputManager, connectionManager, embyRouter, globalize, loading, dom, recordingHelper) { function playAllFromHere(card, serverId, queue) { @@ -93,11 +93,6 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g function showProgramDialog(item) { - if (item.TimerId) { - showItem(item); - return; - } - require(['recordingCreator'], function (recordingCreator) { recordingCreator.show(item.Id, item.ServerId); @@ -338,75 +333,20 @@ define(['playbackManager', 'inputManager', 'connectionManager', 'embyRouter', 'g if (seriesTimerId && timerId) { // cancel - cancelTimer(apiClient, timerId, true); + recordingHelper.cancelTimer(apiClient, timerId, true); } else if (timerId) { // change to series recording, if possible // otherwise cancel individual recording - changeRecordingToSeries(apiClient, timerId, id); + recordingHelper.changeRecordingToSeries(apiClient, timerId, id); } else if (type == 'Program') { // schedule recording - createRecording(apiClient, id); + recordingHelper.createRecording(apiClient, id); } } - function changeRecordingToSeries(apiClient, timerId, programId) { - - loading.show(); - - apiClient.getItem(apiClient.getCurrentUserId(), programId).then(function (item) { - - if (item.IsSeries) { - // cancel, then create series - cancelTimer(apiClient, timerId, false).then(function () { - apiClient.getNewLiveTvTimerDefaults({ programId: programId }).then(function (timerDefaults) { - - apiClient.createLiveTvSeriesTimer(timerDefaults).then(function () { - - loading.hide(); - sendToast(globalize.translate('sharedcomponents#SeriesRecordingScheduled')); - }); - }); - }); - } else { - // cancel - cancelTimer(apiClient, timerId, true); - } - }); - } - - function cancelTimer(apiClient, timerId, hideLoading) { - loading.show(); - return apiClient.cancelLiveTvTimer(timerId).then(function () { - - if (hideLoading) { - loading.hide(); - sendToast(globalize.translate('sharedcomponents#RecordingCancelled')); - } - }); - } - - function createRecording(apiClient, programId) { - - loading.show(); - apiClient.getNewLiveTvTimerDefaults({ programId: programId }).then(function (item) { - - apiClient.createLiveTvTimer(item).then(function () { - - loading.hide(); - sendToast(globalize.translate('sharedcomponents#RecordingScheduled')); - }); - }); - } - - function sendToast(msg) { - require(['toast'], function (toast) { - toast(msg); - }); - } - function onClick(e) { var card = dom.parentWithClass(e.target, 'itemAction'); diff --git a/dashboard-ui/bower_components/emby-webcomponents/subtitleeditor/subtitleeditor.template.html b/dashboard-ui/bower_components/emby-webcomponents/subtitleeditor/subtitleeditor.template.html index 12a7eeaa0c..2a9fca002c 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/subtitleeditor/subtitleeditor.template.html +++ b/dashboard-ui/bower_components/emby-webcomponents/subtitleeditor/subtitleeditor.template.html @@ -8,7 +8,7 @@

${SearchForSubtitles}

-

+

diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index 0682af6b06..bfc81a6337 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -188,6 +188,14 @@ select { color: #fff; } +.ui-body-a .secondaryText { + color: #ccc; +} + +.ui-body-b .secondaryText { + color: #aaa; +} + div[data-role='page'] { outline: none; } diff --git a/dashboard-ui/scripts/htmlmediarenderer.js b/dashboard-ui/scripts/htmlmediarenderer.js index 754da83152..e6de4ae650 100644 --- a/dashboard-ui/scripts/htmlmediarenderer.js +++ b/dashboard-ui/scripts/htmlmediarenderer.js @@ -184,8 +184,14 @@ return false; } - if (MediaPlayer.canPlayNativeHls() && mediaSource.RunTimeTicks) { - return false; + if (MediaPlayer.canPlayNativeHls()) { + + // simple playback should use the native support + if (mediaSource.RunTimeTicks) { + return false; + } + + //return false; } // For now don't do this in edge because we lose some native audio support @@ -193,6 +199,11 @@ return false; } + // hls.js is only in beta. needs more testing. + if (browser.safari) { + return false; + } + return true; } diff --git a/dashboard-ui/scripts/mediaplayer-video.js b/dashboard-ui/scripts/mediaplayer-video.js index dec583b6ad..5aada04c30 100644 --- a/dashboard-ui/scripts/mediaplayer-video.js +++ b/dashboard-ui/scripts/mediaplayer-video.js @@ -986,8 +986,9 @@ if (browser.msie) { - if (!window.MediaSource || !mediaSource.RunTimeTicks) { + if (window.MediaSource == null || mediaSource.RunTimeTicks == null) { alert('Playback of this content is not supported in Internet Explorer. For a better experience, please try a modern browser such as Google Chrome, Firefox, Opera, or Microsoft Edge.'); + return; } } @@ -1021,7 +1022,7 @@ Dashboard.hideLoadingMsg(); streamInfo.url = hlsPlaylistUrl; - onReadyToPlay(); + setTimeout(onReadyToPlay, 0); }, function () { Dashboard.hideLoadingMsg(); diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index 2856864c7a..0a0ba7cf59 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -143,9 +143,7 @@ define(['appSettings', 'userSettings', 'appStorage', 'datetime'], function (appS return true; } - // viblast can help us here - //return true; - return window.MediaSource; + return window.MediaSource != null; }; self.changeStream = function (ticks, params) { diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 7dbf0f99ef..391350274d 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1234,6 +1234,8 @@ var AppInfo = {}; define("playlistEditor", [embyWebComponentsBowerPath + "/playlisteditor/playlisteditor"], returnFirstDependency); define("recordingCreator", [embyWebComponentsBowerPath + "/recordingcreator/recordingcreator"], returnFirstDependency); define("recordingEditor", [embyWebComponentsBowerPath + "/recordingcreator/recordingeditor"], returnFirstDependency); + define("recordingFields", [embyWebComponentsBowerPath + "/recordingcreator/recordingfields"], returnFirstDependency); + define("recordingHelper", [embyWebComponentsBowerPath + "/recordingcreator/recordinghelper"], returnFirstDependency); define("subtitleEditor", [embyWebComponentsBowerPath + "/subtitleeditor/subtitleeditor"], returnFirstDependency); define("itemIdentifier", [embyWebComponentsBowerPath + "/itemidentifier/itemidentifier"], returnFirstDependency); define("mediaInfo", [embyWebComponentsBowerPath + "/mediainfo/mediainfo"], returnFirstDependency);