Skip to content

Commit

Permalink
Merge pull request #1132 from MediaBrowser/dev
Browse files Browse the repository at this point in the history
3.0.5666.9
  • Loading branch information
LukePulverenti committed Jul 12, 2015
2 parents 809125e + 8d41caa commit f575ad4
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@
browsableImageStartIndex = 0;
browsableImageType = type;

$('.lnkBrowseImages').trigger('click');
$('.lnkBrowseImages', $.mobile.activePage).trigger('click');
};
}

Expand Down
86 changes: 46 additions & 40 deletions MediaBrowser.WebDashboard/dashboard-ui/scripts/nowplayingbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,41 +135,44 @@
});
});

volumeSlider = $('.nowPlayingBarVolumeSlider', elem).on('change', function () {
// Unfortunately this is necessary because the polymer elements might not be ready immediately and there doesn't seem to be an event-driven way to find out when
setTimeout(function() {
volumeSlider = $('.nowPlayingBarVolumeSlider', elem).on('change', function () {

if (currentPlayer) {
currentPlayer.setVolume(this.value);
}
if (currentPlayer) {
currentPlayer.setVolume(this.value);
}

})[0];
})[0];

positionSlider = $('.nowPlayingBarPositionSlider', elem).on('change', function () {
positionSlider = $('.nowPlayingBarPositionSlider', elem).on('change', function () {

if (currentPlayer && lastPlayerState) {
if (currentPlayer && lastPlayerState) {

var newPercent = parseFloat(this.value);
var newPositionTicks = (newPercent / 100) * lastPlayerState.NowPlayingItem.RunTimeTicks;
var newPercent = parseFloat(this.value);
var newPositionTicks = (newPercent / 100) * lastPlayerState.NowPlayingItem.RunTimeTicks;

currentPlayer.seek(Math.floor(newPositionTicks));
}
currentPlayer.seek(Math.floor(newPositionTicks));
}

})[0];
})[0];

positionSlider._setPinValue = function (value) {
positionSlider._setPinValue = function (value) {

var state = lastPlayerState;
var state = lastPlayerState;

if (!state || !state.NowPlayingItem || !state.NowPlayingItem.RunTimeTicks) {
this.pinValue = '--:--';
return;
}
if (!state || !state.NowPlayingItem || !state.NowPlayingItem.RunTimeTicks) {
this.pinValue = '--:--';
return;
}

var ticks = state.NowPlayingItem.RunTimeTicks;
ticks /= 100;
ticks *= value;
var ticks = state.NowPlayingItem.RunTimeTicks;
ticks /= 100;
ticks *= value;

this.pinValue = Dashboard.getDisplayTime(ticks);
};
this.pinValue = Dashboard.getDisplayTime(ticks);
};
}, 300);
}

function getNowPlayingBar() {
Expand All @@ -187,9 +190,8 @@
elem.classList.add('noMediaProgress');
}

$.mobile.loadPage('nowplaying.html');

bindEvents(elem);
$.mobile.loadPage('nowplaying.html');

return elem;
}
Expand Down Expand Up @@ -218,14 +220,11 @@
var now = new Date().getTime();
if ((now - lastUpdateTime) < 700) {

console.log('skipping UI update');
return;
}
lastUpdateTime = now;
}

console.log(new Date().getTime());

lastPlayerState = state;

if (!muteButton) {
Expand All @@ -250,21 +249,25 @@
updatePlayerVolumeState(state, playerInfo);

var nowPlayingItem = state.NowPlayingItem || {};
if (!positionSlider.dragging) {

if (nowPlayingItem && nowPlayingItem.RunTimeTicks) {
// See bindEvents for why this is necessary
if (positionSlider) {
if (!positionSlider.dragging) {

var pct = playState.PositionTicks / nowPlayingItem.RunTimeTicks;
pct *= 100;
if (nowPlayingItem.RunTimeTicks) {

positionSlider.value = pct;
var pct = playState.PositionTicks / nowPlayingItem.RunTimeTicks;
pct *= 100;

} else {
positionSlider.value = pct;

positionSlider.value = 0;
}
} else {

positionSlider.disabled = !playState.CanSeek;
positionSlider.value = 0;
}

positionSlider.disabled = !playState.CanSeek;
}
}

var timeText = Dashboard.getDisplayTime(playState.PositionTicks);
Expand Down Expand Up @@ -333,10 +336,13 @@
hideButton(unmuteButton);
}

$(volumeSlider).visible(showVolumeSlider);
// See bindEvents for why this is necessary
if (volumeSlider) {
$(volumeSlider).visible(showVolumeSlider);

if (!volumeSlider.dragging) {
volumeSlider.value = playState.VolumeLevel || 0;
if (!volumeSlider.dragging) {
volumeSlider.value = playState.VolumeLevel || 0;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion SharedVersion.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Reflection;

//[assembly: AssemblyVersion("3.0.*")]
[assembly: AssemblyVersion("3.0.5666.8")]
[assembly: AssemblyVersion("3.0.5666.9")]

0 comments on commit f575ad4

Please sign in to comment.