Skip to content

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

Closed

Description

@zgzong

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

Activity

  1. self-assigned this
    on Feb 4, 2022
  2. zgzong commented on Feb 7, 2022

    @zgzong
    Author

    @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());
    }
    }

  3. ojw28 commented on Feb 7, 2022

    @ojw28
    Contributor

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

  4. zgzong commented on Feb 7, 2022

    @zgzong
    Author

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

  5. ludoven commented on Feb 11, 2022

    @ludoven

    I also encountered this problem, have you solved it?

  6. locked and limited conversation to collaborators on Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions