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

Not functional in nodejs #85

Closed
jagadishkamathk opened this issue Jan 4, 2020 · 3 comments
Closed

Not functional in nodejs #85

jagadishkamathk opened this issue Jan 4, 2020 · 3 comments

Comments

@jagadishkamathk
Copy link

I tried to use mpd-parser in a node environment and there are multiple issues

  1. TypeError: window$1.DOMParser is not a constructor
  2. TypeError: Cannot read property 'href' of undefined

I could workaround for #1 by using 'xmldom' and then setting that in global. Couldn;t get #2 working

@gkatsev
Copy link
Member

gkatsev commented Jan 6, 2020

Can you provide an example of how you're using it? Just tried requiring it locally and it seems to be working.

@jagadishkamathk
Copy link
Author

jagadishkamathk commented Jan 7, 2020

Here is my simple index.js with only axios and mpd-parser as dependency

const dash   =  require("mpd-parser")
const axios = require("axios")
const url = "http://dash.edgesuite.net/akamai/bbb_30fps/bbb_30fps.mpd"

axios.get(url)
.then(function(media_data) {
    var parsedManifest = dash.parse(media_data.data, url);
    console.log(parsedManifest);
})

@gkatsev
Copy link
Member

gkatsev commented Apr 8, 2020

We use it in hls-fetcher in node and it's working see https://github.com/videojs/hls-fetcher/pull/35/files#diff-19fa81396ca7a1262231cd1e39410fde

@gkatsev gkatsev closed this as completed Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants