Support for http(s) links in _mapping.txt
This commit is contained in:
parent
9a39b00a65
commit
cf433a48b2
@ -149,8 +149,14 @@ void Controller::play(String rfid_id) {
|
|||||||
|
|
||||||
void Controller::play() {
|
void Controller::play() {
|
||||||
String file = current_playlist.get_current_file_name();
|
String file = current_playlist.get_current_file_name();
|
||||||
Serial.printf("Playing file: %s\n", file.c_str());
|
|
||||||
audio.connecttoFS(SD, file.c_str(), current_playlist.get_current_time());
|
if (file.startsWith("/")) {
|
||||||
|
log_i("Playing file %s via connecttoFS", file.c_str());
|
||||||
|
audio.connecttoFS(SD, file.c_str(), current_playlist.get_current_time());
|
||||||
|
} else if (file.startsWith("http")) {
|
||||||
|
log_i("Playing URL %s via connecttohost", file.c_str());
|
||||||
|
audio.connecttohost(file.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Controller::next_track() {
|
void Controller::next_track() {
|
||||||
|
@ -54,6 +54,9 @@ Playlist PlaylistManager::get_playlist(String rfid_id) {
|
|||||||
entry.close();
|
entry.close();
|
||||||
}
|
}
|
||||||
dir.close();
|
dir.close();
|
||||||
|
} else if (path.startsWith("http")) {
|
||||||
|
Serial.printf("Adding URL %s to the list of files\n", path.c_str());
|
||||||
|
current_playlist.add_file(path);
|
||||||
}
|
}
|
||||||
current_playlist.sort();
|
current_playlist.sort();
|
||||||
current_rfid_tag_id = rfid_id;
|
current_rfid_tag_id = rfid_id;
|
||||||
|
Loading…
Reference in New Issue
Block a user