Prevent autoplay when connecting to LMS

This commit is contained in:
emeric
2018-09-12 20:24:46 +02:00
parent ce7cb193a4
commit 5e3cfffa92
5 changed files with 25 additions and 17 deletions
+2 -2
View File
@@ -51,7 +51,7 @@ MediaPlayer::MediaPlayer()
}
void
MediaPlayer::playTrack(Database::IdType trackId)
MediaPlayer::loadTrack(Database::IdType trackId, bool play)
{
LMS_LOG(UI, DEBUG) << "Playing track ID = " << trackId;
@@ -72,7 +72,7 @@ MediaPlayer::playTrack(Database::IdType trackId)
<< " duration: " << std::chrono::duration_cast<std::chrono::seconds>(track->getDuration()).count() << ","
<< " imgResource: \"" << imgResource << "\","
<< "};";
oss << "LMS.mediaplayer.loadTrack(params, true)"; // true to autoplay
oss << "LMS.mediaplayer.loadTrack(params, " << (play ? "true" : "false") << ")"; // true to autoplay
LMS_LOG(UI, DEBUG) << "Runing js = '" << oss.str() << "'";