Update ui.py

fix playback detection