SourceBuffer.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright (c) 2024, Jelle Raaijmakers <jelle@ladybird.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/DOM/EventTarget.h>
  8. namespace Web::MediaSourceExtensions {
  9. // https://w3c.github.io/media-source/#dom-sourcebuffer
  10. class SourceBuffer : public DOM::EventTarget {
  11. WEB_PLATFORM_OBJECT(SourceBuffer, DOM::EventTarget);
  12. GC_DECLARE_ALLOCATOR(SourceBuffer);
  13. public:
  14. void set_onupdatestart(GC::Ptr<WebIDL::CallbackType>);
  15. GC::Ptr<WebIDL::CallbackType> onupdatestart();
  16. void set_onupdate(GC::Ptr<WebIDL::CallbackType>);
  17. GC::Ptr<WebIDL::CallbackType> onupdate();
  18. void set_onupdateend(GC::Ptr<WebIDL::CallbackType>);
  19. GC::Ptr<WebIDL::CallbackType> onupdateend();
  20. void set_onerror(GC::Ptr<WebIDL::CallbackType>);
  21. GC::Ptr<WebIDL::CallbackType> onerror();
  22. void set_onabort(GC::Ptr<WebIDL::CallbackType>);
  23. GC::Ptr<WebIDL::CallbackType> onabort();
  24. protected:
  25. SourceBuffer(JS::Realm&);
  26. virtual ~SourceBuffer() override;
  27. virtual void initialize(JS::Realm&) override;
  28. private:
  29. };
  30. }