Closed onotole closed 6 years ago
Hi bbert, I like your idea with for more generic utf-16 detection. Alternatively, to take in account possible BOM or Endianness, we could just check 4 first byte and deduct utf-16 if one of the bytes is zero. This would be totally robust for distinguishing utf-8 from utf-16 for xml data.
Hi @onotole, Could you update this PR according to what we discussed? Can you propose your method to detect UTF-16 and move it to utils folder?
Hi, I have picked up isUTF16() function implemented in TextTTMLXMLMP4SourceBuffer as a utility function, and then use it for PlayReady message format detection. Let me know if it is ok for you, so that I can merge.
verified with Orange VOD with subtitles on Edge and IE 11
Hi, I am not sure the way you detect encoding is robust. There is already a method that is implemented in the project for detecting character encoding, used by https://github.com/Orange-OpenSource/hasplayer.js/blob/development/app/js/streaming/captioning/TextTTMLXMLMP4SourceBuffer.js. May be we could use the same method if suitable. Then move it to utils folder and use it.