mpd-parser icon indicating copy to clipboard operation
mpd-parser copied to clipboard

Usage in react-native

Open AnassHmida opened this issue 4 years ago • 4 comments

Hello , i want to ask you how can i implement this in react-native ? i mean i did implement it , but the "manifest" part is really confusing to me , can you clarify it a bit pls ? an example would be wonderful !

AnassHmida avatar Oct 06 '20 22:10 AnassHmida

Unfortunately, I'm not too sure how react-native runs. mpd-parser is javascript project that when given the XML of an MPEG-DASH manifest will return a JSON representation of it. If react-native works with regular javascript, you should be able to include it. However, it's likely that you don't want mpd-parser itself but probably want to look at a full-fledged video player (like Video.js itself). However, you'll want to find a player that supports react-native. I believe Video.js won't work due to how react-native works, but I'm not positive.

gkatsev avatar Oct 11 '20 07:10 gkatsev

Hey , i still can't fix my problem , my question is that you use 2 parameters in your function, i'm talking about manifest and manifesturl , what's the point of manifest ? if adding only manifesturl will give me the output that i want.

AnassHmida avatar Oct 12 '20 15:10 AnassHmida

@AnassHmida @gkatsev yeah I think the 'usage' section of readme may be wrong.

the module seems to export function parse(manifestString, options) {

yet the usage says parse(manifest, manifestURL)

AwokeKnowing avatar Dec 11 '20 15:12 AwokeKnowing

Yup, looks like it was changed at one point and the example and docs never got updated.

Here's an example usage: https://github.com/videojs/http-streaming/blob/0976212d8c447b80904a8d1b5f8323579b875be2/src/dash-playlist-loader.js#L41-L45

I think passing the manifestUri as part of the options object is important.

gkatsev avatar Dec 11 '20 20:12 gkatsev