Skip to content

Parser failing with blob url #150

Description

@nikosgpet

I am using video.js which calls the mpd-parser in the background. An error occurs in mpd-parser if I call video.js with a blob url of an .mpd file, instead of a url from the internet.

I create the url as follows:

    const blob = new Blob([mpdContents], {type: 'application/dash+xml'})
    const url = URL.createObjectURL(blob)

It throws the following error:

resolve-url.js?fd22:31 Uncaught TypeError: Failed to construct 'URL': Invalid URL
    at resolveUrl (resolve-url.js?fd22:31)
    at eval (mpd-parser.es.js?2202:1601)
    at Array.map (<anonymous>)
    at eval (mpd-parser.es.js?2202:1600)
    at Array.map (<anonymous>)
    at buildBaseUrls (mpd-parser.es.js?2202:1599)
    at inheritAttributes (mpd-parser.es.js?2202:2063)
    at parse (mpd-parser.es.js?2202:2176)
    at parseMasterXml (video.es.js?7ac5:31399)
    at DashPlaylistLoader.handleMaster_ (video.es.js?7ac5:32020)
    at eval (video.es.js?7ac5:31929)
    at callbackWrapper (video.es.js?7ac5:30636)
    at Object.eval [as callback] (video.es.js?7ac5:30661)
    at cbOnce (index.js?b664:104)
    at XMLHttpRequest.loadFunc (index.js?b664:178)

Are blob urls supported ? It would be great if they were :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions