void SourceBuffer::Abort(ErrorResult& aRv) { MOZ_ASSERT(NS_IsMainThread()); MSE_API("Abort()"); if (!IsAttached()) { aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); return; } if (mMediaSource->ReadyState() != MediaSourceReadyState::Open) { aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR); return; } AbortBufferAppend(); ResetParserState(); mCurrentAttributes.SetAppendWindowStart(0); mCurrentAttributes.SetAppendWindowEnd(PositiveInfinity<double>()); }
void SourceBuffer::AppendError(bool aDecoderError) { MOZ_ASSERT(NS_IsMainThread()); ResetParserState(); mUpdating = false; QueueAsyncSimpleEvent("error"); QueueAsyncSimpleEvent("updateend"); if (aDecoderError) { Optional<MediaSourceEndOfStreamError> decodeError( MediaSourceEndOfStreamError::Decode); ErrorResult dummy; mMediaSource->EndOfStream(decodeError, dummy); } }