HTMLMediaElement.idl 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #import <HTML/HTMLElement.idl>
  2. #import <HTML/VideoTrackList.idl>
  3. enum CanPlayTypeResult {
  4. "",
  5. "maybe",
  6. "probably"
  7. };
  8. // https://html.spec.whatwg.org/multipage/media.html#htmlmediaelement
  9. [Exposed=Window]
  10. interface HTMLMediaElement : HTMLElement {
  11. // network state
  12. [Reflect, CEReactions] attribute DOMString src;
  13. const unsigned short NETWORK_EMPTY = 0;
  14. const unsigned short NETWORK_IDLE = 1;
  15. const unsigned short NETWORK_LOADING = 2;
  16. const unsigned short NETWORK_NO_SOURCE = 3;
  17. readonly attribute unsigned short networkState;
  18. undefined load();
  19. CanPlayTypeResult canPlayType(DOMString type);
  20. // ready state
  21. const unsigned short HAVE_NOTHING = 0;
  22. const unsigned short HAVE_METADATA = 1;
  23. const unsigned short HAVE_CURRENT_DATA = 2;
  24. const unsigned short HAVE_FUTURE_DATA = 3;
  25. const unsigned short HAVE_ENOUGH_DATA = 4;
  26. readonly attribute unsigned short readyState;
  27. readonly attribute boolean seeking;
  28. // playback state
  29. attribute double currentTime;
  30. readonly attribute unrestricted double duration;
  31. readonly attribute boolean paused;
  32. readonly attribute boolean ended;
  33. [Reflect, CEReactions] attribute boolean autoplay;
  34. [Reflect, CEReactions] attribute boolean loop;
  35. Promise<undefined> play();
  36. undefined pause();
  37. // controls
  38. [Reflect, CEReactions] attribute boolean controls;
  39. // tracks
  40. [SameObject] readonly attribute VideoTrackList videoTracks;
  41. };