tedconf / node-m3u8

Streaming parser for m3u8 files in node
MIT License
189 stars 77 forks source link

Unreachable Code in parser.js #10

Closed tjenkinson closed 8 years ago

tjenkinson commented 9 years ago

I was trying to figure out what line 49 in parser.js was doing as it doesn't make sense to me. Looking into it further it looks like the condition in the if statement will never be true anyway, as the uri property will only ever get set on the .properties object not .attributes.

https://github.com/tedconf/node-m3u8/blob/8a1f140b2842d4ca2075584dc2f574bace8b0348/parser.js#L48

I'm on windows and tried to run the tests with ./node_modules/.bin/mocha --reporter list test/*.js test/acceptance/*.js but get an error saying Error: Cannot find module 'should'

bog commented 8 years ago

This line handles non-playlist items commonly found in master/variant playlists for MediaItems. Excepted example from https://hls.ted.com/talks/1.m3u8:

#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="600k",LANGUAGE="eng",NAME="Audio",AUTOSELECT=YES,DEFAULT=YES,URI="/talks/1/audio/600k.m3u8",BANDWIDTH=614400
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",LANGUAGE="sq",NAME="Albanian",AUTOSELECT=YES,DEFAULT=NO,FORCED=NO,URI="/talks/1/subtitles/sq.m3u8"