files/en-us/web/api/sourcebuffer/remove/index.md
{{APIRef("Media Source Extensions")}}{{AvailableInWorkers("window_and_dedicated")}}
The remove() method of the {{domxref("SourceBuffer")}}
interface removes media segments within a specific time range from the
SourceBuffer. This method can only be called when
{{domxref("SourceBuffer.updating")}} equals false. If
SourceBuffer.updating is not equal to false, call
{{domxref("SourceBuffer.abort()")}}.
remove(start, end)
start
end
None ({{jsxref("undefined")}}).
InvalidAccessError {{domxref("DOMException")}}
NaN, the start parameter is negative or greater than {{domxref("MediaSource.duration")}}, or the end parameter is less than or equal to start or equal to NaN.InvalidStateError {{domxref("DOMException")}}
true, or this SourceBuffer has been removed
from {{domxref("MediaSource")}}.TBD.
{{Specifications}}
{{Compat}}