You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MPD.Location uri in relative format can't be resolved. #9939
We have a DASH live stream, it's MPD manifest Location url is a relative url.
../another_path/manifest.mpd?device_profile=DASH_STB_NGRSSP_LIVE_SD
When using 2.16.1 demo application to play this stream, the following error has been throw by exoplayer.
2022-02-04 11:52:53.239 17085-17085/com.google.android.exoplayer2.demo E/EventLogger: internalError [eventTime=2.02, mediaPos=27.76, window=0, loadError
com.google.android.exoplayer2.upstream.FileDataSource$FileDataSourceException: uri has query and/or fragment, which are not supported. Did you call Uri.parse() on a string containing '?' or '#'? Use Uri.fromFile(new File(path)) to avoid this.
The expected behaviour
Exoplayer could resolve the relative path MPD.Location and use it for manifest refresh.
The actual behaviour
Exoplayer detect the MPD.Location as a local file path.
@ojw28
here below is a way to resolve this issue. What's your opinion? manifestUri = resolveManifestLocation(loadable.getUri(), manifest.location);
/**
* Resolve Manifest location.
*
* @PARAM baseUri this is the uri after 302 redirection.
* @PARAM location this is uri parsed from the MPD.Location
* @return the resolved uri for manifest.
*/
private Uri resolveManifestLocation(Uri baseUri, Uri location) {
if(location == null) {
return baseUri;
}
if(location.isAbsolute()) {
return location;
}else{
//resolve the location's relative path against the uri after 302 redirection.
return UriUtil.resolveToUri(baseUri.toString(), location.toString());
}
}
Activity
zgzong commentedon Feb 7, 2022
@ojw28
here below is a way to resolve this issue. What's your opinion?
manifestUri = resolveManifestLocation(loadable.getUri(), manifest.location);/**
* Resolve Manifest location.
*
* @PARAM baseUri this is the uri after 302 redirection.
* @PARAM location this is uri parsed from the MPD.Location
* @return the resolved uri for manifest.
*/
private Uri resolveManifestLocation(Uri baseUri, Uri location) {
if(location == null) {
return baseUri;
}
if(location.isAbsolute()) {
return location;
}else{
//resolve the location's relative path against the uri after 302 redirection.
return UriUtil.resolveToUri(baseUri.toString(), location.toString());
}
}
ojw28 commentedon Feb 7, 2022
Our plan is to solve the problem in
DashManifestParser. Will will update this issue with a commit shortly.Support relative MPD.Location URIs
Support relative MPD.Location URIs
zgzong commentedon Feb 7, 2022
Thanks that's even better. Resolve the location immediately after it has been parsed.
ludoven commentedon Feb 11, 2022
I also encountered this problem, have you solved it?
Support relative MPD.Location URIs
Support relative MPD.Location URIs