Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MPD.Location uri in relative format can't be resolved. #9939

Closed
zgzong opened this issue Feb 4, 2022 · 4 comments
Closed

MPD.Location uri in relative format can't be resolved. #9939

zgzong opened this issue Feb 4, 2022 · 4 comments
Assignees
Labels

Comments

@zgzong
Copy link

zgzong commented Feb 4, 2022

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.

  • ExoPlayer version number
    2.16.1

@zgzong
Copy link
Author

zgzong commented 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
Copy link
Contributor

ojw28 commented Feb 7, 2022

Our plan is to solve the problem in DashManifestParser. Will will update this issue with a commit shortly.

icbaker pushed a commit to androidx/media that referenced this issue Feb 7, 2022
#minor-release
Issue: google/ExoPlayer#9939
PiperOrigin-RevId: 426394339
icbaker pushed a commit that referenced this issue Feb 7, 2022
#minor-release
Issue: #9939
PiperOrigin-RevId: 426394339
@zgzong
Copy link
Author

zgzong commented Feb 7, 2022

Thanks that's even better. Resolve the location immediately after it has been parsed.

@ojw28 ojw28 closed this as completed Feb 7, 2022
@ludoven
Copy link

ludoven commented Feb 11, 2022

I also encountered this problem, have you solved it?

icbaker pushed a commit that referenced this issue Feb 23, 2022
#minor-release
Issue: #9939
PiperOrigin-RevId: 426394339
icbaker pushed a commit to androidx/media that referenced this issue Feb 25, 2022
#minor-release
Issue: google/ExoPlayer#9939
PiperOrigin-RevId: 426394339
@google google locked and limited conversation to collaborators Apr 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants