HTMLMediaElement.idl 2.0 KB

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