// if SourceBuffer is exposed ensure its API is valid // safari and old version of Chrome doe not expose SourceBuffer globally so checking SourceBuffer.prototype is impossible const sourceBufferValidAPI = !sourceBuffer || (sourceBuffer.prototype && typeof sourceBuffer.prototype.appendBuffer === 'function' && typeof sourceBuffer.prototype.remove === 'function'); return !!isTypeSupported && !!sourceBufferValidAPI; }