You can now also play MP3s streamed from the internet. (Very rough & wonky code. More or less proof-of-concept right now.)
This commit is contained in:
@@ -545,10 +545,16 @@ bool Player::play() {
|
||||
void Player::_play_file(String file, uint32_t file_offset) {
|
||||
INFO("play_file('%s', %d)\n", file.c_str(), file_offset);
|
||||
_spi->select_sd();
|
||||
_file = new SDDataSource(file);
|
||||
if (file.startsWith("/")) {
|
||||
_file = new SDDataSource(file);
|
||||
} else if (file.startsWith("https://")) {
|
||||
_file = new HTTPSDataSource(file);
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
_file_size = _file->size();
|
||||
_spi->select_sd(false);
|
||||
if (!_file) {
|
||||
if (!_file || !_file->usable()) {
|
||||
DEBUG("Could not open file %s", file.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user