Add optional auth info to LoadResult.
Add auth_header_ to LoadResult. If it exists, populate the MediaPlaybackRequests headers with an Authorization header with that value.
This commit is contained in:
parent
3c7b509d59
commit
e338939c8b
|
@ -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());
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue