Parser failing with blob url

Open
#150 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript

Research direction

Start by reproducing the blob URL case from the issue, then read resolve-url.js and the buildBaseUrls/inheritAttributes path shown in the stack trace. Determine why the blob URL is rejected during MPD parsing; done means the supplied blob URL no longer throws Invalid URL and the parser handles it successfully.

Written by the indexing model from the issue text.

Description

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 :)

Dominant language
JavaScript
Stars
88
Forks
60
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from videojs/mpd-parser

All issues in videojs/mpd-parser

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.