Skip to content

Stop TypeError when chunk.mediaType === fragmentedText

Created by: davemevans

2ff50a08 in #674 did not fix the case where chunk is required to be passed to TextSourceBuffer.append - getIsTextTrack did not resolve correctly for fragmentedText and TypeError was thrown in append since chunk was not passed correctly.

I chose to fix this using hasOwnProperty to search for a property which should never appear on the native version. The other option I considered was using Function.length to determine the number of arguments append would accept. Both seem smelly, but it seems unlikely a native SourceBuffer will ever have a getTextTrackExtensions method.

This fix enables playback of http://rdmedia.bbc.co.uk/dash/ondemand/elephants_dream/1/client_manifest-all.mpd which used to work and was subsequently broken.

EDIT: checking for fragmentedText in getIsTextTrack isn't really an option since getIsTextTrack expects a mimeType and the mimeType is not know at this point. The ideal fix is not to vary the number of arguments to supposedly identical methods.

Merge request reports