diff --git a/src/core/player.cpp b/src/core/player.cpp index a090cc376..2e1a91a6a 100644 --- a/src/core/player.cpp +++ b/src/core/player.cpp @@ -147,6 +147,8 @@ void Player::HandleLoadResult(const UrlHandler::LoadResult& result) { app_->playlist_manager()->active()->InformOfCurrentSongChange(); } MediaPlaybackRequest req(result.media_url_); + if (!result.auth_header_.isEmpty()) + req.headers_["Authorization"] = result.auth_header_; engine_->Play(req, stream_change_type_, item->Metadata().has_cue(), item->Metadata().beginning_nanosec(), item->Metadata().end_nanosec()); diff --git a/src/core/urlhandler.h b/src/core/urlhandler.h index f827a03ce..721119dcf 100644 --- a/src/core/urlhandler.h +++ b/src/core/urlhandler.h @@ -66,6 +66,9 @@ class UrlHandler : public QObject { // Track length, if we are able to get it only now qint64 length_nanosec_; + + // If non-empty, value for an Authorization header. + QByteArray auth_header_; }; // Called by the Player when a song starts loading - gives the handler