FIX: [STUDIO-3329] not auto play liveview when not connected

Change-Id: I8a5ad388bc86598f963103eb9e1baa2538894fc1
This commit is contained in:
chunmao.guo 2023-06-27 13:53:05 +08:00 committed by Lane.Wei
parent d087b6c94a
commit 699cc2cf44
1 changed files with 2 additions and 2 deletions

View File

@ -97,7 +97,7 @@ void MediaPlayCtrl::SetMachineObject(MachineObject* obj)
m_device_busy = false;
}
if (machine == m_machine) {
if (m_last_state == MEDIASTATE_IDLE)
if (m_last_state == MEDIASTATE_IDLE && IsEnabled())
Play();
return;
}
@ -113,7 +113,7 @@ void MediaPlayCtrl::SetMachineObject(MachineObject* obj)
m_streaming = false;
}
if (m_last_state != MEDIASTATE_IDLE)
Stop();
Stop(" ");
if (m_next_retry.IsValid()) // Try open 2 seconds later, to avoid state conflict
m_next_retry = wxDateTime::Now() + wxTimeSpan::Seconds(2 * m_failed_retry);
else