1.6 KiB
1.6 KiB
Playback Testing
Purpose
Test NFC playback, recursive media order, resume, and playback controls.
Prerequisites
- Box running:
python3 box/main.py run - Media in
box/data/media/
Step-by-step
NFC simulation
Start playback:
curl -X POST http://127.0.0.1:8000/command \
-H "Content-Type: application/json" \
-d '{"command":"nfc_on","payload":{"uid":"UID_1"}}'
Stop playback:
curl -X POST http://127.0.0.1:8000/command \
-H "Content-Type: application/json" \
-d '{"command":"nfc_off","payload":{"uid":"UID_1"}}'
Resume tests
nfc_on UID_1- Wait or use
tickin CLI nfc_off UID_1nfc_on UID_1again Expected: position resumes from saved state.
Tag switching
nfc_on UID_1nfc_on UID_2nfc_on UID_1Expected: UID_1 resumes from previous position.
Recursive order
- Order is depth-first, folders first, lexicographic.
- Change folder names or nesting to see ordering changes.
End of media behavior
- When the last file ends:
- Playback stops
- Position saved at end
- State becomes IDLE
Buttons
next: file_index + 1prev: if position > 3s then position=0, else file_index - 1play_pause: toggle PLAYING/PAUSEDvolume_up/volume_down: change volume within 0..max
Checklist
- ✅ Resume works for same UID
- ✅ Tag switching preserves per-UID resume
- ✅ Recursive order matches folder structure
- ✅ End-of-media stops playback and saves
Troubleshooting
- No playback starts:
- Check tags in
box/data/box.json. - Ensure files exist under
box/data/media.
- Check tags in
- Duration is 0:
- Filenames not matched; mock uses hash-based durations for unknown names.