Skip to content

Commit

Permalink
Fix playback status in android app when reconnecting (#10)
Browse files Browse the repository at this point in the history
* reset playing status correctly on stop and send playback progress if something is playing when client reconnects

* remove unnecessary line breaks

* possibly fix first line
  • Loading branch information
Froghut authored and anthonylavado committed Jul 10, 2019
1 parent 7a143a0 commit 5194d2b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions components/maincontroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@

clearMediaElement();

window.playlist = [];
window.currentPlaylistIndex = -1;
embyActions.displayUserInfo($scope, $scope.serverAddress, $scope.accessToken, $scope.userId);

promise = promise || Promise.resolve();

return promise;
Expand Down Expand Up @@ -271,15 +275,14 @@

}
else if (data.command == 'Identify') {

if (!isPlaying()) {
embyActions.displayUserInfo($scope, data.serverAddress, data.accessToken, data.userId);
} else {
// when a client connects send back the initial device state (volume etc) via a playbackstop message
embyActions.reportPlaybackProgress($scope, getReportingParams($scope), true, "playbackstop");
}
// when a client connects send back the initial device state (volume etc) via a playbackstop message
embyActions.reportPlaybackProgress($scope, getReportingParams($scope), true, "playbackstop");
}
else if (data.command == 'SetVolume') {

// Scale 0-100
window.mediaElement.volume = data.options.volume / 100;
}
Expand Down Expand Up @@ -930,4 +933,4 @@
}

window.castReceiverManager.start();
});
});

0 comments on commit 5194d2b

Please sign in to comment.