diff --git a/dom/base/nsGkAtomList.h b/dom/base/nsGkAtomList.h index de891601f0..19182dfcc6 100644 --- a/dom/base/nsGkAtomList.h +++ b/dom/base/nsGkAtomList.h @@ -2332,3 +2332,13 @@ GK_ATOM(onboundary, "onboundary") #endif GK_ATOM(vr_state, "vr-state") + +// MSE +GK_ATOM(onsourceopen, "onsourceopen") +GK_ATOM(onsourceended, "onsourceended") +GK_ATOM(onsourceclosed, "onsourceclosed") +GK_ATOM(onupdatestart, "onupdatestart") +GK_ATOM(onupdate, "onupdate") +GK_ATOM(onupdateend, "onupdateend") +GK_ATOM(onaddsourcebuffer, "onaddsourcebuffer") +GK_ATOM(onremovesourcebuffer, "onremovesourcebuffer") diff --git a/dom/media/mediasource/MediaSource.h b/dom/media/mediasource/MediaSource.h index 6f6790813b..4ed5cb458f 100644 --- a/dom/media/mediasource/MediaSource.h +++ b/dom/media/mediasource/MediaSource.h @@ -72,6 +72,11 @@ public: static bool IsTypeSupported(const GlobalObject&, const nsAString& aType); static bool Enabled(JSContext* cx, JSObject* aGlobal); + + IMPL_EVENT_HANDLER(sourceopen); + IMPL_EVENT_HANDLER(sourceended); + IMPL_EVENT_HANDLER(sourceclosed) + /** End WebIDL Methods. */ NS_DECL_ISUPPORTS_INHERITED diff --git a/dom/media/mediasource/SourceBuffer.h b/dom/media/mediasource/SourceBuffer.h index 8cc0ac3988..fe69489c2c 100644 --- a/dom/media/mediasource/SourceBuffer.h +++ b/dom/media/mediasource/SourceBuffer.h @@ -180,6 +180,13 @@ public: void AbortBufferAppend(); void Remove(double aStart, double aEnd, ErrorResult& aRv); + + IMPL_EVENT_HANDLER(updatestart); + IMPL_EVENT_HANDLER(update); + IMPL_EVENT_HANDLER(updateend); + IMPL_EVENT_HANDLER(error); + IMPL_EVENT_HANDLER(abort); + /** End WebIDL Methods. */ NS_DECL_ISUPPORTS_INHERITED diff --git a/dom/media/mediasource/SourceBufferList.h b/dom/media/mediasource/SourceBufferList.h index 1d408e0752..a101b78e7a 100644 --- a/dom/media/mediasource/SourceBufferList.h +++ b/dom/media/mediasource/SourceBufferList.h @@ -36,6 +36,10 @@ public: SourceBuffer* IndexedGetter(uint32_t aIndex, bool& aFound); uint32_t Length(); + + IMPL_EVENT_HANDLER(addsourcebuffer); + IMPL_EVENT_HANDLER(removesourcebuffer); + /** End WebIDL methods. */ NS_DECL_ISUPPORTS_INHERITED diff --git a/dom/webidl/MediaSource.webidl b/dom/webidl/MediaSource.webidl index 95a7026fe9..63691e090d 100644 --- a/dom/webidl/MediaSource.webidl +++ b/dom/webidl/MediaSource.webidl @@ -28,6 +28,9 @@ interface MediaSource : EventTarget { readonly attribute MediaSourceReadyState readyState; [SetterThrows] attribute unrestricted double duration; + attribute EventHandler onsourceopen; + attribute EventHandler onsourceended; + attribute EventHandler onsourceclosed; [NewObject, Throws] SourceBuffer addSourceBuffer(DOMString type); [Throws] diff --git a/dom/webidl/SourceBuffer.webidl b/dom/webidl/SourceBuffer.webidl index aaae3e412d..9104d0b69a 100644 --- a/dom/webidl/SourceBuffer.webidl +++ b/dom/webidl/SourceBuffer.webidl @@ -31,6 +31,11 @@ interface SourceBuffer : EventTarget { attribute double appendWindowStart; [SetterThrows] attribute unrestricted double appendWindowEnd; + attribute EventHandler onupdatestart; + attribute EventHandler onupdate; + attribute EventHandler onupdateend; + attribute EventHandler onerror; + attribute EventHandler onabort; [Throws] void appendBuffer(ArrayBuffer data); [Throws] diff --git a/dom/webidl/SourceBufferList.webidl b/dom/webidl/SourceBufferList.webidl index badbfd8252..15c302622a 100644 --- a/dom/webidl/SourceBufferList.webidl +++ b/dom/webidl/SourceBufferList.webidl @@ -13,5 +13,7 @@ [Func="mozilla::dom::MediaSource::Enabled"] interface SourceBufferList : EventTarget { readonly attribute unsigned long length; + attribute EventHandler onaddsourcebuffer; + attribute EventHandler onremovesourcebuffer; getter SourceBuffer (unsigned long index); };