HTMLMediaElement.idl 1.8 KB

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