diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index 9d63c6d58e..61a020ae19 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -1216,3 +1216,7 @@ a.itemTag:hover { right: 300px; } } + +.nowPlayingPage .btnCommand { + font-size: 19px; +} diff --git a/dashboard-ui/css/mediaplayer-video.css b/dashboard-ui/css/mediaplayer-video.css index 8c186ee2ff..5adb5b0eb2 100644 --- a/dashboard-ui/css/mediaplayer-video.css +++ b/dashboard-ui/css/mediaplayer-video.css @@ -137,7 +137,7 @@ text-align: left; margin-left: 0; right: 0; - bottom: 85px; + bottom: 70px; } #mediaPlayer .volumeSliderContainer { diff --git a/dashboard-ui/dlnaprofile.html b/dashboard-ui/dlnaprofile.html index ae3ec500a5..8d429c6ecb 100644 --- a/dashboard-ui/dlnaprofile.html +++ b/dashboard-ui/dlnaprofile.html @@ -146,7 +146,40 @@

${HeaderServerSettings}

These values control how Media Browser will present itself to the device.

+

- -
-
+
+
+ +
+ + + + + +
+
+ + + + +
-
-
-
- - - -
-
- -
-
- - -
-
-
- - - - -
-
- - - - + +
+ +
+ +
+
+ + + +
+
+ +
+
+ + +
+
+
+ + + + +
+
+ + + + +
diff --git a/dashboard-ui/scripts/dlnaprofile.js b/dashboard-ui/scripts/dlnaprofile.js index 44938c5f2a..65cb5c7006 100644 --- a/dashboard-ui/scripts/dlnaprofile.js +++ b/dashboard-ui/scripts/dlnaprofile.js @@ -45,6 +45,15 @@ var idInfo = profile.Identification || {}; + $('#txtInfoFriendlyName', page).val(profile.FriendlyName || ''); + $('#txtInfoModelName', page).val(profile.ModelName || ''); + $('#txtInfoModelNumber', page).val(profile.ModelNumber || ''); + $('#txtInfoModelDescription', page).val(profile.ModelDescription || ''); + $('#txtInfoModelUrl', page).val(profile.ModelUrl || ''); + $('#txtInfoManufacturer', page).val(profile.Manufacturer || ''); + $('#txtInfoManufacturerUrl', page).val(profile.ManufacturerUrl || ''); + $('#txtInfoSerialNumber', page).val(profile.SerialNumber || ''); + $('#txtIdFriendlyName', page).val(idInfo.FriendlyName || ''); $('#txtIdModelName', page).val(idInfo.ModelName || ''); $('#txtIdModelNumber', page).val(idInfo.ModelNumber || ''); @@ -656,6 +665,15 @@ profile.Identification = profile.Identification || {}; + profile.FriendlyName = $('#txtInfoFriendlyName', page).val(); + profile.ModelName = $('#txtInfoModelName', page).val(); + profile.ModelNumber = $('#txtInfoModelNumber', page).val(); + profile.ModelDescription = $('#txtInfoModelDescription', page).val(); + profile.ModelUrl = $('#txtInfoModelUrl', page).val(); + profile.Manufacturer = $('#txtInfoManufacturer', page).val(); + profile.ManufacturerUrl = $('#txtInfoManufacturerUrl', page).val(); + profile.SerialNumber = $('#txtInfoSerialNumber', page).val(); + profile.Identification.FriendlyName = $('#txtIdFriendlyName', page).val(); profile.Identification.ModelName = $('#txtIdModelName', page).val(); profile.Identification.ModelNumber = $('#txtIdModelNumber', page).val(); diff --git a/dashboard-ui/scripts/nowplayingpage.js b/dashboard-ui/scripts/nowplayingpage.js index 02edadabd8..d25fe0e8d7 100644 --- a/dashboard-ui/scripts/nowplayingpage.js +++ b/dashboard-ui/scripts/nowplayingpage.js @@ -1,6 +1,7 @@ (function (window, document, $, setTimeout, clearTimeout) { var currentPlayer; + var lastPlayerState; function bindEvents(page) { @@ -12,12 +13,37 @@ elem.show(); }); - $('.btnCommand', page).on('click', function () { + $('.btnCommand,.btnToggleFullscreen', page).on('click', function () { currentPlayer.sendCommand({ Name: this.getAttribute('data-command') }); }); + + $('.btnStop', page).on('click', function () { + + currentPlayer.stop(); + }); + + $('.btnPlay', page).on('click', function () { + + currentPlayer.unpause(); + }); + + $('.btnPause', page).on('click', function () { + + currentPlayer.pause(); + }); + + $('.btnNextTrack', page).on('click', function () { + + currentPlayer.nextTrack(); + }); + + $('.btnPreviousTrack', page).on('click', function () { + + currentPlayer.previousTrack(); + }); } function onPlaybackStart(e, state) { @@ -34,10 +60,59 @@ var player = this; player.endPlayerUpdates(); + + onStateChanged.call(player, e, state); } function onStateChanged(e, state) { + updatePlayerState($.mobile.activePage, state); + } + + function showButton(button) { + button.removeClass('hide'); + } + + function hideButton(button) { + button.addClass('hide'); + } + + function updatePlayerState(page, state) { + + lastPlayerState = state; + + var item = state.NowPlayingItem; + + var playerInfo = MediaController.getPlayerInfo(); + + var supportedCommands = playerInfo.supportedCommands; + + $('.btnToggleFullscreen', page).buttonEnabled(item && item.MediaType == 'Video' && supportedCommands.indexOf('ToggleFullscreen') != -1); + + $('.btnAudioTracks', page).buttonEnabled(item != null); + $('.btnSubtitles', page).buttonEnabled(item != null); + $('.btnChapters', page).buttonEnabled(item != null); + + $('.btnStop', page).buttonEnabled(item != null); + $('.btnNextTrack', page).buttonEnabled(item != null); + $('.btnPreviousTrack', page).buttonEnabled(item != null); + + var btnPause = $('.btnPause', page).buttonEnabled(item != null); + var btnPlay = $('.btnPlay', page).buttonEnabled(item != null); + + var playState = state.PlayState || {}; + + if (playState.IsPaused) { + + hideButton(btnPause); + showButton(btnPlay); + + } else { + + showButton(btnPause); + hideButton(btnPlay); + } + } function updateSupportedCommands(page, commands) { @@ -93,13 +168,6 @@ bindEvents(page); - }).on('pageshow', "#nowPlayingPage", function () { - - var page = this; - - $('.radioTabButton', page).checked(false).checkboxradio('refresh'); - $('.radioTabButton:first', page).checked(true).checkboxradio('refresh').trigger('change'); - $(function () { $(MediaController).on('playerchange.nowplayingpage', function () { @@ -111,11 +179,20 @@ }); + }).on('pageshow', "#nowPlayingPage", function () { + + var page = this; + + $('.radioTabButton', page).checked(false).checkboxradio('refresh'); + $('.radioTabButton:first', page).checked(true).checkboxradio('refresh').trigger('change'); + }).on('pagehide', "#nowPlayingPage", function () { releaseCurrentPlayer(); $(MediaController).off('playerchange.nowplayingpage'); + + lastPlayerState = null; }); })(window, document, jQuery, setTimeout, clearTimeout); \ No newline at end of file