imgèŠçŽ usemap屿§ããã€å ŽåïŒã€ã³ã¿ã©ã¯ãã£ãã³ã³ãã³ããalt - ç»åãå©çšäžå¯ã®é䜿çšãã眮æããã¹ãsrc - ãªãœãŒã¹ã®ã¢ãã¬ã¹crossorigin â èŠçŽ ãcrossoriginèŠæ±ãåŠçããæ¹æ³usemap - 䜿çšããã€ã¡ãŒãžãããã®åå ismap - ç»åããµãŒãåŽã€ã¡ãŒãžãããã§ãããã©ããwidth - æšªã®æ¬¡å
height - çžŠã®æ¬¡å
imgèŠçŽ ã®alt屿§å€ã空ã§ããïŒalt=""ïŒå Žåã¯presentationããŒã«ã®ã¿ãããã§ãªããã°ä»»æã®ããŒã«å€ãaria-*屿§ã[NamedConstructor=Image(optional unsigned long width, optional unsigned long height)]
interface HTMLImageElement : HTMLElement {
attribute DOMString alt;
attribute DOMString src;
attribute DOMString crossOrigin;
attribute DOMString useMap;
attribute boolean isMap;
attribute unsigned long width;
attribute unsigned long height;
readonly attribute unsigned long naturalWidth;
readonly attribute unsigned long naturalHeight;
readonly attribute boolean complete;
};
imgèŠçŽ ã¯ç»åã衚ãã
src屿§ã§æå®ãããç»åã¯åã蟌ãŸããã³ã³ãã³ãã§ãããalt屿§ã®å€ã¯ãç»åã®åŠçãç»åã®èªã¿èŸŒã¿ãç¡å¹ã«ãã人ã«å¯Ÿããåçã®ã³ã³ãã³ããæäŸããã
alt屿§ã®å€ã«é¢ããèŠä»¶ã¯ã次ç¯ã§èª¬æãããã
src屿§ã¯ååšããªããã°ãªãããç»åãªãœãŒã¹ã¯æœåšçã«ããŒãžåãã¹ã¯ãªããåããããŠããªããä»»æã§ã¢ãã¡ãŒã·ã§ã³ã§ãããé察話åãåç
§ããæœåšçã«ã¹ããŒã¹ã§å²ãŸãã劥åœãªç©ºã§ãªãURLãå«ããªããã°ãªããªãã
äžèšã®èŠä»¶ã¯ãç»åãéçããããããïŒããšãã°PNGãGIFãJPEGïŒãåäžããŒãžã®ãã¯ã¿ãŒææžïŒåäžããŒãžã®PDFãSVGã«ãŒãèŠçŽ ãæã€XMLãã¡ã€ã«ïŒãã¢ãã¡ãŒã·ã§ã³ããããããïŒAPNGãã¢ãã¡ãŒã·ã§ã³GIFïŒãã¢ãã¡ãŒã·ã§ã³ãã¯ã¿ãŒã°ã©ãã£ãã¯ã¹ïŒå®£èšåSMILã¢ãã¡ãŒã·ã§ã³ã䜿çšããSVGã«ãŒãèŠçŽ ãæã€XMLãã¡ã€ã«ïŒãªã©ã§ããããšãæå³ããããããããããã®å®çŸ©ã¯ãã¹ã¯ãªããã䌎ãSVGãã¡ã€ã«ãè€æ°ããŒãžã®PDFãã¡ã€ã«ãã€ã³ã¿ã©ã¯ãã£ãMNGãã¡ã€ã«ãHTMLææžããã¬ãŒã³ããã¹ãææžãªã©ãæé€ããã[PNG] [GIF] [JPEG] [PDF] [XML] [APNG] [SVG] [MNG]
imgèŠçŽ ã¯ãã¬ã€ã¢ãŠãããŒã«ãšããŠäœ¿çšããŠã¯ãªããªããç¹ã«ãç»åã¯ãã£ãã«æå³ããã³ææžã«æçšãªãã®ã远å ããªãã®ã§ãimgèŠçŽ ã¯ãéæãªç»åã衚瀺ããããã«äœ¿çšãã¹ãã§ãªãã
crossorigin屿§ã¯CORSèšå®å±æ§ã§ããããã®ç®çã¯ãã¯ãã¹ãªãªãžã³ãªã¢ã¯ã»ã¹ã«canvasãšãšãã«äœ¿çšã§ãããµãŒãããŒãã£ã®ãµã€ãããã®ç»åãèš±å¯ããããšã§ããã
An img is always in one of the following states:
When an img element is either in the partially
available state or in the completely available state, it is
said to be available.
An img element is initially unavailable.
When an img element is available, it
provides a paint source whose width is the image's intrinsic width, whose height is
the image's intrinsic height, and whose appearance is the intrinsic appearance of the image.
In a browsing context where scripting is disabled, user agents may obtain images immediately or on demand. In a browsing context where scripting is enabled, user agents must obtain images immediately.
A user agent that obtains images immediately must synchronously update the image
data of an img element whenever that element is created with a src attribute.
A user agent that obtains images immediately must also synchronously
update the image data of an img element whenever that element has its
src or crossorigin attribute set, changed, or removed.
A user agent that obtains images on demand must update the image data of an
img element whenever it needs the image data (i.e. on demand), but only if the
img element has a src
attribute, and only if the img element is in the
unavailable state. When an img element's src or crossorigin attribute set, changed, or removed, if the user
agent only obtains images on demand, the img element must return to the unavailable state.
Each img element has a last selected source, which must initially be
null, and a current pixel density, which must initially be undefined.
When an img element has a current pixel density that is not 1.0, the
element's image data must be treated as if its resolution, in device pixels per CSS pixels, was
the current pixel density.
For example, if the current pixel density is 3.125, that means that there are 300 device pixels per CSS inch, and thus if the image data is 300x600, it has an intrinsic dimension of 96 CSS pixels by 192 CSS pixels.
Each Document object must have a list of available images. Each image
in this list is identified by a tuple consisting of an absolute URL, a CORS
settings attribute mode, and, if the mode is not No
CORS, an origin. User agents may copy entries from one Document
object's list of available images to another at any time (e.g. when the
Document is created, user agents can add to it all the images that are loaded in
other Documents), but must not change the keys of entries copied in this way when
doing so. User agents may also remove images from such lists at any time (e.g. to save
memory).
When the user agent is to update the image data of an img element, it
must run the following steps:
Return the img element to the unavailable
state.
If an instance of the fetching algorithm is still running for this element, then abort that algorithm, discarding any pending tasks generated by that algorithm.
Forget the img element's current image data, if any.
If the user agent cannot support images, or its support for images has been disabled, then abort these steps.
src attribute specified and
its value is not the empty string, let selected source be the value of the
element's src attribute, and selected pixel
density be 1.0. Otherwise, let selected source be null and selected pixel density be undefined.
Let the img element's last selected source be selected source and the img element's current pixel
density be selected pixel density.
If selected source is not null, run these substeps:
Resolve selected source, relative to the element. If that is not successful, abort these steps.
Let key be a tuple consisting of the resulting absolute
URL, the img element's crossorigin
attribute's mode, and, if that mode is not No CORS,
the Document object's origin.
If the list of available images contains an entry for key, then set the img element to the completely
available state, update the presentation of the image appropriately, queue a
task to fire a simple event named load at the
img element, and abort these steps.
Asynchronously await a stable state, allowing the task that invoked this algorithm to continue. The synchronous section consists of all the remaining steps of this algorithm until the algorithm says the synchronous section has ended. (Steps in synchronous sections are marked with â.)
â If another instance of this algorithm for this img element was started
after this instance (even if it aborted and is no longer running), then abort these steps.
Only the last instance takes effect, to avoid multiple requests when, for
example, the src
and crossorigin attributes are all set in
succession.
â If selected source is null, then set the element to the broken state, queue a task to fire a simple
event named error at the img element, and
abort these steps.
â Queue a task to fire a progress event named loadstart at
the img element.
â Do a potentially CORS-enabled fetch of the absolute
URL that resulted from the earlier step, with the mode being the current state of the
element's crossorigin content attribute, the origin being the origin of the img element's
Document, and the default origin behaviour set to taint.
The resource obtained in this fashion, if any, is the img element's image data.
It can be either CORS-same-origin or CORS-cross-origin; this affects
the origin of the image itself (e.g. when used on a canvas).
Fetching the image must delay the load event of the element's document until the task that is queued by the networking task source once the resource has been fetched (defined below) has been run.
This, unfortunately, can be used to perform a rudimentary port scan of the user's local network (especially in conjunction with scripting, though scripting isn't actually necessary to carry out such an attack). User agents may implement cross-origin access control policies that are stricter than those described above to mitigate this attack, but unfortunately such policies are typically not compatible with existing Web content.
If the resource is CORS-same-origin, each task
that is queued by the networking task source
while the image is being fetched must fire a progress
event named progress at the img
element.
End the synchronous section, continuing the remaining steps asynchronously, but without missing any data from the fetch algorithm.
As soon as possible, jump to the first applicable entry from the following list:
multipart/x-mixed-replaceThe next task that is queued by the networking task source while the image is being fetched must set the img element's state to partially available.
Each task that is queued by the networking task source while the image is being fetched must update the presentation of the image, but as each new
body part comes in, it must replace the previous image. Once one body part has been completely
decoded, the user agent must set the img element to the completely available state and queue a task to fire
a simple event named load at the img
element.
The progress and loadend events are not fired for
multipart/x-mixed-replace image streams.
The next task that is queued by the networking task source while the image is being fetched must set the img element's state to partially available.
That task, and each subsequent task, that is queued by the networking task source while the image is being fetched must update the presentation of the image appropriately (e.g. if the image is a progressive JPEG, each packet can improve the resolution of the image).
Furthermore, the last task that is queued by the networking task source once the resource has been fetched must additionally run the steps for the matching entry in the following list:
Set the img element to the completely
available state.
Add the image to the list of available images using the key key.
If the resource is CORS-same-origin: fire a progress event
named load at the img element.
If the resource is CORS-cross-origin: fire a simple event named
load at the img element.
If the resource is CORS-same-origin: fire a progress event
named loadend at the img element.
If the resource is CORS-cross-origin: fire a simple event named
loadend at the img element.
If the resource is CORS-same-origin: fire a progress event
named load at the img element.
If the resource is CORS-cross-origin: fire a simple event named
load at the img element.
If the resource is CORS-same-origin: fire a progress event
named loadend at the img element.
If the resource is CORS-cross-origin: fire a simple event named
loadend at the img element.
Either the image data is corrupted in some fatal way such that the image dimensions cannot
be obtained, or the image data is not in a supported file format; the user agent must set the
img element to the broken state, abort the fetching algorithm, discarding any pending tasks generated by that algorithm, and then queue a
task to first fire a simple event named error at the img element and then fire a simple
event named loadend at the img
element.
While a user agent is running the above algorithm for an element x, there
must be a strong reference from the element's Document to the element x, even if that element is not in its
Document.
When an img element is in the completely available
state and the user agent can decode the media data without errors, then the
img element is said to be fully decodable.
Whether the image is fetched successfully or not (e.g. whether the response code was a 2xx code or equivalent) must be ignored when determining the image's type and whether it is a valid image.
This allows servers to return images with error responses, and have them displayed.
The user agent should apply the image sniffing rules to determine the type of the image, with the image's associated Content-Type headers giving the official type. If these rules are not applied, then the type of the image must be the type given by the image's associated Content-Type headers.
User agents must not support non-image resources with the img element (e.g. XML
files whose root element is an HTML element). User agents must not run executable code (e.g.
scripts) embedded in the image resource. User agents must only display the first page of a
multipage resource (e.g. a PDF file). User agents must not allow the resource to act in an
interactive fashion, but should honor any animation in the resource.
This specification does not specify which image types are to be supported.
What an img element represents depends on the src attribute and the alt
attribute.
src attribute is set and the alt attribute is set to the empty stringThe image is either decorative or supplemental to the rest of the content, redundant with some other information in the document.
If the image is available and the user agent is configured to display that image, then the element represents the element's image data.
Otherwise, the element represents nothing, and may be omitted completely from the rendering. User agents may provide the user with a notification that an image is present but has been omitted from the rendering.
src attribute is set and the alt attribute is set to a value that isn't emptyThe image is a key part of the content; the alt attribute
gives a textual equivalent or replacement for the image.
If the image is available and the user agent is configured to display that image, then the element represents the element's image data.
Otherwise, the element represents the text given by the alt attribute. User agents may provide the user with a notification
that an image is present but has been omitted from the rendering.
src attribute is set and the alt attribute is notThere is no textual equivalent of the image available.
If the image is available and the user agent is configured to display that image, then the element represents the element's image data.
Otherwise, the user agent should display some sort of indicator that there is an image that is not being rendered, and may, if requested by the user, or if so configured, or when required to provide contextual information in response to navigation, provide caption information for the image, derived as follows:
If the image is a descendant of a figure element that has a child
figcaption element, and, ignoring the figcaption element and its
descendants, the figure element has no Text node descendants other
than inter-element whitespace, and no embedded content descendant
other than the img element, then the contents of the first such
figcaption element are the caption information; abort these steps.
There is no caption information.
src attribute is not set and either the alt attribute is set to the empty string or the alt attribute is not set at allThe element represents nothing.
The element represents the text given by the alt attribute.
The alt attribute does not represent advisory information.
User agents must not present the contents of the alt attribute
in the same way as content of the title attribute.
While user agents are encouraged to repair cases of missing alt attributes, authors must not rely on such behavior. Requirements for providing text to act as an alternative for images are described
in detail below.
The contents of img elements, if any, are ignored for the purposes of
rendering.
usemap屿§ãååšããå Žåãç»åãé¢é£ä»ããããã€ã¡ãŒãžãããã瀺ãããšãã§ããã
href屿§ãæã€aèŠçŽ ã®åå«ã§ããèŠçŽ ã§äœ¿çšãããå Žåãismap屿§ã¯ãèŠçŽ ããµãŒããŒãµã€ãã®ã€ã¡ãŒãžããããžã®ã¢ã¯ã»ã¹ãæäŸããããšã«ãã£ãŠããã®ååšã瀺ããããã¯ãã€ãã³ãã察å¿ããaèŠçŽ ã§ã©ã®ããã«åŠçããããã«åœ±é¿ããã
ismap屿§ã¯çåœå±æ§ã§ããã屿§ã¯ãhref屿§ãæã€ç¥å
aèŠçŽ ãæããªãèŠçŽ ã«æå®ããŠã¯ãªããªãã
imgèŠçŽ ã¯ã寞æ³å±æ§ããµããŒãããã
The alt, src
IDL attributes must reflect the
respective content attributes of the same name.
The crossOrigin IDL attribute must
reflect the crossorigin content attribute,
limited to only known values.
The useMap IDL attribute must
reflect the usemap content attribute.
The isMap IDL attribute must reflect
the ismap content attribute.
width [ = value ]height [ = value ]ãããã®å±æ§ã¯ãå®éã®ã¬ã³ããªã³ã°ãããç»åã®å€§ããããŸãã¯å¯žæ³ãæªç¥ã§ããå Žåã«0ãè¿ãã
察å¿ããã³ã³ãã³ã屿§ã倿Žããããã«ãèšå®ãå¯èœã§ããã
naturalWidthnaturalHeightãããã®å±æ§ã¯ãç»åã®å åšå¯žæ³ããŸãã¯å¯žæ³ãæªç¥ã®å Žåã«0ãè¿ãã
completeç»åãå®å šã«ããŠã³ããŒããããŠããå ŽåããŸãã¯ãäœãç»åãæå®ãããªãå Žåã«trueãè¿ããããã§ãªããã°ãfalseãè¿ãã
Image( [ width [, height ] ] )該åœããå Žåãé©åãªåŒæ°ã§æž¡ãããå€ã«èšå®ãããwidthãšheight屿§ãæã€ãæ°ããimgèŠçŽ ãè¿ãã
The IDL attributes width and height must return the rendered width and height of the
image, in CSS pixels, if the image is being rendered, and is being rendered to a
visual medium; or else the intrinsic width and height of the image, in CSS pixels, if the image is
available but not being rendered to a visual medium; or else 0, if
the image is not available. [CSS]
On setting, they must act as if they reflected the respective content attributes of the same name.
The IDL attributes naturalWidth and naturalHeight must return the intrinsic width and
height of the image, in CSS pixels, if the image is available, or
else 0. [CSS]
The IDL attribute complete must return true if
any of the following conditions is true:
src attribute is omitted.
img element is completely available.
img element is broken.
Otherwise, the attribute must return false.
The value of complete can thus change while
a script is executing.
A constructor is provided for creating HTMLImageElement objects (in addition to
the factory methods from DOM such as createElement()): Image(width, height).
When invoked as a constructor, this must return a new HTMLImageElement object (a new
img element). If the width argument is present, the new object's
width content attribute must be set to width. If the height argument is also present, the new object's
height content attribute must be set to height. The element's document must be the active document of the
browsing context of the Window object on which the interface object of
the invoked constructor is found.
ããã¹ãã«ããä»£æ¿ [WCAG]ã¯ãèŠèŠæ å ±ãã¢ã¯ã»ã·ãã«ã«ããããã®æãéèŠãªæ¹æ³ã§ãããããã«ãããŠãŒã¶ãŒã®ããŒãºã«åãããã«ãä»»æã®æèŠæ§åŒïŒããšãã°ãèŠèŠãèŽèŠãè§ŠèŠïŒãä»ããŠã¬ã³ããªã³ã°ã§ããã®ã§ãããããã¹ãã«ãã代æ¿ãæäŸããããšã¯ãæ å ±ãããŸããŸãªãŠãŒã¶ãŒãšãŒãžã§ã³ãã«ãã£ãŠæ§ã ãªæ¹æ³ã§ã¬ã³ããªã³ã°ããããšãå¯èœã«ãããããšãã°ãç»åãèŠãããšãã§ããªã人ã¯ãåæé³å£°ã䜿çšããŠããã¹ãã«ãã代æ¿ãèªã¿äžããããããšãã§ããã
ç»åã®alt屿§ã¯éåžžã«éèŠãªã¢ã¯ã»ã·ããªãã£ãŒå±æ§ã§ãããæçšãªalt屿§ã³ã³ãã³ããäœæããããšã¯ãç»åãåºçŸããã³ã³ããã¹ãããã³ãã®ã³ã³ããã¹ãã«ãããŠç»åãæã£ãŠãããæ©èœãèè
ã«æ³šææ·±ãèæ
®ããããšãèŠæ±ããããããå«ãã¬ã€ãã³ã¹ã¯ãèè
ãç»åã䜿çšãããã£ãšãäžè¬çãªæ¹æ³ãæ±ãã远å ã®ã¬ã€ãã³ã¹ããã³ãã¯ããã¯ã¯Resources on Alternative Text for Imagesã§å©çšå¯èœã§ããã
ç¹ã«æå®ãããŠããå Žåãé€ããalt屿§ãæå®ããªããã°ãªããããã®å€ã空ã§ãã£ãŠã¯ãªããªããå€ã¯ç»åã«å¯ŸããŠé©åãªçœ®æã§ãªããã°ãªããªããalt屿§ã«å¯Ÿããå
·äœçãªèŠä»¶ã¯ã以äžã®ç¯ã§èª¬æããããã«ãããŒãžã§ã®ç»åã®æ©èœã«äŸåããã
é©åãªããã¹ãã«ãã代æ¿ã倿ããããã«ãç»åãããŒãžã«å«ãŸããŠããçç±ãèããããšãéèŠã§ããããã®ç®çã¯äœãïŒãã®ããã«èããããšã¯ãèªè ã«æå³ããç»åã«é¢ããŠäœãéèŠããçè§£ããã®ã«åœ¹ç«ã€ããã¹ãŠã®ç»åã¯ãæçšãªæ å ±ãæäŸãããæ©èœãå®è¡ãããã€ã³ã¿ã©ã¯ãã£ããªèŠçŽ ãåé¡ãããçŸæèãé«ãããŸãã¯çŽç²ã«è£ 食çãšãã£ãããŒãžäžã«ååšããçç±ãæã€ããããã£ãŠãç»åãäœã®ããã«ååšããã®ããçè§£ããããšã¯ãé©åãªããã¹ãã«ãã代æ¿ã®èšè¿°ã容æã«ããã
ãã€ããŒãªã³ã¯ããŸãã¯buttonèŠçŽ ããã€aèŠçŽ ããããã¹ãã³ã³ãã³ãããªãã1ã€ä»¥äžã®ç»åãå«ãå Žåãalt屿§ããªã³ã¯ããã¿ã³ã®ç®çãåæã«äŒããããã¹ããå«ãã
ãã®äŸã§ã¯ããŠãŒã¶ãŒã¯ã3ã€ã®ãªã¹ããã奜ã¿ã®è²ãéžæããããæ±ããããŠãããç»åã«ãã£ãŠããããã®è²ã¯äžããããããç»åã衚瀺ã§ããªããŠãŒã¶ãŒã®ããã«ãç»åã®alt屿§ã®äžã«è²ã®ååãå«ãŸããŠããã
![]()
<ul> <li><a href="red.html"><img src="red.jpeg" alt="Red"></a></li> <li><a href="green.html"><img src="green.jpeg" alt="Green"></a></li> <li><a href="blue.html"><img src="blue.jpeg" alt="Blue"></a></li> </ul>
ãã®äŸã§ã¯ãaèŠçŽ ã®ãªã³ã¯ã¯ããŽãå«ãããªã³ã¯ã¯å€éšãµã€ãããW3Cã®ãŠã§ããµã€ããæããããã¹ãã«ãã代æ¿ã¯ãªã³ã¯å ã®ç°¡åãªèª¬æã§ããã
![]()
<a href="http://w3.org"> <img src="images/w3c_home.png" width="72" height="48" alt="W3C web site"> </a>
ãªã³ã¯ãW3Cã®ãŠã§ããµã€ãã«ããããšãé€ããŠããã®äŸã¯åã®äŸãšåãã§ãããããã¹ãã«ãã代æ¿ã¯ãªã³ã¯å ã®ç°¡åãªèª¬æã§ããã
![]()
<a href="http://w3.org"> <img src="images/w3c_home.png" width="72" height="48" alt="W3C home"> </a>
ããŽã®ç»åã䜿çšããã³ã³ããã¹ãã«äŸåããããšã¯ãç»åãããã¹ãã«ãã代æ¿ã®äžéšãšããŠã®ããŽã§ããããšã®æç€ºãæäŸããããã«é©åã ããã4.7.1.1.19 ããŽãèšå·ãæããŸãã¯ãšã³ãã¬ã ã®ç¯ãåç §ã®ããšã
ãã®äŸã«ãããŠãaèŠçŽ ã®ãªã³ã¯ããã¬ãã¥ãŒã¢ã€ã³ã³ãå«ãããªã³ã¯ã¯å°å·çšã¹ã¿ã€ã«ã·ãŒããé©çšããããŒãžãæããããã¹ãã«ãã代æ¿ã¯ãªã³ã¯å ã®ç°¡åãªèª¬æã§ããã
![]()
<a href="preview.html"> <img src="images/preview.png" width="32" height="30" alt="Print preview."> </a>
ãã®äŸã§ããã¿ã³ã¯æ€çŽ¢ã¢ã€ã³ã³ãå«ãã§ããããã¿ã³ã¯æ€çŽ¢ãã©ãŒã ãéä¿¡ãããããã¹ãã«ãã代æ¿ã¯ãã¿ã³ãäœããããã®ç°¡åãªèª¬æã§ããã
![]()
<button> <img src="images/search.png" width="74" height="29" alt="Search"> </button>
ãã®äŸã«ãããŠãPIP瀟ã®äŒç€Ÿã®ããŽã¯2ã€ã®ç»åã«åå²ãããŠããã1æç®ã¯åèªPIPãå«ã¿ã2æç®ã¯ç¥èªCOããã€ãç»åã¯ãPIPCOã®ããŒã ããŒãžãžã®ãªã³ã¯ã«å±ããå¯äžã®ã³ã³ãã³ãã§ããããã®å Žåããªã³ã¯å
ã®ç°¡åãªèª¬æãæäŸããããåäžã®å®äœãšããŠç»åã¯ãŠãŒã¶ãŒã«æäŸãããã®ã§ãæåã®ç»åã®alt屿§ã«ãããããã¹ãã«ãã代æ¿ã¯PIP CO homeã§ããã


<a href="pipco-home.html"> <img src="pip.gif" alt="PIP CO home"><img src="co.gif" alt=""> </a>
ããšãã°ãããŒãã£ãŒããå³è¡šãã°ã©ãããŸãã¯æ¹è§ã瀺ãå°å³ãªã©ãšããŠãã°ã©ã圢åŒã§ã³ã³ãã³ãã衚瀺ãããéã«ãŠãŒã¶ãŒã¯æ©æµãåããã ãããã°ã©ã圢åŒã§æç€ºãããã³ã³ãã³ããããã¹ã圢åŒã§æäŸãããå ŽåããŠãŒã¶ãŒããŸãå©çãåŸãããã®ãŠãŒã¶ãŒã¯ãç»åã衚瀺ã§ããªã人ãã¡ãå«ããïŒããšãã°ãéåžžã«äœéãªæ¥ç¶ã§ããããŸãã¯ããã¹ãã®ã¿ã®ãã©ãŠã¶ã䜿çšããŠããããŸãã¯ãã³ãºããªãŒèªåè»é³å£°ãŠã§ããã©ãŠã¶ã«ãã£ãŠèªã¿åºãããããŒãžãèããŠããããããã¯ãèŠèŠé害ãæã¡ãããã¹ããé³å£°ã«ã¬ã³ããªã³ã°ããæ¯æŽæè¡äœ¿çšããŠãããããïŒ
次ã®åã°ã©ãã®ç»åäŸã«ãããŠãåã°ã©ãã«è¡šç€ºãããããŒã¿ã衚ãalt屿§ã§ããã¹ãããã€ïŒ

<img src="piechart.gif" alt="Pie chart: Browser Share - Internet Explorer 25%, Firefox 40%, Chrome 25%, Safari 6% and Opera 4%.">
ãã®å Žåãã°ã©ãã£ã«ã«ãªåœ¢åŒã§ç»åãåã®æ®µèœãç¹°ãè¿ããalt屿§ã³ã³ãã³ãã¯ç»åãåé¡ããã
<p>According to a recent study Firefox has a 40% browser share, Internet Explorer has 25%, Chrome has 25%, Safari has 6% and Opera has 4%.</p> <p><img src="piechart.gif" alt="Pie chart representing the data in the previous paragraph."></p>
ããšãã°src屿§å€ãééã£ãŠãããããç»åãå©çšã§ããªãå Žåã«ãããã¹ãã«ãã代æ¿ãç»åã³ã³ãã³ãã®ç°¡åãªèª¬æããŠãŒã¶ãŒã«æäŸããã®ãèŠãããïŒ

ããã¹ãã«ãã代æ¿ãé·ããªãå Žåã«ãããŠã1ã€ä»¥äžã®æã¯ãæ§é åããŒã¯ã¢ããã䜿çšããããšã®æ©æµãåããã ãããç°¡åãªèª¬æãŸãã¯alt屿§ã䜿çšããã©ãã«ãããã³é¢é£ä»ãããã代æ¿ããã¹ããæäŸããã
ããã¯ãalt屿§ã«å«ãŸããçãããã¹ãã«ãã代æ¿ãããããŒãã£ãŒãç»åã®äŸã§ããããã®å Žåãããã¹ãã«ãã代æ¿ã¯ç»åãå¯äžã®ãªã³ã¯å
容ãšããŠãªã³ã¯å
ã®èª¬æãšãªãããªã³ã¯ã¯ããããŒãã£ãŒãã§è¡šãããããã»ã¹ã®ãåãææžã®äžã§èª¬æãæãã

<a href="#desc"><img src="flowchart.gif" alt="Flowchart: Dealing with a broken lamp."></a> ... ... <div id="desc"> <h2>Dealing with a broken lamp</h2> <ol> <li>Check if it's plugged in, if not, plug it in.</li> <li>If it still doesn't work; check if the bulb is burned out. If it is, replace the bulb.</li> <li>If it still doesn't work; buy a new lamp.</li> </ol> </div>
ãã®äŸã§ã¯ãã°ã©ãã®ç»åãååšãããæ
å ±ãããŒã¿éåã§ãããããalt屿§ã§ãã¬ãŒã³ããã¹ãã«ãã代æ¿ãšããŠã°ã©ãã«ç€ºãããæ
å ±ãæäŸããããšã¯äžé©åã§ãããã°ã©ãç»åã§è¡šãããããŒã¿ã䜿çšããããŒã¿ããŒãã«ã®åœ¢åŒã§ç»åã®äžã«ãæ§é åãããããã¹ãã«ãã代æ¿ã代ããã«æäŸãããã

åã·ãŒãºã³ã®æé«ããã³æäœééšã®è¡šç€ºã衚ã«å«ãŸããŠãããããã°ã©ãã§å®¹æã«èå¥ãããåŸåãããŒã¿ããŒãã«ã«ãå©çšã§ããã
| United Kingdom | Japan | Australia | |
|---|---|---|---|
| Spring | 5.3 (highest) | 2.4 | 2 (lowest) |
| Summer | 4.5 (highest) | 3.4 | 2 (lowest) |
| Autumn | 3.5 (highest) | 1.8 | 1.5 (lowest) |
| Winter | 1.5 (highest) | 1.2 | 1 (lowest) |
<figure> <figcaption>Rainfall Data</figcaption> <img src="rainchart.gif" alt="Bar chart: Average rainfall in millimetres by Country and Season."> <table> <caption>Rainfall in millimetres by Country and Season.</caption> <tr><td><th scope="col">UK <th scope="col">Japan<th scope="col">Australia</tr> <tr><th scope="row">Spring <td>5.5 (highest)<td>2.4 <td>2 (lowest)</tr> <tr><th scope="row">Summer <td>4.5 (highest)<td>3.4<td>2 (lowest)</tr> <tr><th scope="row">Autumn <td>3.5 (highest) <td>1.8 <td>1.5 (lowest)</tr> <tr><th scope="row">Winter <td>1.5 (highest) <td>1.2 <td>1 lowest</tr> </table> </figure>
figureèŠçŽ ã¯ãæ£ã°ã©ãç»åããã³ããŒã¿ã®ããŒãã«ãã°ã«ãŒãåããããã«äœ¿çšããããfigcaptionèŠçŽ ã¯ãã°ã«ãŒãåãããã³ã³ãã³ãã«å¯Ÿãããã£ãã·ã§ã³ãæäŸããã
æãšããŠç»åã¯ããã¹ãã®ã¿ãå«ã¿ããããŠç»åã®ç®çã¯ãèŠèŠå¹æãšãã©ã³ãã®äž¡æ¹ãŸãã¯ããããäžæ¹ãå©çšããããã¹ãã衚瀺ããããšã«ãããCSSãçšããã¹ã¿ã€ã«ä»ãããã¹ãã䜿çšããããšãåŒ·ãæšå¥šãããããããäžå¯èœãªå Žåãç»åã§ããããŸãŸã«alt屿§ã§åãããã¹ããæäŸããã
ãã®äŸã¯ãããã¹ãã®ç»åã"Get Happy!"ãšè¡šç€ºãããæŽŸæãªè²ãšãã©ãã®ããªãŒãã³ãé¢šã«æžãããŠãããç»åã¯èŠåºãã®å å®¹ãæ§æããããã®äŸã«ãããŠãç»åã®ããã¹ãã«ãã代æ¿ã¯"Get Happy!"ãšãã¹ãã§ããã

<h1><img src="gethappy.gif" alt="Get Happy!"></h1>
ãã®äŸã§ã¯ãããã¹ããããªãåºåç»åã§ããããã¬ãŒãº"The BIG sale"ã3åç¹°ãè¿ãããåãéããããšã«ããã¹ãã¯ããå°ãããã€ããæããªããæåŸã®è¡ã¯"...ends Friday"ãšèªããåºåãšããŠãã³ã³ããã¹ãã«ããã䜿çšã¯ãç»åã®ããã¹ãã«ãã代æ¿ã¯äžåºŠã ãããã¹ã"The BIG sale"ãå«ãããšãæšå¥šããããèŠèŠå¹æãšããã¹ãã®ç¹°ãè¿ãã¯ãç»åã衚瀺ã§ããªããŠãŒã¶ãŒã«ãšã£ãŠäžèŠã§ãããæ··ä¹±ãæããããããªãã

<p><img src="sale.gif" alt="The BIG sale ...ends Friday."></p>
ããã¹ãã®ç»åãšäžç·ã«åçãŸãã¯ä»ã®ã°ã©ãã£ãã¯ãååšããç¶æ³ã«ãããŠãæ å ±ããŸãç»åã衚瀺ã§ããªããŠãŒã¶ãŒã«ã䜿çšã§ããããã«ãç»åã衚瀺ã§ãããŠãŒã¶ãŒã«æå³ãäŒããç»åã®ä»ã®èª¬æãšãšãã«ãããã¹ãã«ãã代æ¿ã«å«ãŸããŠããç»åããã¹ãå ã®åèªãä¿èšŒããã
ç»åãUnicodeã§è¡šçŸã§ããªãæåã衚ãããã«å¥ã®æ¹æ³ã§äœ¿çšãããå Žåãããšãã°å€åãç°äœåããŸãã¯æ°èŠã®é貚èšå·ã®ãããªæ°ããæåã«ãããŠãããã¹ãã«ãã代æ¿ã¯ãããšãã°ãæåã®çºé³ãäžããããã«è¡šé³ã®ã²ãããªãã«ã¿ã«ãã䜿çšãããªã©ãåããã®ãèšè¿°ããããäŒçµ±çãªæ¹æ³ã§ããã¹ãã§ããã
1997幎ããã®ãã®äŸã«ãããŠãäžå€®ã®2ã€ã®ããŒãšãšãã«æžŠå·»ãç¶ã®Eã®ããã«èŠããææ°åŒã®é貚èšå·ã®ãããã«ãç»åã䜿çšããŠè¡šçŸãããã代æ¿ããã¹ãã¯ãæåã®çºé³ãäžããã
Only
5.99!
<p>Only <img src="euro.png" alt="euro ">5.99!
Unicodeæåãåãç®çãæãããªãã°ç»åã䜿çšãã¹ãã§ãªããããšãã°è£ 食ã®ããããæåãUnicodeæåéåã«ãªãïŒå€åã®å Žåã®ãããªïŒæåã§ãããããªã©ãããã¹ããçŽæ¥Unicodeã䜿çšããŠè¡šãããšãã§ããªãå Žåã«ã®ã¿ãç»åãé©åã ããã
ããã©ã«ãã®ã·ã¹ãã ãã©ã³ããæå®ãããæåããµããŒãããªããããèè ãç»åã䜿çšããããã«èªæãããå ŽåããŠã§ããã©ã³ãã¯ç»åãããåªãã解決çã§ããã
è£ é£Ÿåæ¬ã¯ããã®æåã®äžéšã®ã°ã©ãã£ãã¯ã¹ã䜿çšãããããããªãããã®ãããªç¶æ³ã§ããã¹ãã«ãã代æ¿ã¯ãåã«ç»åã衚ãæåã§ããã
nce upon a time and a long long time ago...
<p><img src="initials/fancyO.png" alt="O">nce upon a time and a long long time ago...
æãšããŠãç»åã¯ã°ã©ãããã³é¢é£ããããã¹ãã®ãããªã°ã©ãã£ãã¯ã¹ãæ§æããããã®å Žåãããã¹ãã«ãã代æ¿ã«ç»åå ã®ããã¹ããå«ããããšãæšå¥šããã
åã°ã©ããšé¢é£ããããã¹ããå«ãç»åãèããŠã¿ããããã¹ãã®ç»åã§ãªããä»»æã®é¢é£ããããã¹ããå¯èœãªéãããã¹ããšããŠæäŸããããšãæšå¥šããããããäžå¯èœãªå Žåãç»åã§äŒããããé¢é£æ å ±ãšãšãã«ããã¹ãã«ãã代æ¿å ã®ããã¹ããå«ãã

<p><img src="figure1.gif" alt="Figure 1. Distribution of Articles by Journal Category. Pie chart: Language=68%, Education=14% and Science=18%."></p>
åãåã°ã©ãã®ç»åã®ãã1ã€ã®äŸã§ã¯ãalt屿§ãšé·ã代æ¿ããã¹ãã«å«ãŸããçãããã¹ãã«ãã代æ¿ã衚瀺ãããfigureããã³figcaptionèŠçŽ ã¯ãç»åãšããé·ãããã¹ãã«ãã代æ¿ãé¢é£ä»ããããã«äœ¿çšããããalt屿§ã¯ãç»åã«ã©ãã«ä»ãããããã«äœ¿çšãããã
<figure> <img src="figure1.gif" alt="Figure 1"> <figcaption><strong>Figure 1.</strong> Distribution of Articles by Journal Category. Pie chart: Language=68%, Education=14% and Science=18%.</figcaption> </figure>
åã®äŸãšæ¯ã¹ããã®æ¹æ³ã®å©ç¹ã¯ãããã¹ãã«ãã代æ¿ãåžžã«ãã¹ãŠã®ãŠãŒã¶ãŒã«å©çšå¯èœã§ããããšã«ããããŸããããã¹ãã«ãã代æ¿ãalt屿§ã䜿çšããŠæäŸãããªãå Žæã§ãããã¹ãã«ãã代æ¿ã§äœ¿çšãããããã«æ§é åãããããŒã¯ã¢ãããèš±å¯ããã
åšå²ã®ããã¹ãã§çŽæ¥è°è«ãããªãããäŸç¶ãšããŠäžéšã®é¢é£æ§ãæã€ç»åã¯imgèŠçŽ ã䜿çšããŠãããŒãžã«å«ããããšãå¯èœã§ããããã®ãããªç»åã¯åãªãè£
食以äžã®ãã®ã§ãããããŒããããŒãžå
容ã®äž»é¡ãè£åŒ·ããã®ã§ãå
容ã®äžéšãçžå€ããã圢æããããšãããããã®å Žåãããã¹ãã«ãã代æ¿ãæäŸããããšãæšå¥šããã
ããã¯ããŒãžå
容ã®äž»é¡ã«å¯æ¥ã«é¢é£ããããçŽæ¥èª¬æãããªãç»åã®äžäŸã§ããããã®è©©ã®æå±ããŒãžã§ãè©©ã«è§Šçºãããçµµã®ç»åã§ãããæ¬¡ã®æçã¯äŸã瀺ããç»åã¯ã"Lady of Shallot"ïŒã·ã£ãããã®è²Žå©ŠäººïŒãšé¡ããçµµç»ã§ãããçµµã¯è©©ã«è§Šçºãããçµµã®äž»é¡ã¯è©©ããæŽŸçããŠããããããã£ãŠãããã¹ãã«ãã代æ¿ãæäŸãããããšãåŒ·ãæšå¥šãããalt屿§ã«ç»åã®å
容ã®çã説æããããæã®äžã«é·ã説æãžã®ãªã³ã¯ããããé·ã説æã®æåŸã«çµµã«ã€ããŠã®è©³ããæ
å ±ãžã®ãªã³ã¯ãããã

<header> <h1>The Lady of Shalott</h1> <p>A poem by Alfred Lord Tennyson</p> </header> <img src="shalott.jpeg" alt="Painting of a young woman with long hair, sitting in a wooden boat. "> <p><a href="#des">Description of the painting</a>.</p> <!-- Full Recitation of Alfred, Lord Tennyson's Poem. --> ... ... ... <p id="des">The woman in the painting is wearing a flowing white dress. A large piece of intricately patterned fabric is draped over the side. In her right hand she holds the chain mooring the boat. Her expression is mournful. She stares at a crucifix lying in front of her. Beside it are three candles. Two have blown out. <a href="http://bit.ly/5HJvVZ">Further information about the painting</a>.</p>
ãã®äŸã¯ãããŒãžã®äž»é¡ã®åçãšããŠç»åãèå¥ããããã¹ãã«ãã代æ¿ã®æäŸã説æããã

<img src="orateur_robin_berjon.png" alt="Portrait photo(black and white) of Robin.">
<h1>Robin Berjon</h1>
<p>What more needs to be said?</p>
å€ãã®å Žåãç»åã¯å®éã«ã¯åãªãè£è¶³ã§ããããã®ååšã¯åã«åšå²ã®ããã¹ãã匷調ããã ãã§ããããã®å Žåãalt屿§ãååšããªããã°ãªããªããããã®å€ã¯ç©ºæååã§ãªããã°ãªããªãã
äžè¬ã«ç»åã¯ãç»åãåé€ããŠãããŒãžã®æçšæ§ã匱ãŸãããã§ãªãå Žåã«ãã®ã«ããŽãªã«åé¡ãããããç»åãå«ããããšã¯ãèŠèŠãã©ãŠã¶ã®ãŠãŒã¶ãŒã«ãšã£ãŠæŠå¿µãçè§£ããããšãã¯ããã«å®¹æã«ãªãã
ç»åã®æçšãªããã¹ãã«ãã代æ¿ãèšè¿°ããããšã¯å¿ ããã容æã§ã¯ãªããå¥ã®ãªãã·ã§ã³ã¯ãç»åã«ã€ããŠã®è©³ããæ å ±ãžã®ãªã³ã¯ãæäŸããããšã§ããã
åãç»åã®ãã®äŸã§ã¯ãalt屿§ã«å«ãŸããçãããã¹ãã«ãã代æ¿ããããç»åã®åŸã«ãªã³ã¯ãããããªã³ã¯ã¯çµµã«é¢ããæ
å ±ãå«ãããŒãžãæãã
The Lady of Shalott
A poem by Alfred Lord Tennyson.

Full recitation of Alfred, Lord Tennyson's poem.
<header><h1>The Lady of Shalott</h1> <p>A poem by Alfred Lord Tennyson</p></header> <figure> <img src="shalott.jpeg" alt="Painting of a woman in a white flowing dress, sitting in a small boat."> <p><a href="http://bit.ly/5HJvVZ">About this painting.</a></p> </figure> <!-- Full Recitation of Alfred, Lord Tennyson's Poem. -->
çŽç²ã«è£ 食çãªç»åã¯ãèŠèŠçãªæ©èœåŒ·åãè£ é£Ÿãç»åã衚瀺ã§ãããŠãŒã¶ãŒãžã®çŸæèãè¶ ããæ©èœãæ å ±ãæäŸããªãè£ é£Ÿã§ããã
空ã®alt屿§ïŒalt=""ïŒã䜿çšããããšã«ãã£ãŠæ¯æŽæè¡ãç¡èŠã§ããããã«ãçŽç²ã«è£
食çãªç»åãããŒã¯ã¢ãããããè£
食çãªç»åãã€ã³ã©ã€ã³ã§å«ãããšãåãå
¥ããããªãããšã¯ãªãããCSSã䜿çšããç»åãå«ãããã«çŽç²ã«è£
食çã§ããããšãæšå¥šãããã
ãã人ã®ããã°ã®è£
食ãããŒãšããŠäœ¿çšãããç»åã®äŸã§ã¯ãç»åã¯äœãæ
å ±ãæäŸããªãã®ã§ã空ã®alt屿§ãæã€ã¹ãã§ããã
![]()
Clara's Blog
Welcome to my blog...
<header> <div><img src="border.gif" alt="" width="400" height="30"></div> <h1>Clara's Blog</h1> </header> <p>Welcome to my blog...</p>
ç»åãææžã§ããã¹ãã®æµãã®äžéšãšããŠã€ã³ã©ã€ã³ã§äœ¿çšãããå Žåãé¢ããŠããææžã®æèã§çã«ããªã£ãããã¹ãã«ãã代æ¿ãšããŠåèªãŸãã¯ãã¬ãŒãºãæäŸããã
I
you.
I <img src="heart.png" alt="love"> you.
My
breaks.
My <img src="heart.png" alt="heart"> breaks.
ç»åãå°ããªç»åãã¡ã€ã«ã«åå²ãããŠããå Žåãå床å®å
šãªç»åã圢æããããã«äžç·ã«è¡šç€ºãããå
šäœãšããŠç»åã«é¢é£ããã¬ã€ãã³ã¹ã«åŸã£ãŠalt屿§ã䜿çšããç»åã®ããããã«å¯Ÿããããã¹ãã«ãã代æ¿ãå«ã¿ããããŠä»ã®ç»åã§ç©ºã®alt屿§ãå«ãã
ãã®äŸã«ãããŠãPIP瀟ã®äŒç€Ÿã®ããŽã衚ãçµµã2æã«åå²ãããŠããã1æç®ã¯æå"PIP"ãå«ã¿ã2æç®ã¯åèª"CO"ãæã€ã代æ¿ããã¹ãPIP COã¯æåã®ç»åã®alt屿§ã«ããã


<img src="pip.gif" alt="PIP CO"><img src="co.gif" alt="">
次ã®äŸã«ãããŠãè©äŸ¡ã¯ã3ã€ã®å¡ãã€ã¶ãããæãšã2ã€ã®äžæãã®æãšããŠç€ºããããããã¹ãã«ãã代æ¿ã¯"â
â
â
ââ"ãããããªããã代ããã«èè
ã¯ããã芪åãªåœ¢åŒ"3 out of 5"ã®è©äŸ¡ãäžããããã«ãããããã¯æåã®ç»åã®ããã¹ãã«ãã代æ¿ã§ãããæ®ãã¯ç©ºã®alt屿§ãæã€ã
![]()
<p>Rating: <meter max=5 value=3> <img src="1" alt="3 out of 5"> <img src="1" alt=""><img src="1" alt=""> <img src="0" alt=""><img src="0" alt=""> </meter></p>
imgèŠçŽ ããhref屿§ãæã€areaèŠçŽ ãå«ãmapèŠçŽ ãåç
§ããusemap屿§ãæã€å Žåãimgã¯ã€ã³ã¿ã©ã¯ãã£ãã³ã³ãã³ãã§ãããšèŠãªãããããã®ãããªå Žåãalt屿§ã䜿çšããŠç»åã®ããã¹ãã«ãã代æ¿ãåžžã«æäŸããã
ã«ãã¥ãŒã³ãã®å°å³ã§ãã以äžã®ç»åãèãããå°å³ãååã«ãã¥ãŒã³ãã®é åã«å¯Ÿå¿ãã2ã€ã®ã€ã³ã¿ã©ã¯ãã£ãé åãæã€ã

ããã¹ãã«ãã代æ¿ã¯ãç»åã®ç°¡åãªèª¬æã§ãããåareaèŠçŽ ã®alt屿§ã¯ããããããªã³ã¯ãããå°åã®ã¿ãŒã²ããããŒãžã®ã³ã³ãã³ãã説æããããã¹ããæäŸããã
<p>View houses for sale in North Katoomba or South Katoomba:</p> <p><img src="imagemap.png" width="209" alt="Map of Katoomba" height="249" usemap="#Map"> <map name="Map"> <area shape="poly" coords="78,124,124,10,189,29,173,93,168,132,136,151,110,130" href="north.html" alt="Houses in North Katoomba"> <area shape="poly" coords="66,63,80,135,106,138,137,154,167,137,175,133,144,240,49,223,17,137,17,61" alt="Houses in South Katoomba" href="south.html"> </map>
äžè¬ã«ã€ã¡ãŒãžãããã¯ããªã³ã¯çšã®ç»åãã¹ã©ã€ã¹ãã代ããã«äœ¿çšãããã¹ãã§ããã
è€æ°ç»åããåæåçãäœæããå Žåãç»åã®1ã€ä»¥äžããªã³ã¯ããããšæããããããªãããªã³ã¯ã®ç®çã説æããããã«ãåãªã³ã¯ãããç»åã«å¯ŸããŠalt屿§ãæäŸããã
次ã®äŸã«ãããŠãåæåçã¯"Crocoduck"ã瀺ãããã«äœ¿çšããããããã¯ãã¯ãã®äžéšãšã¢ãã«ã®äžéšã«ãã£ãŠé²åã®ååãç¡èŠããæ¶ç©ºã®çãç©ã§ãããCrocoduckãšäº€æµããããã«æ±ããŠããããçšå¿ããå¿ èŠãããã


<h1>The crocoduck</h1> <p>You encounter a strange creature called a "crocoduck". The creature seems angry!Perhaps some friendly stroking will help to calm it, but be careful not to stroke any crocodile parts. This would just enrage the beast further.</p> <a href="?stroke=head"><img src="crocoduck1.png" alt="Stroke crocodile's angry, chomping head"></a> <a href="?stroke=body"><img src="crocoduck2.png" alt="Stroke duck's soft, feathery body"></a>
åçãã°ã©ãã£ãã¯ã¹ç»åã¯ãèŠèŠãªããžã§ã¯ãã®è¡šçŸã人ã颚æ¯ãæœè±¡åãªã©ãå«ãŸããããã®éããã¹ãã³ã³ãã³ã [WCAG] ã¯ãèŠèŠçã«å€§éã®æ å ±ãäŒããããæŽçŒè ã«ç¹å®ã®æèŠçãªäœéš [WCAG]ãæäŸã§ãããäŸãšããŠã¯ãåçãçµµç»ãå³é¢ãã¢ãŒãã¯ãŒã¯ãå«ãŸããã
ç»åã«å¯Ÿããé©åãªããã¹ãã«ãã代æ¿ã¯ãç°¡åãªèª¬æãŸãã¯èå¥åã§ãã[WCAG]ããã¹ãŠã®ããã¹ãã«ãã代æ¿ã®ãªãŒãµãªã³ã°å€å®ã®ããã«ãç»åã«å¯ŸããŠé©åãªããã¹ãã«ãã代æ¿ãæžãããšã¯äººéã®å€æãå¿
èŠãšãããããã¹ãå€ã¯ãç»åã䜿çšãããã³ã³ããã¹ããšããŒãžäœè
ã®æäœã®äž»èгçãªãã®ã§ããããããã£ãŠãç¹å®ã®ç»åã«å¯Ÿããaltããã¹ãã®'æ£ãã'ãã®ã¯ãªããéããã¹ãã³ã³ãã³ãã®ç°¡åãªèª¬æãäžããçãããã¹ãã«ãã代æ¿ã®æäŸã«å ããŠãé©åãªæçšã§ããå Žåã«ãå¥ã®ãã®ãä»ããŠè£è¶³çã³ã³ãã³ãã®æäŸãæå³ããã
ãã®äŸã¯ãåçå
±æãµã€ãã«ã¢ããããŒãããç»åã瀺ããåçã¯é¢šåã«åº§ã£ãŠããç«ã§ãããç»åã¯ãimgèŠçŽ ã®alt屿§ãçšããŠæäŸãããããã¹ãã«ãã代æ¿ãæã€ããŸããfigureèŠçŽ ããã³ãã£ãã·ã§ã³ããã¹ããèå¥ããããã®figcaptionèŠçŽ ã䜿çšãããã®ã§imgèŠçŽ ãå«ãããšã§ããã£ãã·ã§ã³ãæäŸããã

Lola prefers a bath to a shower.
<figure> <img src="664aef.jpg" alt="Lola the cat sitting under an umbrella in the bath tub."> <figcaption>Lola prefers a bath to a shower.</figcaption> </figure>
ç»åã®äž»é¡ãè§£éãèªç±ã§ããããããã®äŸã¯å®å
šãªèšè¿°ãåãä»ããªãç»åã§ãããç»åã衚瀺ã§ããªããŠãŒã¶ãŒã«ã©ã®ãããªç»åã§ããããæäŸããalt屿§ã§ããã¹ãã«ãã代æ¿ãç»åã¯æã€ãç»åã¯ãŸããfigureèŠçŽ ã«ãããŠimgèŠçŽ ãå«ããããã³ãã£ãã·ã§ã³ããã¹ããèå¥ããããã«figcaptionèŠçŽ ã䜿çšããããšã«ãã£ãŠãæäŸããããã£ãã·ã§ã³ãæã€ã

ããŒã«ã·ã£ãããã¹ãã«ããã10æã®ã«ãŒãã®æåã®ãã®ã
<figure> <img src="Rorschach1.jpg" alt="An abstract, freeform, vertically symmetrical, black inkblot on a light background."> <figcaption>The first of the ten cards in the Rorschach test.</figcaption> </figure>
ãŠã§ãã«ã¡ã©ã®ç»åã¯ãèªåã§å®æçã«æŽæ°ãããéçãªç»åã§ãããäžè¬ã«ç»åã¯åºå®ãããå Žæããã®ãã®ã§ãããããããæ°ããç»åãã«ã¡ã©ããã¢ããããŒãããããããŸãã¯ãŠãŒã¶ãŒãæŽæ°ãããç»åã衚瀺ããã«ããŒãžãåèªã¿èŸŒã¿ããå¿ èŠãããã®ã§ãç»åã¯èªåçã«ããŒãžäžã§æŽæ°ããŠããããäŸãšããŠã¯ã亀éããã³å€©æ°ã«ã¡ã©ãªã©ãããã
ãã®äŸã¯ããªãå
žåçã§ãããã¿ã€ãã«ãšã¿ã€ã ã¹ã¿ã³ãã¯ç»åã«å«ãŸããèªåçã«ãŠã§ãã«ã¡ã©ã®ãœãããŠã§ã¢ã«ãã£ãŠçæããããããã¹ãæ
å ±ãç»åã«å«ãŸããŠããªãã£ãå Žåã«ããè¯ãããããã¹ãæ
å ±ã¯ç»åã®äžéšã§ããã®ã§ãããã¹ãã«ãã代æ¿ã®äžéšãšããŠããã¹ãæ
å ±ãå«ãããã£ãã·ã§ã³ã¯ãŸããfigureããã³figcaptionèŠçŽ ã䜿ã£ãŠæäŸããããç»åã¯å»ºç©è¿ãã®çŸåšã®å€©æ°ã«ã€ããŠèŠèŠæ
å ±ãäŒããããã«æäŸããããããŠã§ãã«ã¡ã©ã®ç»åãèªåçã«çæãããŠã¢ããããŒããããã®ã§ãå°å
ã®å€©æ°äºå ±ãæäŸããããªã³ã¯ããããã¹ãã«ãã代æ¿ãšããŠãã®ãããªæ
å ±ãæäŸããããšã¯å®çšçã§ãªãã ããã
alt屿§ã®ããã¹ãã¯ãé³å£°ãœãããŠã§ã¢ãžã®ããã¹ãã«ãã£ãŠç¥ãããå Žåã«ããã¹ããããããããããããããã«èšèšããããã¿ã€ã ã¹ã¿ã³ãã®å調ãªããŒãžã§ã³ãå«ããæ°è±¡æ¡ä»¶ã𿥿ãå€åããã«ãããããããããã¹ãã«ãã代æ¿ã¯ãŸããå€åããªãç»åã§èŠãããããšã®äžéšã®åŽé¢ã®èšè¿°ãå«ãã

View from the top of Sopwith house, looking towards North Kingston. This image is updated every hour.
View the latest weather details for Kingston upon Thames.
<figure> <img src="webcam1.jpg" alt="Sopwith house weather cam. Taken on the 21/04/10 at 11:51 and 34 seconds. In the foreground are the safety rails on the flat part of the roof. Nearby there are low rise industrial buildings, beyond are blocks of flats. In the distance there's a church steeple."> <figcaption>View from Sopwith house, looking towards north Kingston. This image is updated every hour.</figcaption> </figure> <p>View the <a href="http://news.bbc.co.uk/weather/forecast/4296?area=Kingston">latest weather details</a> for Kingston upon Thames.</p>
äžéšã®ã±ãŒã¹ã«ãããŠãç»åã¯å
¬éãããææžã«å«ãŸããããèè
ãé©åãªããã¹ãã«ãã代æ¿ãæäŸããããšãã§ããªãããã®ãããªå Žåã«ãããæå°èŠä»¶ã¯ã以äžã®æ¡ä»¶ã®ããšã§figureããã³figcaptionèŠçŽ ãçšããŠç»åã®ãã£ãã·ã§ã³ãæäŸããããšã§ããã
figureèŠçŽ å
ã®imgèŠçŽ
figureèŠçŽ ã¯figcaptionèŠçŽ ãå«ã
figcaptionèŠçŽ ã¯ãèŠçŽ å
ç©ºçœæå以å€ã®ã³ã³ãã³ããå«ã
figcaptionèŠçŽ ãšãã®åå«ãç¡èŠããfigureèŠçŽ ã¯ãèŠçŽ å
ç©ºçœæå以å€ã®TextããŒãã®åå«ãæããããã€imgèŠçŽ ä»¥å€ã®ãšã³ããã£ããã³ã³ãã³ãã®åå«ãæããªãã
èšãæããã°ãfigureã®æè¯ã®ã³ã³ãã³ãã¯ãimgèŠçŽ ãšfigcaptionèŠçŽ ã§ããããã€figcaptionèŠçŽ ã¯ïŒãã£ãã·ã§ã³ïŒã³ã³ãã³ããå«ãŸãªããã°ãªããªãã
ãã®ãããªå Žåã¯æå°éã«ä¿ãããã¹ãã§ãããå®éã®ä»£æ¿ããã¹ããæäŸããèœåãæããèè
ã®ããããªå¯èœæ§ãããå Žåãalt屿§ã®çç¥ã蚱容ããªãã ããã
ãã®äŸã«ãããŠãåçå ±æãµã€ãã«å€æ°ã®ç»åã®ãããªãã«ã¯ã¢ããããŒãã®äžéšãšããŠããã人ãåçãã¢ããããŒãããããŠãŒã¶ãŒã¯ãããã¹ãã«ãã代æ¿ãŸãã¯ç»åã®ãã£ãã·ã§ã³ãæäŸããŠããªãããµã€ãã®ãªãŒãµãªã³ã°ããŒã«ã¯ãç»åã«å¯ŸããŠæã£ãŠããæçšãªæ å ±ã䜿ã£ãŠãã£ãã·ã§ã³ãèªåçã«æ¿å ¥ããããã®å Žåã«ãããŠãããã¯ãã¡ã€ã«åããã³ãåçãæ®åœ±ãããæ¥ä»ã§ããã

clara.jpg, taken on 12/11/2010.
<figure> <img src="clara.jpg"> <figcaption>clara.jpg, taken on 12/11/2010.</figcaption> </figure>
ãã®äŸã§ãããã§ããéãå€ãã®æçšãªæ
å ±ãäŸç¶ãšããŠfigcaptionèŠçŽ ã«å«ãŸããããšã«æ³šæããã
次ã®2çªç®ã®äŸã«ãããŠããã人ãåçå
±æãµã€ãã«åçãã¢ããããŒãããã圌女ã¯ãããã¹ãã«ãã代æ¿ã§ãªããç»åã®ãã£ãã·ã§ã³ãæäŸããŠããããµã€ãã¯alt屿§ã§ããã¹ãã«ãã代æ¿ã远å ããæ©èœããŠãŒã¶ãŒã«æäŸããŠããªãããããã®å¯èœæ§ãããã

Eloisa with Princess Belle
<figure> <img src="elo.jpg"> <figcaption>Eloisa with Princess Belle</figcaption> </figure>
æãšããŠç»åå šäœã®èŠç¹ã¯ãããã¹ãã®èª¬æãå©çšã§ããããŠãŒã¶ãŒã説æãæäŸãããããäžã€ã®äŸã¯ãç»åã衚瀺ããæ£ãã代æ¿ããã¹ãããã€ããŒãžãæžãç®çã«å¯ŸããŠæ£ç¢ºã«ä»£æ¿ããã¹ããæ±ãããœãããŠã§ã¢ã ããããã®ãããªããŒãžã¯æ¬¡ã®ããã«ãç»åã®ããŒãã«ãæã€ããšãã§ããïŒ
<table> <tr><tr> <th> Image <th> Description<tr> <td> <figure> <img src="2421.png"> <figcaption>Image 640 by 100, filename 'banner.gif'</figcaption> </figure> <td> <input name="alt2421"> <tr> <td> <figure> <img src="2422.png"> <figcaption>Image 200 by 480, filename 'ad3.gif'</figcaption> </figure> <td> <input name="alt2422"> </table>
ïŒããšãã°ç®ãèŠããªãããããªã©ïŒäžéšã®ãŠãŒã¶ãŒã¯äžåç»åã䜿çšããããšãã§ããªãã®ã§ãalt屿§ã¯ãäžèšã®äŸã®ããã«ãå
šãããã¹ãã«ãã代æ¿ãå©çšã§ããã誰ãå©çšã§ããªãéã«çç¥ããããšãèš±å¯ãããã
äžè¬ã«ãèè
ã¯ç»åã衚瀺ãã以å€ã®ç®çã§imgèŠçŽ ã䜿çšããããšã¯é¿ããã¹ãã§ããã
ããšãã°ããŒãžãã¥ãŒãã«ãŠã³ããããµãŒãã¹ã®äžéšãšããŠçšãããªã©ãç»åã衚瀺ãã以å€ã®ç®çã§imgèŠçŽ ã䜿çšããå Žåã空ã®alt屿§ã䜿çšããã
ãŠã§ãããŒãžã®çµ±èšæ
å ±ãåéããããã«äœ¿çšãããimgèŠçŽ ã®äŸã瀺ããç»åã«æå³ããªãã®ã§alt屿§ã¯ç©ºã§ããã
<img src="http://server3.stats.com/count.pl?NeonMeatDream.com" width="0" height="0" alt="">
äžèšäŸã®ããã«0ã«èšå®ããwidthããã³height屿§ã䜿çšããããæšå¥šãããã
ãã1ã€ã®çšäŸã¯ãspacer.gifã®ãããªç»åãã³ã³ãã³ãã®äœçœ®æ±ºããè£å©ããããã«äœ¿çšãããå Žåã§ãããç»åã«æå³ããªãã®ã§alt屿§ã¯ç©ºã§ããã
<img src="spacer.gif" width="10" height="10" alt="">
imgèŠçŽ ã®ä»£ããã«CSSã³ã³ãã³ããé
眮ããŠäœ¿çšããããšãæšå¥šããã
ã¢ã€ã³ã³ã¯éåžžãããã°ã©ã ãã¢ã¯ã·ã§ã³ãããŒã¿ãã¡ã€ã«ãæŠå¿µã衚ãåçŽãªçµµã§ãããã¢ã€ã³ã³ã¯ãèŠèŠãã©ãŠã¶ã®ãŠãŒã¶ãŒã«äžç®ã§æ©èœãèªèããã®ãå©ããããšãæå³ããã
ã¢ã€ã³ã³ãåãæå³ãäŒããããã¹ããè£è¶³ããéã«ç©ºã®alt屿§ã䜿çšããã
ãã®äŸã§ã¯ããµã€ãã®ããŒã ããŒãžãæããªã³ã¯ã¯ãå®¶ã®ã¢ã€ã³ã³ç»åãšããã¹ã"home"ãå«ããç»åã¯ã空ã®altããã¹ããæã€ãç»åããã®æ¹æ³ã§äœ¿çšãããå ŽåãCSSã䜿çšããŠç»åã远å ããããšãé©åã§ãããã ããã
![]()
<a href="home.html"><img src="home.gif" width="15" height="15" alt="">Home</a>
#home:before
{
content: url(home.png);
}
<a href="home.html" id="home">Home</a>
ãã®äŸã§ã¯ãèŠåã¢ã€ã³ã³ã䌎ãèŠåã¡ãã»ãŒãžã衚瀺ããŠãããåèª"Warning!"ã¯ã¢ã€ã³ã³ã®æ¬¡ã®åŒ·èª¿ããã¹ãã§ãããã¢ã€ã³ã³ã«ãã£ãŠäŒããããæ
å ±ãåé·ã§ãããããimgèŠçŽ ã¯ç©ºã®alt屿§ãäžããããã
Warning! Your session is about to expire.
<p><img src="warning.png" width="15" height="15" alt=""> <strong>Warning!</strong> Your session is about to expire</p>
ã¢ã€ã³ã³ãããã¹ãã§äœ¿çšã§ããªãè¿œå æ å ±ãäŒããå Žåãããã¹ãã«ãã代æ¿ãæäŸããã
ãã®äŸã§ã¯ãèŠåã¢ã€ã³ã³ã䌎ãèŠåã¡ãã»ãŒãžã衚瀺ããŠãããã¢ã€ã³ã³ã¯ã¡ãã»ãŒãžã®éèŠæ§ã匷調ããç¹å®ã®å 容åãšããŠèå¥ããã
Your session is about to expire.
<p><img src="warning.png" width="15" height="15" alt="Warning!"> Your session is about to expire</p>
å€ãã®ããŒãžã¯ãäŒç€Ÿãçµç¹ããããžã§ã¯ãããã³ãããœãããŠã§ã¢ããã±ãŒãžãåœããŸãã¯ãã®ä»å£äœã衚ãããŽãèšå·ãæããŸãã¯ãšã³ãã¬ã ãå«ããé©åãªããã¹ãã«ãã代æ¿ãšããŠèããããšãã§ãããã®ã¯ããã¹ãŠã®ç»åã®ããã«ã䜿çšãããŠããç»åã«ãããã³ã³ããã¹ããäžããããã³ã³ããã¹ãã§åœ¹ç«ã€æ©èœã«äŸåããã
ããŽããªã³ã¯ã®å¯äžã®ã³ã³ãã³ãã§ããå Žåãalt屿§ã§ãªã³ã¯å
ã®ç°¡åãªèª¬æãæäŸããã
ãã®äŸã¯ãHTML仿§ãžãªã³ã¯ã®å¯äžã®ã³ã³ãã³ããšããŠãHTML5ããŽã®äœ¿ç𿹿³ã瀺ãã
<a href="http://dev.w3.org/html5/spec/spec.html"> <img src="HTML5_Logo.png" alt="HTML 5.1 specification"></a>
ããšãã°ããŒãžã®èŠåºãã®ããã«ãããŽãå£äœã衚ãããã«äœ¿çšãããŠããå Žåãããã¹ãã«ãã代æ¿ãšããŠã¯ããŽã«ãã£ãŠè¡šããããã®å£äœã®ååãæäŸããã
ãã®äŸã¯ãèªèº«ã衚çŸããããã«äœ¿çšãããŠããWebPlatform.orgããŽã®äœ¿çšã瀺ãã
and other developer resources
<h2><img src="images/webplatform.png" alt="WebPlatform.org"> and other developer resources<h2>
äžèšã®äŸã«ãããããã¹ãã«ãã代æ¿ã¯ãŸããç»åã³ã³ãã³ãã®ã¿ã€ãã説æããããã«åèª"logo"ãå«ããããããªãããã®ãããªå Žåããã®æ
å ±ã衚çŸããããã«è§æ¬åŒ§ãçšããããšãææ¡ãããïŒalt="[logo] WebPlatform.org".
ããŽã衚ããã®ã®ååã®æšªã«ããŽã䜿çšãããå Žåããã®ããŽã¯è£è¶³ã§ãããããã¹ãã«ãã代æ¿ããã§ã«æäŸãããŠããããã«ç©ºã®alt屿§ãå«ããã
ãã®äŸã¯ãããŽã衚ãçµç¹åã®æšªã«ããŽããŒã¯ã®äœ¿çšã瀺ãã
WebPlatform.org
<img src="images/webplatform1.png" alt=""> WebPlatform.org
ããŽã衚ãäž»é¡ãŸãã¯å£äœã説æããããã¹ããšåæã«ããŽã䜿çšãããå ŽåãããŽã説æããããã¹ãã«ãã代æ¿ãæäŸããã
ãã®äŸã¯ãããŽã衚ãäž»é¡ã説æããããã¹ãã®æšªã«ããŽã®äœ¿ç𿹿³ã瀺ãã

HTML5 is a language for structuring and presenting content for the World Wide Web, a core technology of the Internet. It is the latest revision of the HTML standard (originally created in 1990 and most recently standardized as HTML4 in 1997) and currently remains under development. Its core aims have been to improve the language with support for the latest multimedia while keeping it easily readable by humans and consistently understood by computers and devices (web browsers, parsers etc.).
<p><img src="HTML5_Logo.png" alt="HTML5 logo: Shaped like a shield with the text 'HTML' above and the numeral '5' prominent on the face of the shield."></p> Information about HTML5
CAPTCHAïŒãã£ããã£ïŒã¯ã"Completely Automated Public Turing test to tell Computers and Humans Apart"ïŒã³ã³ãã¥ãŒã¿ãšäººéãåºå¥ããå®å šã«èªååãããå ¬éãã¥ãŒãªã³ã°ãã¹ãïŒã®ç¥ã§ãããCAPTCHA ç»åã¯ãã³ã³ãã³ããã³ã³ãã¥ãŒã¿ã§ã¯ãªã人éã«ãã£ãŠã¢ã¯ã»ã¹ãããŠããããšã確èªãããã»ãã¥ãªãã£ãŒç®çã®ããã«äœ¿çšãããããã®èªèšŒã¯ãç»åã®èŠèŠçãªæ€èšŒãä»ããŠè¡ããããCAPTCHAã¯äžè¬çã«ãæåãåèªããã€ç»åãæç€ºãããŠãŒã¶ãŒããããå ¥åãããç»åã¯éåžžãæªããããŠãããæåãèªè§£å°é£ã«ããããã«é©çšããããã€ãºãæã€ã
CAPTCHAã®ã¢ã¯ã»ã·ããªãã£ãŒãæ¹è¯ããããšã¯ç»åã®ç®çãèå¥ããŠèª¬æããããã¹ãã«ãã代æ¿ãæäŸããç¥èŠã®ããŸããŸãªçš®é¡ã®åºåã¢ãŒãã䜿çšããCAPTCHAã®ä»£æ¿åœ¢åŒãæäŸãããããšãã°ãèŠèŠçãªç»åãšãšãã«é³å£°ä»£æ¿ææ®µãæäŸãããèŠèŠçãªç»åã®ããé£ã«é³å£°ã®ãªãã·ã§ã³ãèšçœ®ãããããã¯åœ¹ç«ã€ããããã§ããµãŠã³ãã«ãŒãã®ãªã人ãèŠèŽèŠé害è ãäžéšã®å¶éãããèŽåããã€äººã«å¯ŸããŠåé¡ã§ãããããäžã€ã®æ¹æ³ã¯ãèŠèŠçãªç»åãšãšãã«è³ªåãã©ãŒã ãå«ããããšã§ãããããã¯åœ¹ç«ã€ããèªç¥é害ãæã€äººã ã«å¯ŸããŠåé¡ãšãªããããããªãã
ãã¹ãŠã®CAPTCHAã®æ¹åŒã¯ãé害ããã€ãŠãŒã¶ãŒã«å¯Ÿããå ¥åãžã®å®¹èªã§ããªãéå£ãå°å ¥ãããããCAPTCHAã®ä»£æ¿åã䜿çšããããšãåŒ·ãæšå¥šãããæŽãªãæ å ±ã¯ãW3Cã®Inaccessibility of CAPTCHAã§å©çšå¯èœã§ããã
ãã®äŸã§ã¯ãæåã®æªãã ç»åã䜿çšããCAPTCHAã®ãã¹ãã瀺ããalt屿§ã§ã®ããã¹ãã«ãã代æ¿ã¯ãç»åã³ã³ãã³ãã«ã¢ã¯ã»ã¹ã§ããªãå Žåã«ãŠãŒã¶ãŒã«å¯Ÿããæé ã説æããã

ã³ãŒãäŸ:
<img src="captcha.png" alt="If you cannot view this image an audio challenge is provided."> <!-- audio CAPTCHA option that allows the user to listen and type the word --> <!-- form that asks a question -->
Markup generators (such as WYSIWYG authoring tools) should, wherever possible, obtain a text alternative from their users. However, it is recognized that in many cases, this will not be possible.
For images that are the sole contents of links, markup generators should examine the link target to determine the title of the target, or the URL of the target, and use information obtained in this manner as the text alternative.
For images that have captions, markup generators should use the
figure and figcaption elements to provide the
image's caption.
As a last resort, implementors should either set the alt attribute to the empty string, under
the assumption that the image is a purely decorative image that
doesn't add any information but is still specific to the surrounding
content, or omit the alt attribute
altogether, under the assumption that the image is a key part of the
content.
Markup generators may specify a generator-unable-to-provide-required-alt
attribute on img elements for which they have been
unable to obtain a text alternative and for which they have therefore
omitted the alt attribute. The
value of this attribute must be the empty string. Documents
containing such attributes are not conforming, but conformance
checkers will silently
ignore this error.
This is intended to avoid markup generators from
being pressured into replacing the error of omitting the alt attribute with the even more
egregious error of providing phony text alternatives, because
state-of-the-art automated conformance checkers cannot distinguish
phony text alternatives from correct text alternatives.
Markup generators should generally avoid using the image's own file name as the text alternative. Similarly, markup generators should avoid generating text alternatives from any content that will be equally available to presentation user agents (e.g. Web browsers).
This is because once a page is generated, it will typically not be updated, whereas the browsers that later read the page can be updated by the user, therefore the browser is likely to have more up-to-date and finely-tuned heuristics than the markup generator did when generating the page.
A conformance checker must report the lack of an alt attribute as an error unless one of
the conditions listed below applies:
The img element is in a figure
element that satisfies the
conditions described above.
The img element has a (non-conforming) generator-unable-to-provide-required-alt
attribute whose value is the empty string. A conformance checker
that is not reporting the lack of an alt attribute as an error must also not
report the presence of the empty generator-unable-to-provide-required-alt
attribute as an error. (This case does not represent a case where
the document is conforming, only that the generator could not
determine appropriate alternative text â validators are not
required to show an error in this case, because such an error might
encourage markup generators to include bogus alternative text
purely in an attempt to silence validators. Naturally, conformance
checkers may report the lack of an alt attribute as an error even in the
presence of the generator-unable-to-provide-required-alt
attribute; for example, there could be a user option to report
all conformance errors even those that might be the more
or less inevitable result of using a markup generator.)
iframeèŠçŽ src - ãªãœãŒã¹ã®ã¢ãã¬ã¹srcdoc - iframeå
ã§æç»ããææžname - ãã¹ãããããã©ãŠãžã³ã°ã³ã³ããã¹ãåsandbox - ãã¹ããããã³ã³ãã³ãã®ã»ãã¥ãªãã£ãŒã«ãŒã«width - æšªã®æ¬¡å
height - çžŠã®æ¬¡å
applicationãdocumentãimgãŸãã¯presentationãaria-*屿§ãinterface HTMLIFrameElement : HTMLElement {
attribute DOMString src;
attribute DOMString srcdoc;
attribute DOMString name;
[PutForwards=value] readonly attribute DOMSettableTokenList sandbox;
attribute DOMString width;
attribute DOMString height;
readonly attribute Document? contentDocument;
readonly attribute WindowProxy? contentWindow;
};
iframeèŠçŽ ã¯ããã¹ãããããã©ãŠãžã³ã°ã³ã³ããã¹ãã衚ãã
src屿§ã¯ããã¹ãããããã©ãŠãžã³ã°ã³ã³ããã¹ããå«ãã®ã«é©åœãªããŒãžã®ã¢ãã¬ã¹ãäžããã屿§ãååšããå Žåãæœåšçã«ã¹ããŒã¹ã§å²ãŸãã劥åœãªç©ºã§ãªãURLã§ãªããã°ãªããªãã
srcdoc屿§ã¯ããã¹ãããããã©ãŠãžã³ã°ã³ã³ããã¹ããå«ãã®ã«é©åœãªããŒãžã®ã³ã³ãã³ããæäŸããã屿§ã®å€ã¯ãiframe srcdocææžã®ãœãŒã¹ã§ããã
屿§ãååšããå ŽåãHTMLææžå
ã®iframeèŠçŽ ã¯ãæå®ãããé åºã§ãsrcdocãååšãããªãã°ãæ¬¡ã®æ§æäžã®ã³ã³ããŒãã³ããæ§æããHTMLæ§æã䜿çšããå€ãæããªããã°ãªããªãã
htmlèŠçŽ ã®åœ¢åŒã§ãã«ãŒãèŠçŽ ãXMLææžå
ã®iframeèŠçŽ ã®ããã«ãsrcdoc屿§ãååšããå ŽåãXML仿§ã§ã©ãã«ä»ãdocumentçæç©ã«äžèŽããå€ãæããªããã°ãªããªãã[XML]
HTMLæ§æã«ãããŠãèè
ã¯å±æ§ã®å
容ãå
ãããã«"""ïŒU+0022ïŒæåã䜿çšããããšãåã«èŠããŠããå¿
èŠãããããããããã¹ãŠ"""ïŒU+0022ïŒããã³U+0026 AMPERSANDïŒ&ïŒæåããšã¹ã±ãŒãããããã³sandbox屿§ãæå®ããã³ã³ãã³ãã®å®å
šãªåã蟌ã¿ã確å®ã«ããå¿
èŠãããã
XHTMLæ§æã®å¶çŽã®ããã«ãXMLã®"<"ïŒU+003CïŒæåãåæ§ã«ãšã¹ã±ãŒãããå¿ èŠãããã屿§å€æ£èŠåãé²ãããã«ãäžéšã®XMLã®ç©ºçœæåâå ·äœçã«ã¯"tab"ïŒU+0009ïŒã"LF"ïŒU+000DïŒã"CR"ïŒU+000AïŒâããŸããšã¹ã±ãŒãããå¿ èŠãããã[XML]
src屿§ãšsrcdoc屿§ãäž¡æ¹ãšãã«æå®ãããå Žåãsrcdoc屿§ãåªå
ããããããã¯ãèè
ã«srcdoc屿§ããµããŒãããªãã¬ã¬ã·ãŒãŠãŒã¶ãŒãšãŒãžã§ã³ãã«å¯ŸããŠãã©ãŒã«ããã¯URLãæäŸã§ããã
When an iframe element is inserted
into a document, the user agent must create a nested browsing context, and
then process the iframe attributes for the "first time".
When an iframe element is removed
from a document, the user agent must discard the nested browsing context.
This happens without any unload events firing
(the nested browsing context and its Document are discarded, not unloaded).
Whenever an iframe element with a nested browsing context has its
srcdoc attribute set, changed, or removed, the user agent
must process the iframe attributes.
Similarly, whenever an iframe element with a nested browsing context
but with no srcdoc attribute specified has its src attribute set, changed, or removed, the user agent must
process the iframe attributes.
When the user agent is to process the iframe attributes, it must run
the first appropriate steps from the following list:
srcdoc attribute is specifiedNavigate the element's child browsing context
to a resource whose Content-Type is text/html, whose URL
is about:srcdoc, and whose data consists of the value of the attribute. The
resulting Document must be considered an iframe srcdoc document.
src attribute
specified, and the user agent is processing the iframe's attributes for the "first
time"Queue a task to run the iframe load event steps.
The task source for this task is the DOM manipulation task source.
If the value of the src attribute is missing, or its value is the empty string,
let url be the string "about:blank".
Otherwise, resolve the value of the src attribute, relative to the iframe element.
If that is not successful, then let url be the string
"about:blank". Otherwise, let url be the resulting
absolute URL.
If there exists an ancestor browsing context whose active document's address, ignoring fragment identifiers, is equal to url, then abort these steps.
Navigate the element's child browsing context to url.
Any navigation required of the user agent in the process
the iframe attributes algorithm must be completed as an explicit
self-navigation override and with the iframe element's document's
browsing context as the source browsing context.
Furthermore, if the active document of the element's child browsing context before such a navigation was not completely loaded at the time of the new navigation, then the navigation must be completed with replacement enabled.
Similarly, if the child browsing context's session history contained
only one Document when the process the iframe attributes
algorithm was invoked, and that was the about:blank Document created
when the child browsing context was created, then any navigation required of the user agent in that algorithm must be completed
with replacement enabled.
When a Document in an iframe is marked as completely
loaded, the user agent must synchronously run the iframe load event steps.
A load event is also fired at the
iframe element when it is created if no other data is loaded in it.
Each Document has an iframe load in progress flag and a mute
iframe load flag. When a Document is created, these flags must be unset for
that Document.
The iframe load event steps are as follows:
Let child document be the active document of the
iframe element's nested browsing context.
If child document has its mute iframe load flag set, abort these steps.
Set child document's iframe load in progress flag.
Fire a simple event named load at the
iframe element.
Unset child document's iframe load in progress flag.
This, in conjunction with scripting, can be used to probe the URL space of the local network's HTTP servers. User agents may implement cross-origin access control policies that are stricter than those described above to mitigate this attack, but unfortunately such policies are typically not compatible with existing Web content.
When the iframe's browsing context's active document is
not ready for post-load tasks, and when anything in the iframe is delaying the load event of the iframe's
browsing context's active document, and when the iframe's
browsing context is in the delaying load events
mode, the iframe must delay the load event of its document.
If, during the handling of the load event, the
browsing context in the iframe is again navigated, that will further delay the load event.
èŠçŽ ãäœæãããéãsrcdoc屿§ãèšå®ããããsrc屿§ãèšå®ãããŠãªãããŸãã¯èšå®ãããããã®å€ã解決ã§ããªãã®ããããã®å Žåããã©ãŠãžã³ã°ã³ã³ããã¹ãã¯åæã®about:blankããŒãžã®ãŸãŸã«ãªãã
ãŠãŒã¶ãŒããã®ããŒãžããç§»åããå Žåãiframeã®å¯Ÿå¿WindowProxyãªããžã§ã¯ãã¯ãæ°èŠDocumentãªããžã§ã¯ãã«å¯Ÿããæ°èŠWindowãªããžã§ã¯ãããããã·ãµãŒããŒã«éãããsrc屿§ã¯å€æŽãããªãã ããã
name屿§ãååšããå Žåã劥åœãªãã©ãŠãžã³ã°ã³ã³ããã¹ãåã§ãªããã°ãªããªããæå®ãããå€ã¯ããã¹ãããããã©ãŠãžã³ã°ã³ã³ããã¹ãã«ååãä»ããããã«äœ¿çšããããWhen the browsing context is created, if the attribute is present, the browsing context name must be set to the value of this attribute; otherwise, the browsing context name must be set to the empty string.
Whenever the name attribute is set, the nested
browsing context's name must be changed to
the new value. If the attribute is removed, the browsing context name must be set to
the empty string.
sandbox屿§ãæå®ãããå Žåãiframeã«ãã£ãŠãã¹ããããããããã³ã³ãã³ãã«äžé£ã®è¿œå ã®å¶éãå¯èœã«ãªãããã®å€ã¯ãASCII倧æåã»å°æåäžåºå¥ã§ããé äžåãªãŠããŒã¯ãªã¹ããŒã¹åºåãã®ããŒã¯ã³ã®ã»ããã§ãªããã°ãªããªãã蚱容ãããå€ã¯ãallow-formsãallow-pointer-lockãallow-popupsãallow-same-originãallow-scriptsãallow-top-navigationã§ããã
ãã®å±æ§ãèšå®ãããå Žåãã³ã³ãã³ãã¯äžæãªçæå
ããã®ãã®ãšããŠæ±ããããã©ãŒã ãã¹ã¯ãªããã¯ç¡å¹ãšãªãããªã³ã¯ã¯ä»ã®ãã©ãŠãžã³ã°ã³ã³ããã¹ããã¿ãŒã²ããããããšãé²ãããã©ã°ã€ã³ã¯ä¿è·ããããallow-same-originããŒã¯ãŒãã¯ãã³ã³ãã³ãã«ãŠããŒã¯ãªçæå
ã匷å¶ãã代ããã«ãã³ã³ãã³ããå®éã®çæå
ããã®ãã®ãšããŠæ±ãããããallow-top-navigationããŒã¯ãŒãã¯ãã³ã³ãã³ãã«ãããã¬ãã«ã®ãã©ãŠãžã³ã°ã³ã³ããã¹ããããã²ãŒãããããšãã§ãããallow-formsãallow-pointer-lockãallow-popupsããã³allow-scriptsããŒã¯ãŒãã¯ããã©ãŒã ããã€ã³ã¿ããã¯APIããããã¢ãããããã³ã¹ã¯ãªãããããããåæå¹ã«ããã[POINTERLOCK]
广çã«å®å
šã«ãµã³ãããã¯ã¹ãç Žå£ãããiframeãå«ãããŒãžãåã蟌ãŸããããŒãžã«ç°¡åã«sandbox屿§ãåé€ããŠåèªã¿èŸŒã¿ã§ããã®ã§ãåã蟌ãŸããããŒãžãåäžçæå
ãæã€éã«ãallow-scriptsããã³allow-same-originã®äž¡æ¹ã®ããŒã¯ãŒããå
±ã«èšå®ããã
iframeã®ãã¹ãããããã©ãŠãžã³ã°ã³ã³ããã¹ããããã²ãŒããããéããããã®ãã©ã°ã¯å¹æã®ã¿ãåããããããåé€ããããŸãã¯å
šäœã®sandbox屿§ãåé€ããããšã¯ããã§ã«èªã¿èŸŒãŸããããŒãžã«åœ±é¿ãäžããªãã
æœåšçã«æµå¯Ÿçãªãã¡ã€ã«ã¯ãiframeèŠçŽ ãå«ããã¡ã€ã«ãšåããµãŒããŒããæäŸãããã¹ãã§ã¯ãªããæ»æè
ãiframeå
ããããããçŽæ¥æµå¯Ÿã³ã³ãã³ããåã«èšªåããããšããŠãŒã¶ãŒã«çŽåŸãããããšãã§ããå Žåãæµå¯Ÿã³ã³ãã³ãããµã³ãããã¯ã¹åããããšã¯ãæå°éã®å©ããšãªããæµå¯ŸçãªHTMLã³ã³ãã³ããåå ã§çºçããå¯èœæ§ã®ããæå®³ãå¶éããããã«ãããã¯ç¬ç«ããå°çšãã¡ã€ã³ããæäŸãããã¹ãã§ãããããšãsandbox屿§ã®ä¿è·ãªãã§ããŠãŒã¶ãŒãçŽæ¥ãã®ããŒãžã蚪ããããã ãŸãå Žåã§ããå¥ã®ãã¡ã€ã³ã䜿çšããããšã¯ããã¡ã€ã«å
ã®ã¹ã¯ãªããããµã€ããæ»æã§ããªãããšãä¿èšŒããã
When an iframe element with a sandbox
attribute has its nested browsing context created (before the initial
about:blank Document is created), and when an iframe
element's sandbox attribute is set or changed while it
has a nested browsing context, the user agent must parse the sandboxing directive using the attribute's value as the input, and the iframe element's nested browsing context's
iframe sandboxing flag set as the output.
When an iframe element's sandbox
attribute is removed while it has a nested browsing context, the user agent must
empty the iframe element's nested browsing context's
iframe sandboxing flag set as the output.
ãã®äŸã«ãããŠãäžéšã®å®å šã«æªç¥ã§ãæœåšçã«æµå¯ŸçãªããŠãŒã¶ãŒãæäŸããHTMLã³ã³ãã³ãã¯ãããŒãžã«åã蟌ãŸããŠãããã³ã³ãã³ããå¥ã®ãã¡ã€ã³ããé ä¿¡ãããŠãããããã³ã³ãã³ãã¯ãã¹ãŠéåžžã®ã¯ãã¹ãµã€ãå¶éã®åœ±é¿ãåããããŸããåã蟌ã¿ããŒãžã¯ã¹ã¯ãªããã£ã³ã°ããã©ã°ã€ã³ããã©ãŒã ãç¡å¹ã«ããã³ã³ãã³ãã¯ãä»»æã®ãã¬ãŒã ããã®ãã®ïŒãŸãã¯ä»»æã®ãã¬ãŒã ããŸãã¯ãŠã£ã³ããŠèªèº«ãåã蟌ã¿ïŒä»¥å€ã®ãŠã£ã³ããŠãç§»åã§ããªãã
<p>We're not scared of you! Here is your content, unedited:</p> <iframe sandbox src="http://usercontent.example.net/getusercontent.cgi?id=12193"></iframe>
æ»æè ãçŽæ¥ãã®ããŒãžãžãŠãŒã¶ãŒã«ã¢ã¯ã»ã¹ããããã«çŽåŸãããå ŽåãããŒãžãããŒãžå ã§æ€åºãããæ»æã«è¢«å®³ãåãæããªãã§ããããµã€ãã®çæå ã®ã³ã³ããã¹ãã§å®è¡ãããªãããã«å¥ã®ãã¡ã€ã³ã䜿çšããããšãéèŠã§ããã
ãã®äŸã«ãããŠãå¥ã®ãµã€ãããã¬ãžã§ãããåã蟌ãŸããŠãããã¬ãžã§ããã¯ãã¹ã¯ãªããããã©ãŒã ãæå¹ã§ãããçæå ãµã³ãããã¯ã¹ã®å¶éã¯è§£é€ããããã®çºä¿¡å ã®ãµãŒããŒãšéä¿¡ã§ããããããããã©ã°ã€ã³ããã³ãããã¢ãããç¡å¹ã«ããããã«ããµã³ãããã¯ã¹ã¯äŸç¶ãšããŠæçšã§ããããããã£ãŠãã«ãŠã§ã¢ããã®ä»ã®è åšã«æããããŠãŒã¶ãŒã®ãªã¹ã¯ã軜æžããã
<iframe sandbox="allow-same-origin allow-forms allow-scripts"
src="http://maps.example.com/embedded.html"></iframe>
ãã¡ã€ã«Aã«å«ãŸããæ¬¡ã®æçãä»®å®ããïŒ
<iframe sandbox="allow-same-origin allow-forms" src=B></iframe>
ãŸããã¡ã€ã«Bã«å«ãŸããiframeãä»®å®ããïŒ
<iframe sandbox="allow-scripts" src=C></iframe>
ããã«ããã¡ã€ã«Cã«å«ãŸãããªã³ã¯ãä»®å®ããïŒ
<a href=D>Link</a>
ãã®äŸã«å¯ŸããŠããã¹ãŠã®ãã¡ã€ã«ãtext/htmlãšããŠäŸçµŠããããšä»®å®ããã
ãã®ã·ããªãªã§ã¯ãããŒãžCã¯ãã¹ãŠã®ãµã³ãããã¯ã¹ã®ãã©ã°ãèšå®ããããAã§iframeãç¡å¹ã§ããããããBã«ãããŠiframeã§èšå®ãããallow-scriptsããŒã¯ãŒãã»ãããäžæžãããã®ã§ãã¹ã¯ãªããã¯ç¡å¹ã§ããããã©ãŒã ã®iframeã§èšå®ã§ããããã«ãã¹ã¯ãªããããŒã¯ãŒããäžæžãããããã®ã¹ã¯ãªããã¯ãç¡å¹ã«ãªã£ãŠãããïŒBã«ãããïŒå
åŽã®iframeã¯ãallow-formsããŒã¯ãŒãã»ãããèšå®ãããªãããããã©ãŒã ããŸãç¡å¹ã§ããã
Suppose now that a script in A removes all the sandbox attributes in A and B. This would change nothing immediately. ãŠãŒã¶ãŒãCã®ãªã³ã¯ãã¯ãªãã¯ããå ŽåãBã§ã®iframeã«ããŒãžDãèªã¿èŸŒã¿ããªã³ã¯ã¯ããŒãžBãèªã¿èŸŒãŸããéã«Aã®<c11><a12>iframe</a12></c11>å
ã®ãã¹ãããããã©ãŠãžã³ã°ã³ã³ããã¹ãã®ç¶æ
ã ã£ããããããããBã§ã®iframeãallow-same-originãš<c8><a9>allow-forms</a9></c8>ããŒã¯ãŒããèšå®ãããŠãããã®ããã«ãããŒãžDã¯æ¯ãèãã ããã
äœãèš±å¯ãããŠäœãèš±å¯ãããªããã«ã€ããŠå€æããããšã¯éåžžã«å°é£ã§ãããããäžè¬ã«ãåçã«é€å»ããããsandbox屿§ã倿Žãããããããšã¯è³¢æã§ãªãã
iframeèŠçŽ ã¯ãåã蟌ãŸããã³ã³ãã³ããç¹å®ã®ãµã€ãºããã€ïŒããšãã°åäœãæç¢ºã«å®çŸ©ããã寞æ³ããã€ïŒå Žåã寞æ³å±æ§ããµããŒãããã
æå®ããåæã³ã³ãã³ãå
å®¹ãæ£åžžã«äœ¿çšããããã©ããã«é¢ããããåžžã«ãã¹ããããã©ãŠãžã³ã°ã³ã³ããã¹ããäœæããã®ã§ãiframeèŠçŽ ã¯ãã©ãŒã«ããã¯ã³ã³ãã³ãã«ãªããªãã
iframeèŠçŽ ã®åå«ã¯äœã衚ããªããïŒiframeèŠçŽ ããµããŒãããªãã¬ã¬ã·ãŒãŠãŒã¶ãŒãšãŒãžã§ã³ãã«ãããŠãã³ã³ãã³ãã¯ãã©ãŒã«ããã¯ã³ã³ãã³ããšããŠæ©èœããããšãã§ããããŒã¯ã¢ãããšããŠè§£æããããïŒ
HTMLææžã§äœ¿çšããå ŽåãiframeèŠçŽ ã®èš±å¯ãããã³ã³ãã³ãã¢ãã«ã¯ããã¹ãã§ããããã ããcontextèŠçŽ ãšããŠiframeèŠçŽ ããã³inputãšããŠããã¹ãã³ã³ãã³ãããã€HTMLæçè§£æã¢ã«ãŽãªãºã ãåŒã³åºãããšããäžåã®è§£æãšã©ãŒãªãããªã¹ãå
ã®ä»»æã®å Žæã«ãŸãã¯ãªã¹ãå
ã®èŠçŽ ã®åå«ãšããŠscriptèŠçŽ ããããããã€èªèº«ãé©åãããªã¹ãïŒãã®åå«ãå«ãïŒå
ã®ãã¹ãŠã®èŠçŽ ããã€ããã¬ãŒãžã³ã°ã³ã³ãã³ãã§ããããŒãã®ãªã¹ãããããããªããã°ãªããªãããšãé€ãã
iframeèŠçŽ ã¯ãXMLææžã§ç©ºã§ãªããã°ãªããªãã
HTMLããŒãµã¯ãããã¹ããšããŠiframeèŠçŽ ã®å
åŽã®ããŒã¯ã¢ãããæ±ãã
The IDL attributes src, srcdoc, name, and sandbox must reflect the respective
content attributes of the same name.
The contentDocument IDL attribute
must return the Document object of the active document of the
iframe element's nested browsing context, if any and if its
effective script origin is the same origin as the effective script
origin specified by the incumbent settings object, or null otherwise.
The contentWindow IDL attribute must
return the WindowProxy object of the iframe element's nested
browsing context, if any, or null otherwise.
åºåãããŒã«ãŒããåºåãå«ããããã«iframeã䜿ã£ãããŒãžã®äŸã¯æ¬¡ã®ãšããïŒ
<iframe src="http://ads.example.com/?customerid=923513721&format=banner"
width="468" height="60"></iframe>
embedèŠçŽ src - ãªãœãŒã¹ã®ã¢ãã¬ã¹type â åã蟌ã¿ãªãœãŒã¹ã¿ã€ãwidth - æšªã®æ¬¡å
height - 瞊ã®å¯žæ³applicationãdocumentãimgãŸãã¯presentationãinterface HTMLEmbedElement : HTMLElement {
attribute DOMString src;
attribute DOMString type;
attribute DOMString width;
attribute DOMString height;
legacycaller any (any... arguments);
};
Depending on the type of content instantiated by the
embed element, the node may also support other
interfaces.
embedèŠçŽ ã¯å€éšã®ïŒå
žåçã«ã¯éHTMLïŒã¢ããªã±ãŒã·ã§ã³ãã€ã³ã¿ã©ã¯ãã£ãã³ã³ãã³ãã®çµ±åç¹ãæäŸããã
src屿§ã¯ãåã蟌ãŸããŠãããªãœãŒã¹ã®ã¢ãã¬ã¹ãäžããã屿§ãååšããå Žåãæœåšçã«ã¹ããŒã¹ã§å²ãŸãã劥åœãªç©ºã§ãªãURLãå«ãŸãªããã°ãªããªãã
type屿§ãååšããå Žåã¯ãã€ã³ã¹ã¿ã³ã¹ãçæãããã©ã°ã€ã³ãéžæãããMIMEã¿ã€ããæäŸãããå€ã¯åŠ¥åœãªMIMEã¿ã€ãã§ãªããã°ãªããªããtype屿§ãšsrc屿§ã®äž¡æ¹ãååšããå Žåãtype屿§ã¯ãsrc屿§ã§æå®ããããªãœãŒã¹ã®æç€ºçãªContent-Typeã¡ã¿ããŒã¿ãšåãåãæå®ããªããã°ãªããªãã
When the element is created with neither a src attribute
nor a type attribute, and when attributes are removed such
that neither attribute is present on the element anymore, and when the element has a media
element ancestor, and when the element has an ancestor object element that is
not showing its fallback content, any plugin instantiated for
the element must be removed, and the embed element then represents nothing.
An embed element is said to be potentially
active when the following conditions are all met simultaneously:
Document or was in a Document the last time the event loop
reached step 1.Document is fully active.src attribute set or a type attribute set (or both).src attribute is either absent or its value
is not the empty string.object element that is not showing its
fallback content.Whenever an embed element that was not potentially active becomes potentially active, and whenever a potentially active embed element that is
remaining potentially active and has its src attribute set, changed, or removed or its type attribute set, changed, or removed, the user agent must
queue a task using the embed task source to run the
embed element setup steps.
The embed element setup steps are as follows:
If another task has since been queued to run the
embed element setup steps for this element, then abort these steps.
src attribute setThe user agent must resolve the value of the element's
src attribute, relative to the element. If that is
successful, the user agent should fetch the resulting absolute
URL, from the element's browsing context scope origin if it has one The task that is queued by the networking task source once the resource has been fetched must run the following steps:
If another task has since been queued to run
the embed element setup steps for this element, then abort these
steps.
Determine the type of the content being embedded, as follows (stopping at the first substep that determines the type):
If the element has a type attribute, and that
attribute's value is a type that a plugin supports, then the value of the
type attribute is the content's type.
Otherwise, if applying the URL parser algorithm to the URL of the specified resource (after any redirects) results in a parsed URL whose path component matches a pattern that a plugin supports, then the content's type is the type that that plugin can handle.
For example, a plugin might say that it can handle resources with path components that end with the four character string
".swf".
Otherwise, if the specified resource has explicit Content-Type metadata, then that is the content's type.
Otherwise, the content has no type and there can be no appropriate plugin for it.
If the previous step determined that the content's
type is image/svg+xml, then run the following substeps:
If the embed element is not associated with a nested browsing
context, associate the element with a newly created nested browsing
context, and, if the element has a name
attribute, set the browsing context name of the element's nested
browsing context to the value of this attribute.
Navigate the nested browsing context to
the fetched resource, with replacement enabled, and with the
embed element's document's browsing context as the source
browsing context. (The src attribute of the
embed element doesn't get updated if the browsing context gets further
navigated to other locations.)
The embed element now represents its associated
nested browsing context.
Otherwise, find and instantiate an appropriate plugin based on the content's type, and hand that plugin the
content of the resource, replacing any previously instantiated plugin for the element. The
embed element now represents this plugin instance.
Whether the resource is fetched successfully or not (e.g. whether the response code was a 2xx code or equivalent) must be ignored when determining the content's type and when handing the resource to the plugin.
This allows servers to return data for plugins even with error responses (e.g. HTTP 500 Internal Server Error codes can still contain plugin data).
Fetching the resource must delay the load event of the element's document.
src attribute setThe user agent should find and instantiate an appropriate plugin based on the
value of the type attribute. The embed
element now represents this plugin instance.
The embed element has no fallback content. If the user agent can't
find a suitable plugin when attempting to find and instantiate one for the algorithm above, then
the user agent must use a default plugin. This default could be as simple as saying "Unsupported
Format".
Whenever an embed element that was potentially
active stops being potentially active, any
plugin that had been instantiated for that element must be unloaded.
When a plugin is to be instantiated but it cannot be secured and the sandboxed plugins browsing context
flag is set on the embed element's Document's active
sandboxing flag set, then the user agent must not instantiate the plugin, and
must instead render the embed element in a manner that conveys that the
plugin was disabled. The user agent may offer the user the option to override the
sandbox and instantiate the plugin anyway; if the user invokes such an option, the
user agent must act as if the conditions above did not apply for the purposes of this element.
Plugins that cannot be secured are disabled in sandboxed browsing contexts because they might not honor the restrictions imposed by the sandbox (e.g. they might allow scripting even when scripting in the sandbox is disabled). User agents should convey the danger of overriding the sandbox to the user if an option to do so is provided.
Any namespace-less attribute other than name, align, hspace, and vspace may be specified on the embed element, so long as its name is XML-compatible and contains no uppercase ASCII letters. ãããã®å±æ§ã¯ããã©ã°ã€ã³ã«ãã©ã¡ãŒã¿ãšããŠæž¡ãããã
倧æåã®å¶éããã®ãããªææžã«åœ±é¿ããªãã®ã§ãHTMLææžå ã®ãã¹ãŠã®å±æ§ã¯èªåçã«å°æåãååŸããã
4ã€ã®äŸå€ã¯ããã©ã°ã€ã³ã«éä¿¡ãããã©ã¡ãŒã¿ãè¶ ããå¯äœçšãæã€åŸæ¥ã®å±æ§ãé€å€ããã®ã«é©åœã§ããã
The user agent should pass the names and values of all the attributes of the embed
element that have no namespace to the plugin used, when one is instantiated.
The HTMLEmbedElement object representing the element must expose the scriptable
interface of the plugin instantiated for the embed element, if any. At a
minimum, this interface must implement the legacy caller
operation. (It is suggested that the default behavior of this legacy caller operation, e.g.
the behavior of the default plugin's legacy caller operation, be to throw a
NotSupportedError exception.)
embedèŠçŽ ã¯ã寞æ³å±æ§ããµããŒãããã
The IDL attributes src and type each must reflect the respective
content attributes of the same name.
ããã¯Flashã®ãããªãç¬èªã®ãã©ã°ã€ã³ãå¿ èŠãšãããªãœãŒã¹ãåã蟌ãããã®æ¹æ³ã§ããïŒ
<embed src="catgame.swf">
ãŠãŒã¶ãŒããã©ã°ã€ã³ãæããªãå ŽåïŒããšãã°ãã©ã°ã€ã³ãã³ããŒããŠãŒã¶ãŒã®ãã©ãããã©ãŒã ããµããŒãããªãå ŽåïŒããŠãŒã¶ãŒã¯ãªãœãŒã¹ã䜿çšã§ããªãã
"high"å€ããã€ãã©ã¡ãŒã¿"quality"ããã©ã°ã€ã³ã«æž¡ãããã«ã屿§ãæå®ã§ããïŒ
<embed src="catgame.swf" quality="high">
代ããã«objectèŠçŽ ã䜿çšããå Žåãæ¬¡ã®ãã®ãšç䟡ã«ãªãïŒ
<object data="catgame.swf"> <param name="quality" value="high"> </object>
objectèŠçŽ usemap屿§ããã€å ŽåïŒã€ã³ã¿ã©ã¯ãã£ãã³ã³ãã³ããparamèŠçŽ ãããããééçãdata - ãªãœãŒã¹ã®ã¢ãã¬ã¹type â åã蟌ã¿ãªãœãŒã¹ã¿ã€ãtypemustmatch - type屿§ããã³Content-Typeå€ã䜿çšããããªãœãŒã¹ã«ãããããå¿
èŠããããã©ããname - ãã¹ãããããã©ãŠãžã³ã°ã³ã³ããã¹ãåusemap - 䜿çšããã€ã¡ãŒãžãããã®åå form - formèŠçŽ ãšã³ã³ãããŒã«ãé¢é£ä»ããwidth - æšªã®æ¬¡å
height - çžŠã®æ¬¡å
applicationãdocumentãimgãŸãã¯presentationãaria-*屿§ãinterface HTMLObjectElement : HTMLElement {
attribute DOMString data;
attribute DOMString type;
attribute boolean typeMustMatch;
attribute DOMString name;
attribute DOMString useMap;
readonly attribute HTMLFormElement? form;
attribute DOMString width;
attribute DOMString height;
readonly attribute Document? contentDocument;
readonly attribute WindowProxy? contentWindow;
readonly attribute boolean willValidate;
readonly attribute ValidityState validity;
readonly attribute DOMString validationMessage;
boolean checkValidity();
void setCustomValidity(DOMString error);
legacycaller any (any... arguments);
};
Depending on the type of content instantiated by the
object element, the node also supports other
interfaces.
objectèŠçŽ ã¯ããªãœãŒã¹ã®åã«å¿ããŠãç»åãšããŠããã¹ãããããã©ãŠãžã³ã°ã³ã³ããã¹ããšããŠããŸãã¯ãã©ã°ã€ã³ã«ãã£ãŠåŠçãããå€éšãªãœãŒã¹ãšããŠã®ããããã§æ±ããããå€éšãªãœãŒã¹ã衚ãããšãã§ããã
data屿§ã¯ååšããå ŽåããªãœãŒã¹ã®ã¢ãã¬ã¹ãæå®ãããååšããå Žåã屿§ã¯ãæœåšçã«ã¹ããŒã¹ã§å²ãŸãã劥åœãªç©ºã§ãªãURLã§ãªããã°ãªããªãã
ä¿¡é Œããªãä»ã®çæå
ãããªãœãŒã¹ãåç
§ããèè
ã¯ãäžèšã«å®çŸ©ãããtypemustmatch屿§ã䜿çšããããä¿ãããã®å±æ§ããªããã°ãèè
ãFlashã®"allowScriptAccess"ãã©ã¡ãŒã¿ãªã©ã®æ©èœã䜿çšããå Žåã§ãã£ãŠããä»»æã®ã¹ã¯ãªãããå®è¡ããããã«ãã©ã°ã€ã³æ©æ§ã䜿çšããããšã¯ããªã¢ãŒããã¹ãäžã®æ»æã«å¯ŸããŠç¹å®ã®å Žåã«å¯èœã§ããã
type屿§ãååšããå ŽåããªãœãŒã¹ã®ã¿ã€ããæå®ãããååšããå Žåã屿§ã¯åŠ¥åœãªMIMEã¿ã€ãã§ãªããã°ãªããªãã
data屿§ãŸãã¯type屿§ã®ããããäžæ¹ãå°ãªããšãååšããªããã°ãªããªãã
typemustmatch屿§ã¯ãtype屿§ã®å€ãšãåè¿°ã®ãªãœãŒã¹ã®Content-TypeãäžèŽããå Žåããã®ååšãdata屿§ã§æå®ããããªãœãŒã¹ã«ã®ã¿äœ¿çšãããããšã瀺ãçåœå±æ§ã§ããã
data屿§ãštype屿§ã®äž¡æ¹ãååšããå Žåãé€ããtypemustmatch屿§ãæå®ããŠã¯ãªããªãã
name屿§ãååšããå Žåã劥åœãªãã©ãŠãžã³ã°ã³ã³ããã¹ãåã§ãªããã°ãªããªãã該åœããå Žåãäžããããå€ã¯ããã¹ãããããã©ãŠãžã³ã°ã³ã³ããã¹ãã«ååãä»ããããã«äœ¿çšãããã
Whenever one of the following conditions occur:
Document changes whether it is fully active,
object elements changes to or from showing its
fallback content,
classid attribute is set, changed, or removed,
classid attribute is not present, and
its data attribute is set, changed, or removed,
classid attribute nor its
data attribute are present, and its type attribute is set, changed, or removed,
...the user agent must queue a task to run the following steps to (re)determine
what the object element represents. The task source for this task is the DOM manipulation task source. This task being queued or actively
running must delay the load event of the element's document.
If the user has indicated a preference that this object element's fallback
content be shown instead of the element's usual behavior, then jump to the step below labeled fallback.
For example, a user could ask for the element's fallback content to be shown because that content uses a format that the user finds more accessible.
If the element has an ancestor media element, or has an ancestor
object element that is not showing its fallback content, or
if the element is not in a Document with a
browsing context, or if the element's Document is not fully
active, or if the element is still in the stack of open elements of an
HTML parser or XML parser, or if the element is not being
rendered, then jump to the step below labeled fallback.
If the classid attribute is present, and has a value
that isn't the empty string, then: if the user agent can find a plugin suitable
according to the value of the classid attribute, and
either plugins aren't being sandboxed or that
plugin can be secured, then that
plugin should be used, and the value of the data attribute, if any, should be passed to the
plugin. If no suitable plugin can be found, or if the
plugin reports an error, jump to the step below labeled fallback.
If the data attribute is present and its value is
not the empty string, then:
If the type attribute is present and its value is
not a type that the user agent supports, and is not a type that the user agent can find a
plugin for, then the user agent may jump to the step below labeled fallback
without fetching the content to examine its real type.
Resolve the URL specified by the data attribute, relative to the element.
If that failed, fire a simple event named error at the element, then jump to the step below labeled
fallback.
Fetch the resulting absolute URL, from the element's browsing context scope origin if it has one
Fetching the resource must delay the load event of the element's document until the task that is queued by the networking task source once the resource has been fetched (defined next) has been run.
For the purposes of the application cache networking model, this fetch operation is not for a child browsing context (though it might end up being used for one after all, as defined below).
If the resource is not yet available (e.g. because the resource was not available in the cache, so that loading the resource required making a request over the network), then jump to the step below labeled fallback. The task that is queued by the networking task source once the resource is available must restart this algorithm from this step. Resources can load incrementally; user agents may opt to consider a resource "available" whenever enough data has been obtained to begin processing the resource.
If the load failed (e.g. there was an HTTP 404 error, there was a DNS error), fire
a simple event named error at the element, then jump to
the step below labeled fallback.
Determine the resource type, as follows:
Let the resource type be unknown.
If the object element has a type
attribute and a typemustmatch attribute, and
the resource has associated Content-Type metadata, and the
type specified in the resource's Content-Type metadata is
an ASCII case-insensitive match for the value of the element's type attribute, then let resource type
be that type and jump to the step below labeled handler.
If the object element has a typemustmatch attribute, jump to the step below
labeled handler.
If the user agent is configured to strictly obey Content-Type headers for this resource, and the resource has associated Content-Type metadata, then let the resource type be the type specified in the resource's Content-Type metadata, and jump to the step below labeled handler.
This can introduce a vulnerability, wherein a site is trying to embed a resource that uses a particular plugin, but the remote site overrides that and instead furnishes the user agent with a resource that triggers a different plugin with different security characteristics.
If there is a type attribute present on the
object element, and that attribute's value is not a type that the user agent
supports, but it is a type that a plugin supports, then let the resource type be the type specified in that type attribute, and jump to the step below labeled
handler.
Run the appropriate set of steps from the following list:
Let binary be false.
If the type specified in the resource's Content-Type
metadata is "text/plain", and the result of applying the rules for distinguishing if a resource is
text or binary to the resource is that the resource is not
text/plain, then set binary to true.
If the type specified in the resource's Content-Type
metadata is "application/octet-stream", then set binary to true.
If binary is false, then let the resource type be the type specified in the resource's Content-Type metadata, and jump to the step below labeled handler.
If there is a type attribute present on the
object element, and its value is not application/octet-stream,
then run the following steps:
If the attribute's value is a type that a plugin supports, or the
attribute's value is a type that starts with "image/" that is not also an
XML MIME type, then let the resource type be the type
specified in that type attribute.
Jump to the step below labeled handler.
If there is a type attribute present on the
object element, then let the tentative type be the type
specified in that type attribute.
Otherwise, let tentative type be the sniffed type of the resource.
If tentative type is not
application/octet-stream, then let resource type be
tentative type and jump to the step below labeled
handler.
If applying the URL parser algorithm to the URL of the specified resource (after any redirects) results in a parsed URL whose path component matches a pattern that a plugin supports, then let resource type be the type that that plugin can handle.
For example, a plugin might say that it can handle resources with path components that end with the four character string
".swf".
It is possible for this step to finish, or for one of the substeps above to jump straight to the next step, with resource type still being unknown. In both cases, the next step will trigger fallback.
Handler: Handle the content as given by the first of the following cases that matches:
If plugins are being sandboxed and the plugin that supports resource type cannot be secured, jump to the step below labeled fallback.
Otherwise, the user agent should use the plugin that supports resource type and pass the content of the resource to that plugin. If the plugin reports an error, then jump to the step below labeled fallback.
image/"The object element must be associated with a newly created nested
browsing context, if it does not already have one.
If the URL of the given resource is not about:blank, the
element's nested browsing context must then be navigated to that resource, with
replacement enabled, and with the object element's document's
browsing context as the source browsing context. (The data attribute of the object element doesn't
get updated if the browsing context gets further navigated to other locations.)
If the URL of the given resource is about:blank, then,
instead, the user agent must queue a task to fire a simple event
named load at the object element. No load event is fired at the
about:blank document itself.
The object element represents the nested browsing
context.
If the name attribute is present, the
browsing context name must be set to the value of this attribute; otherwise,
the browsing context name must be set to the empty string.
In certain situations, e.g. if the resource was fetched from an application cache but it is an HTML file
with a manifest attribute that points to a different
application cache manifest, the navigation of the browsing context will be restarted so
as to load the resource afresh from the network or a different application
cache. Even if the resource is then found to have a different type, it is still used
as part of a nested browsing context: only the navigate algorithm
is restarted, not this object algorithm.
image/", and support
for images has not been disabledApply the image sniffing rules to determine the type of the image.
The object element represents the specified image. The image is
not a nested browsing context.
If the image cannot be rendered, e.g. because it is malformed or in an unsupported format, jump to the step below labeled fallback.
The given resource type is not supported. Jump to the step below labeled fallback.
If the previous step ended with the resource type being unknown, this is the case that is triggered.
The element's contents are not part of what the object element
represents.
Once the resource is completely loaded, queue a task to fire a simple
event named load at the element.
The task source for this task is the DOM manipulation task source.
If the data attribute is absent but the type attribute is present, and the user agent can find a
plugin suitable according to the value of the type attribute, and either plugins
aren't being sandboxed or the plugin can be secured, then that plugin should be used. If these conditions cannot be met, or if the
plugin reports an error, jump to the step below labeled fallback.
Fallback: The object element represents the element's
children, ignoring any leading param element children. This is the element's
fallback content. If the element has an instantiated plugin, then
unload it.
When the algorithm above instantiates a plugin, the user agent
should pass to the plugin used the names and values of all the attributes on the
element, in the order they were added to the element, with the attributes added by the parser
being ordered in source order, followed by a parameter named "PARAM" whose value is null, followed
by all the names and values of parameters given by
param elements that are children of the object element, in tree
order. If the plugin supports a scriptable interface, the
HTMLObjectElement object representing the element should expose that interface. The
object element represents the plugin. The
plugin is not a nested browsing context.
Plugins are considered sandboxed for the purpose of an
object element if the sandboxed plugins browsing context flag is set on
the object element's Document's active sandboxing flag
set.
Due to the algorithm above, the contents of object elements act as fallback
content, used only when referenced resources can't be shown (e.g. because it returned a 404
error). This allows multiple object elements to be nested inside each other,
targeting multiple user agents with different capabilities, with the user agent picking the first
one it supports.
Whenever the name attribute is set, if the
object element has a nested browsing context, its name must be changed to the new value. If the attribute is removed, if the
object element has a browsing context, the browsing context
name must be set to the empty string.
objectèŠçŽ ãç»åã衚ããšåæã«ååšããå Žåãusemap屿§ã¯ãã€ã¡ãŒãžãããã«é¢é£ä»ãããããªããžã§ã¯ããæã€ããšã瀺ãããšãã§ãããThe attribute must be ignored if the object element doesn't represent an image.
form屿§ã¯ãæç€ºçã«ãã®ãã©ãŒã ã®ææè
ãšobjectèŠçŽ ãé¢é£ä»ããããã«äœ¿çšãããã
Constraint validation: object elements are always barred
from constraint validation.
objectèŠçŽ ã¯å¯žæ³å±æ§ããµããŒãããã
The IDL attributes data, type and name each must reflect the respective
content attributes of the same name. The typeMustMatch IDL attribute must
reflect the typemustmatch content
attribute. The useMap IDL attribute must
reflect the usemap content attribute.
The contentDocument IDL attribute
must return the Document object of the active document of the
object element's nested browsing context, if any and if its
effective script origin is the same origin as the effective script
origin specified by the incumbent settings object, or null otherwise.
The contentWindow IDL attribute must
return the WindowProxy object of the object element's nested
browsing context, if it has one; otherwise, it must return null.
The willValidate, validity, and validationMessage attributes, and the checkValidity(), and setCustomValidity() methods, are part of the
constraint validation API. The form IDL attribute
is part of the element's forms API.
All object elements have a legacy caller
operation. If the object element has an instantiated plugin that
supports a scriptable interface that defines a legacy caller operation, then that must be the
behavior of the object's legacy caller operation. Otherwise, the object's legacy caller operation
must be to throw a NotSupportedError exception.
次ã®äŸã«ãããŠJavaã¢ãã¬ããã¯ãobjectèŠçŽ ã䜿çšããŠããŒãžã«åã蟌ãŸããŠãããïŒäžè¬çã«èšã£ãŠãã¢ããªã±ãŒã·ã§ã³ãããµãŒãããŒãã£ãŒè£œã®ãã©ã°ã€ã³ãå¿
èŠãšããããšãªããã¹ãŠã®ãŠã§ããã©ãŠã¶äžã§åäœããã®ã§ãæ©èœãæäŸããããã«ãã€ãã£ãŽã®JavaScriptãšHTMLã代ããã«äœ¿çšããããšã§ããã®ãããªã¢ãã¬ããã®äœ¿çšãé¿ããããšããããããç¹ã«çµã¿èŸŒã¿æ©åšã¯ãå€ãã®ããã€ã¹ã§Javaã®ãããªãµãŒãããŒãã£ã®ãã¯ãããžãŒããµããŒãããªããïŒ
<figure> <object type="application/x-java-applet"> <param name="code" value="MyJavaClass"> <p>You do not have Java available, or it is disabled.</p> </object> <figcaption>My Java Clock</figcaption> </figure>
ãã®äŸã«ãããŠãHTMLããŒãžã¯objectèŠçŽ ã䜿çšããŠåã蟌ãŸããŠããã
<figure> <object data="clock.html"></object> <figcaption>My HTML Clock</figcaption> </figure>
次ã®äŸã¯ããã©ã°ã€ã³ãïŒãã®å Žåã«ãããŠFlashãã©ã°ã€ã³ã¯ããããªãã¡ã€ã«ã衚瀺ããããã«ïŒHTMLã§äœ¿çšã§ããæ§åã瀺ãããã©ãŒã«ããã¯ã¯ãFlashãæå¹ã§ãªããŠãŒã¶ãŒã«æäŸãããããã®å ŽåãvideoèŠçŽ ã®äœ¿çšã¯ãvideoããµããŒããããŠãŒã¶ãŒãšãŒãžã§ã³ãã䜿çšãããã®ã«å¯ŸããŠåç»ã衚瀺ããæçµçã«FlashãvideoããµããŒãããªããã©ãŠã¶ã®ã©ã¡ããæããªã人ã«å¯Ÿãããããªãžã®ãªã³ã¯ãæäŸããã
<p>Look at my video: <object type="application/x-shockwave-flash"> <param name=movie value="http://video.example.com/library/watch.swf"> <param name=allowfullscreen value=true> <param name=flashvars value="http://video.example.com/vids/315981"> <video controls src="http://video.example.com/vids/315981"> <a href="http://video.example.com/vids/315981">View video</a>. </video> </object> </p>
paramèŠçŽ objectèŠçŽ ã®åãšããŠãname - ãã©ã¡ãŒã¿åvalue - ãã©ã¡ãŒã¿å€interface HTMLParamElement : HTMLElement {
attribute DOMString name;
attribute DOMString value;
};
paramèŠçŽ ã¯ãobjectèŠçŽ ã«ãã£ãŠåŒã³åºããããã©ã°ã€ã³ã®ãã©ã¡ãŒã¿ãå®çŸ©ããããã®èŠçŽ ã¯ãèªåèªèº«ã§äœãã衚ããã®ã§ã¯ãªãã
name屿§ã¯ããã©ã¡ãŒã¿ã®ååãäžããã
value屿§ã¯ããã©ã¡ãŒã¿ã®å€ãäžããã
äž¡æ¹ã®å±æ§ãååšããªããã°ãªããªãããããã¯ãä»»æã®å€ãæã£ãŠãããã
If both attributes are present, and if the parent element of the param is an
object element, then the element defines a parameter with the given name-value pair.
If either the name or value of a parameter defined
by a param element that is the child of an object element that
represents an instantiated plugin changes, and if that
plugin is communicating with the user agent using an API that features the ability to
update the plugin when the name or value of a parameter so changes, then the user agent must
appropriately exercise that ability to notify the plugin of the change.
The IDL attributes name and value must both reflect the respective
content attributes of the same name.
ãã®å ŽåO3Dãã©ã°ã€ã³ã«ãããŠãparamèŠçŽ ãããã©ã°ã€ã³ã«ãã©ã¡ãŒã¿ãæž¡ãããã«äœ¿çšããæ§åãæ¬¡ã«ç€ºãã
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>O3D Utah Teapot</title>
</head>
<body>
<p>
<object type="application/vnd.o3d.auto">
<param name="o3d_features" value="FloatingPointTextures">
<img src="o3d-teapot.png"
title="3D Utah Teapot illustration rendered using O3D."
alt="When O3D renders the Utah Teapot, it appears as a squat
teapot with a shiny metallic finish on which the
surroundings are reflected, with a faint shadow caused by
the lighting.">
<p>To see the teapot actually rendered by O3D on your
computer, please download and install the <a
href="http://code.google.com/apis/o3d/docs/gettingstarted.html#install">O3D plugin</a>.</p>
</object>
<script src="o3d-teapot.js"></script>
</p>
</body>
</html>
videoèŠçŽ controls屿§ãæã€å ŽåïŒã€ã³ã¿ã©ã¯ãã£ãã³ã³ãã³ããsrc屿§ãæã€å ŽåïŒ0å以äžã®trackèŠçŽ ã§ã次ã«ééçã ããmediaèŠçŽ åå«ããããªããsrc屿§ãæããªãå ŽåïŒ0å以äžã®sourceèŠçŽ ã§ã次ã«0å以äžã®trackã§ã次ã«ééçã ããmediaèŠçŽ åå«ããããªããsrc - ãªãœãŒã¹ã®ã¢ãã¬ã¹crossorigin â èŠçŽ ãcrossoriginèŠæ±ãåŠçããæ¹æ³poster - å
ã«ãããªãã¬ã€ããã¯ãèŠãããã¹ã¿ãŒãã¬ãŒã preload - ã¡ãã£ã¢ãªãœãŒã¹ãã©ã®çšåºŠãããã¡ãªã³ã°ã«å¿
èŠã«ãªããã®ãã³ãautoplay - ããŒãžãèªã¿èŸŒãŸããéã«ã¡ãã£ã¢ãªãœãŒã¹ãèªåçã«éå§å¯èœãšãããã³ãmediagroup - æé»ã®MediaControllerããã€ã¡ãã£ã¢èŠçŽ ã°ã«ãŒãloop - ã¡ãã£ã¢ãªãœãŒã¹ãã«ãŒããããã©ããmuted - ããã©ã«ãã§ã¡ãã£ã¢ãªãœãŒã¹ããã¥ãŒããããã©ããcontrols - ãŠãŒã¶ãŒãšãŒãžã§ã³ãã®ã³ã³ãããŒã«ã衚瀺ããwidth - æšªã®æ¬¡å
height - çžŠã®æ¬¡å
application.aria-*屿§ãinterface HTMLVideoElement : HTMLMediaElement {
attribute unsigned long width;
attribute unsigned long height;
readonly attribute unsigned long videoWidth;
readonly attribute unsigned long videoHeight;
attribute DOMString poster;
};
videoèŠçŽ ã¯åå¹ä»ãã®ãããªãã ãŒããŒããªãŒãã£ãªãã¡ã€ã«ãåçããããã«äœ¿çšãããã
Content may be provided inside the video element. User agents
should not show this content to the user; it is intended for older Web browsers which do
not support video, so that legacy video plugins can be tried, or to show text to the
users of these older browsers informing them of how to access the video contents.
ç¹ã«ããã®ã³ã³ãã³ãã¯ã¢ã¯ã»ã·ããªãã£ãŒã®æžå¿µã«å¯ŸåŠããããã®ãã®ã§ã¯ãªãã匱èŠãç®ã®èŠããªããé£èŽãè³ãèãããªããããã³ä»ã®èº«äœãŸãã¯èªç¥é害ãæã€äººã
ãžã®ãããªã³ã³ãã³ãã«ã¢ã¯ã»ã·ãã«ã«ããããã®ãããŸããŸãªæ©èœãå©çšå¯èœã§ãããåå¹ã¯ããããªã¹ããªãŒã ã®åã蟌ã¿ãŸãã¯trackèŠçŽ ã䜿çšããå€éšãã¡ã€ã«ãšããŠã®ãããããæäŸã§ãããæè©±ãã©ãã¯ã¯ããããªã¹ããªãŒã ã®åã蟌ã¿ãŸãã¯mediagroup屿§ãŸãã¯MediaControllerãªããžã§ã¯ãã䜿çšãããè€æ°ã®videoèŠçŽ ãåæãããããšã®ããããã§æäŸã§ããããªãŒãã£ãªã®èª¬æã¯ããããªã¹ããªãŒã ã«åã蟌ãŸããåå¥ã®ãã©ãã¯ãšããŠãvideoèŠçŽ ãšããŠåãã³ã³ãããŒã©ã«ã¹ã¬ãŒãaudioèŠçŽ ã§ã®åå¥ã®ãªãŒãã£ãªãã©ãã¯ãšããŠããŸãã¯trackèŠçŽ ã䜿çšããŠåç
§ããããã€ãŠãŒã¶ãŒãšãŒãžã§ã³ãã«ãã£ãŠé³å£°ã«åæãããWebVTTãã¡ã€ã«ã䜿çšããããã¹ã圢åŒã§ã®ãããããšããŠæäŸã§ãããWebVTTã¯ãŸããç« ã®ã¿ã€ãã«ãæäŸããããã«äœ¿çšã§ããããããäžåã®ã¡ãã£ã¢èŠçŽ ã䜿çšããªãã ãããŠãŒã¶ãŒã®å Žåãè€åç©ãŸãã¯ãã®ä»ã®ããã¹ãã®éžæè¢ã¯åã«videoèŠçŽ ã®è¿ãã«æã§ãããã«ãªã³ã¯ããããšã«ãã£ãŠæäŸããããã[WEBVTT]
videoèŠçŽ ã¯mediaèŠçŽ ã§ããããã®ã¡ãã£ã¢ããŒã¿ãããããé¢é£ããé³å£°ããŒã¿ããã€ã衚é¢äžã¯æ åããŒã¿ã§ããã
srcãpreloadãautoplayãmediagroupãloopãmutedãããã³controls屿§ã¯ããã¹ãŠã®ã¡ãã£ã¢èŠçŽ ã«å
±éã®å±æ§ã§ããã
poster屿§ã¯ãããªããŒã¿ãå©çšå¯èœã§ãªãéã«ããŠãŒã¶ãŒãšãŒãžã§ã³ãã衚瀺ã§ããç»åãã¡ã€ã«ã®ã¢ãã¬ã¹ãäžããã屿§ãååšããå Žåãæœåšçã«ã¹ããŒã¹ã§å²ãŸãã劥åœãªç©ºã§ãªãURLãå«ãŸãªããã°ãªããªãã
If the specified resource is to be used, then, when the element is created or when the poster attribute is set, changed, or removed, the user agent must
run the following steps to determine the element's poster frame (regardless of the
value of the element's show poster flag):
If there is an existing instance of this algorithm running for this video
element, abort that instance of this algorithm without changing the poster
frame.
If the poster attribute's value is the empty string
or if the attribute is absent, then there is no poster frame; abort these
steps.
Resolve the poster attribute's value relative to the element. If this fails,
then there is no poster frame; abort these steps.
Fetch the resulting absolute URL, from the element's
Document's origin. This must delay the load event of the
element's document.
If an image is thus obtained, the poster frame is that image. Otherwise, there is no poster frame.
poster屿§ã«ãã£ãŠäžããããç»åãposter frameã¯ããŠãŒã¶ãŒã«æ åãã©ã®ãããªãã®ã§ãããã®ããŒããäžããæ åã®ä»£è¡šãã¬ãŒã ïŒéåžžã¯æåã®ç©ºçœã§ãªããã¬ãŒã ã®1ã€ïŒã§ããããšãæå³ããã
A video element represents what is given for the first matching condition in the
list below:
readyState attribute is either HAVE_NOTHING, or HAVE_METADATA but no video data has yet been obtained at
all, or the element's readyState attribute is any
subsequent value but the media resource does not have a video channel)video element represents its poster frame, if any,
or else transparent black with no intrinsic dimensions.video element is paused, the current playback position is the first frame of video,
and the element's show poster flag is setvideo element represents its poster frame, if any,
or else the first frame of the video.video element is paused, and the
frame of video corresponding to the current playback
position is not available (e.g. because the video is seeking or buffering)video element is neither potentially playing nor paused (e.g. when seeking or stalled)video element represents the last frame of the video to have
been rendered.video element is pausedvideo element represents the frame of video corresponding to
the current playback position.video element has a video channel and is potentially
playing)video element represents the frame of video at the continuously
increasing "current" position. When the
current playback position changes such that the last frame rendered is no longer the
frame corresponding to the current playback position in the video, the new frame
must be rendered.Which frame in a video stream corresponds to a particular playback position is defined by the video stream's format.
The video element also represents any text track cues whose text track cue active flag is set and whose
text track is in the showing mode, and any
audio from the media resource, at the current playback position.
Any audio associated with the media resource must, if played, be played synchronized with the current playback position, at the element's effective media volume.
In addition to the above, the user agent may provide messages to the user (such as "buffering", "no video loaded", "error", or more detailed information) by overlaying text or icons on the video or other areas of the element's playback area, or in another appropriate manner.
User agents that cannot render the video may instead make the element represent a link to an external video playback utility or to the video data itself.
When a video element's media resource has a video channel, the
element provides a paint source whose width is the media resource's
intrinsic width, whose height is the
media resource's intrinsic
height, and whose appearance is the frame of video corresponding to the current playback position, if that is available, or else
(e.g. when the video is seeking or buffering) its previous appearance, if any, or else (e.g.
because the video is still loading the first frame) blackness.
videoWidthvideoHeightãããã®å±æ§ã¯ãããªã®å åšå¯žæ³ãè¿ãã寞æ³ãæªç¥ã®å Žåã«0ãè¿ãã
The intrinsic width and intrinsic height of the media resource are the dimensions of the resource in CSS pixels after taking into account the resource's dimensions, aspect ratio, clean aperture, resolution, and so forth, as defined for the format used by the resource. If an anamorphic format does not define how to apply the aspect ratio to the video data's dimensions to obtain the "correct" dimensions, then the user agent must apply the ratio by increasing one dimension and leaving the other unchanged.
The videoWidth IDL attribute must return
the intrinsic width of the video in CSS pixels.
The videoHeight IDL attribute must return
the intrinsic height of the video in CSS
pixels. If the element's readyState attribute is HAVE_NOTHING, then the attributes must return 0.
Whenever the intrinsic width
or intrinsic height of the video changes
(including, for example, because the selected video
track was changed), if the element's readyState
attribute is not HAVE_NOTHING, the user agent must
queue a task to fire a simple event named resize at the media element.
videoèŠçŽ ã¯ã寞æ³å±æ§ããµããŒãããã
In the absence of style rules to the contrary, video content should be rendered inside the element's playback area such that the video content is shown centered in the playback area at the largest possible size that fits completely within it, with the video content's aspect ratio being preserved. Thus, if the aspect ratio of the playback area does not match the aspect ratio of the video, the video will be shown letterboxed or pillarboxed. Areas of the element's playback area that do not contain the video represent nothing.
In user agents that implement CSS, the above requirement can be implemented by using the style rule suggested in the rendering section.
The intrinsic width of a video element's playback area is the intrinsic width of
the poster frame, if that is available and the element currently
represents its poster frame; otherwise, it is the intrinsic width of the video resource, if that is
available; otherwise the intrinsic width is missing.
The intrinsic height of a video element's playback area is the intrinsic height of
the poster frame, if that is available and the element currently
represents its poster frame; otherwise it is the intrinsic height of the video resource, if that is
available; otherwise the intrinsic height is missing.
The default object size is a width of 300 CSS pixels and a height of 150 CSS pixels. [CSSIMAGES]
User agents should provide controls to enable or disable the display of closed captions, audio description tracks, and other additional data associated with the video stream, though such features should, again, not interfere with the page's normal rendering.
User agents may allow users to view the video content in manners more suitable to the user
(e.g. full-screen or in an independent resizable window). As for the other user interface
features, controls to enable this should not interfere with the page's normal rendering unless the
user agent is exposing a user interface.
In such an independent context, however, user agents may make full user interfaces visible, with,
e.g., play, pause, seeking, and volume controls, even if the controls attribute is absent.
User agents may allow video playback to affect system features that could interfere with the user's experience; for example, user agents could disable screensavers while video playback is in progress.
The poster IDL attribute must
reflect the poster content attribute.
ãã®äŸã¯ããããªãæ£åžžã«åçããããã«é害ãçºçããããšãæ€åºããæ§åã瀺ãïŒ
<script>
function failed(e) {
// video playback failed - show a message saying why
switch (e.target.error.code) {
case e.target.error.MEDIA_ERR_ABORTED:
alert('You aborted the video playback.');
break;
case e.target.error.MEDIA_ERR_NETWORK:
alert('A network error caused the video download to fail part-way.');
break;
case e.target.error.MEDIA_ERR_DECODE:
alert('The video playback was aborted due to a corruption problem or because the video used features your browser did not support.');
break;
case e.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED:
alert('The video could not be loaded, either because the server or network failed or because the format is not supported.');
break;
default:
alert('An unknown error occurred.');
break;
}
}
</script>
<p><video src="tgif.vid" autoplay controls onerror="failed(event)"></video></p>
<p><a href="tgif.vid">Download the video file</a>.</p>
audioèŠçŽ controls屿§ãæã€å ŽåïŒã€ã³ã¿ã©ã¯ãã£ãã³ã³ãã³ããcontrols屿§ãæã€å ŽåïŒãã«ããã«ã³ã³ãã³ããsrc屿§ãæã€å ŽåïŒ0å以äžã®trackèŠçŽ ã§ã次ã«ééçã ããmediaèŠçŽ åå«ããããªããsrc屿§ãæããªãå ŽåïŒ0å以äžã®sourceèŠçŽ ã§ã次ã«0å以äžã®trackã§ã次ã«ééçã ããmediaèŠçŽ åå«ããããªããsrc - ãªãœãŒã¹ã®ã¢ãã¬ã¹crossorigin â èŠçŽ ãcrossoriginèŠæ±ãåŠçããæ¹æ³preload - ã¡ãã£ã¢ãªãœãŒã¹ãã©ã®çšåºŠãããã¡ãªã³ã°ã«å¿
èŠã«ãªããã®ãã³ãautoplay - ããŒãžãèªã¿èŸŒãŸããéã«ã¡ãã£ã¢ãªãœãŒã¹ãèªåçã«éå§å¯èœãšãããã³ãmediagroup - æé»ã®MediaControllerããã€ã¡ãã£ã¢èŠçŽ ã°ã«ãŒãloop - ã¡ãã£ã¢ãªãœãŒã¹ãã«ãŒããããã©ããmuted - ããã©ã«ãã§ã¡ãã£ã¢ãªãœãŒã¹ããã¥ãŒããããã©ããcontrols - ãŠãŒã¶ãŒãšãŒãžã§ã³ãã®ã³ã³ãããŒã«ã衚瀺ããapplication.aria-*屿§ã[NamedConstructor=Audio(optional DOMString src)]
interface HTMLAudioElement : HTMLMediaElement {};
audioèŠçŽ ã¯ãé³ããªãŒãã£ãªã®ã¹ããªãŒã ã衚ãã
Content may be provided inside the audio element. User agents
should not show this content to the user; it is intended for older Web browsers which do
not support audio, so that legacy audio plugins can be tried, or to show text to the
users of these older browsers informing them of how to access the audio contents.
ç¹ã«ããã®ã³ã³ãã³ãã¯ã¢ã¯ã»ã·ããªãã£ãŒã®æžå¿µã«å¯ŸåŠããããã®ãã®ã§ã¯ãªããèŽèŠé害ããŸãã¯ä»ã®èº«äœãŸãã¯èªç¥é害ãæã€äººã
ãžã®ãªãŒãã£ãªã³ã³ãã³ãã«ã¢ã¯ã»ã·ãã«ã«ããããã®ãããŸããŸãªæ©èœãå©çšå¯èœã§ãããåå¹ãæè©±ã®æ åã䜿çšå¯èœãªå ŽåãvideoèŠçŽ ã¯ããŠãŒã¶ãŒãèŠèŠçãªéžæè¢ãæå¹ã«ããããšãã§ãããªãŒãã£ãªãåçããaudioèŠçŽ ã®ä»£ããã«äœ¿çšã§ãããç« ã¿ã€ãã«ã¯ãtrackèŠçŽ ãšWebVTTãã¡ã€ã«ã䜿çšããŠãããã²ãŒã·ã§ã³ãè£å©ããããã«æäŸã§ããããããŠåœç¶ã®ããšãªãããè€åç©ãŸãã¯ãã®ä»ã®ããã¹ãã®éžæè¢ã¯åã«audioèŠçŽ ã®è¿ãã«æã§ãããã«ãªã³ã¯ããããšã«ãã£ãŠæäŸããããã[WEBVTT]
audioèŠçŽ ã¯ãã¡ãã£ã¢ããŒã¿ã衚é¢äžã¯é³å£°ããŒã¿ã§ããmediaèŠçŽ ã§ããã
srcãpreloadãautoplayãmediagroupãloopãmutedãããã³controls屿§ã¯ããã¹ãŠã®ã¡ãã£ã¢èŠçŽ ã«å
±éã®å±æ§ã§ããã
When an audio element is potentially playing, it must have its audio
data played synchronized with the current playback position, at the element's
effective media volume.
When an audio element is not potentially playing, audio must not play
for the element.
Audio( [ url ] )該åœããå ŽåãåŒæ°ã§æž¡ãããå€ã«èšå®ããsrc屿§ãšãšãã«ãæ°ããaudioèŠçŽ ãè¿ãã
A constructor is provided for creating HTMLAudioElement objects (in addition to
the factory methods from DOM such as createElement()): Audio(src). When invoked as a
constructor, it must return a new HTMLAudioElement object (a new audio
element). The element must have its preload attribute set
to the literal value "auto". If the src argument is present, the object created must have its src content attribute set to the provided value, and the user agent
must invoke the object's resource selection
algorithm before returning. The element's document must be the active document
of the browsing context of the Window object on which the interface
object of the invoked constructor is found.
sourceèŠçŽ trackèŠçŽ ã®åã§ãã¡ãã£ã¢èŠçŽ ã®åãšããŠãsrc - ãªãœãŒã¹ã®ã¢ãã¬ã¹type â åã蟌ã¿ãªãœãŒã¹ã¿ã€ãinterface HTMLSourceElement : HTMLElement {
attribute DOMString src;
attribute DOMString type;
attribute DOMString media;
};
sourceèŠçŽ ã¯ãèè
ãã¡ãã£ã¢èŠçŽ ã«å¯Ÿããè€æ°ã®ä»£æ¿ã¡ãã£ã¢ãªãœãŒã¹ãæå®ã§ããããã®èŠçŽ ã¯ãèªåèªèº«ã§äœãã衚ããã®ã§ã¯ãªãã
src屿§ã¯ãã¡ãã£ã¢ãªãœãŒã¹ã®ã¢ãã¬ã¹ãäžãããå€ã¯ãæœåšçã«ã¹ããŒã¹ã§å²ãŸãã劥åœãªç©ºã§ãªãURLã§ãªããã°ãªããªãããã®å±æ§ã¯ååšããªããã°ãªããªãã
èŠçŽ ãvideoãaudioèŠçŽ ã«ãã§ã«æ¿å
¥ãããŠããå ŽåãsourceèŠçŽ ãšãã®å±æ§ãåçã«å€æŽããŠã广ã¯ãªããåçããŠããå
容ã倿Žããããã«ã¯ã䜿çšå¯èœãªãªãœãŒã¹ã®äžããéžæããcanPlayType()ã¡ãœãããããããå©çšããŠãçŽæ¥ã¡ãã£ã¢èŠçŽ ã®src屿§ãåã«äœ¿çšãããäžè¬ã«ãææžãè§£æãããåŸã«æåã§sourceèŠçŽ ãæäœããããšã¯ãäžå¿
èŠã«è€éãªã¢ãããŒããšãªãã
type屿§ã¯ããã®å±æ§ããã§ããããåã«ããã®ã¡ãã£ã¢ãªãœãŒã¹ãåçã§ãããã©ããããŠãŒã¶ãŒãšãŒãžã§ã³ãã倿ããããã«ãã¡ãã£ã¢ãªãœãŒã¹ã®åã瀺ããæå®ãããå Žåããã®å€ã¯åŠ¥åœãªMIMEã¿ã€ãã§ãªããã°ãªããªããç¹å®ã®MIMEã¿ã€ããå®çŸ©ããã³ãŒããã¯ãã©ã¡ãŒã¿ã¯ããªãœãŒã¹ããšã³ã³ãŒããããæ¹æ³ãæ£ç¢ºã«æå®ããå¿
èŠããããããããªãã[RFC6381]
次ã®ãªã¹ãã¯ãtype屿§ã§codecs=MIMEãã©ã¡ãŒã¿ã䜿çšããæ¹æ³ã®äŸã瀺ãã
<source src='video.mp4' type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
<source src='video.mp4' type='video/mp4; codecs="avc1.58A01E, mp4a.40.2"'>
<source src='video.mp4' type='video/mp4; codecs="avc1.4D401E, mp4a.40.2"'>
<source src='video.mp4' type='video/mp4; codecs="avc1.64001E, mp4a.40.2"'>
<source src='video.mp4' type='video/mp4; codecs="mp4v.20.8, mp4a.40.2"'>
<source src='video.mp4' type='video/mp4; codecs="mp4v.20.240, mp4a.40.2"'>
<source src='video.3gp' type='video/3gpp; codecs="mp4v.20.8, samr"'>
<source src='video.ogv' type='video/ogg; codecs="theora, vorbis"'>
<source src='video.ogv' type='video/ogg; codecs="theora, speex"'>
<source src='audio.ogg' type='audio/ogg; codecs=vorbis'>
<source src='audio.spx' type='audio/ogg; codecs=speex'>
<source src='audio.oga' type='audio/ogg; codecs=flac'>
<source src='video.ogv' type='video/ogg; codecs="dirac, vorbis"'>
屿§ããã§ããããåã«ããã®ã¡ãã£ã¢ãªãœãŒã¹ããŠãŒã¶ãŒã«ãšã£ãŠæçšã§ãããã©ããããŠãŒã¶ãŒãšãŒãžã§ã³ãã倿ããããã«ãmedia屿§ã¯ãã¡ãã£ã¢ãªãœãŒã¹ã®æå³ãããã¡ãã£ã¢ã¿ã€ããæäŸããããã®å€ã¯åŠ¥åœãªã¡ãã£ã¢ã¯ãšãªã§ãªããã°ãªããªãã
ãªãœãŒã¹éžæã¢ã«ãŽãªãºã ã¯ãmedia屿§ãçç¥ãããå Žåãããããå€ã"all"ã§ãããã®ããã«ãããªãã¡ãããã©ã«ãã§ã¡ãã£ã¢ãªãœãŒã¹ããã¹ãŠã®ã¡ãã£ã¢ã«é©ãããããŠãŒã¶ãŒãšãŒãžã§ã³ããåãããã«åäœãããããªæ¹æ³ã§å®çŸ©ãããã
If a source element is inserted as a child of a media element that
has no src attribute and whose networkState has the value NETWORK_EMPTY, the user agent must invoke the media
element's resource selection
algorithm.
The IDL attributes src, type, and media must reflect the respective content
attributes of the same name.
ãŠãŒã¶ãŒãšãŒãžã§ã³ãããã¹ãŠæäŸãããã¡ãã£ã¢ãªãœãŒã¹ãã¬ã³ããªã³ã°ããããšãã§ãããã©ãããèè
ã確信ã§ããªãå Žåãèè
ã¯æåŸã®sourceèŠçŽ ã®ãã©ãŒã«ããã¯åäœã«errorã€ãã³ããèŽãããšãã§ããïŒ
<script>
function fallback(video) {
// replace <video> with its contents
while (video.hasChildNodes()) {
if (video.firstChild instanceof HTMLSourceElement)
video.removeChild(video.firstChild);
else
video.parentNode.insertBefore(video.firstChild, video);
}
video.parentNode.removeChild(video);
}
</script>
<video controls autoplay>
<source src='video.mp4' type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'>
<source src='video.ogv' type='video/ogg; codecs="theora, vorbis"'
onerror="fallback(parentNode)">
...
</video>
trackèŠçŽ kind - ããã¹ããã©ãã¯ã®çš®é¡src - ãªãœãŒã¹ã®ã¢ãã¬ã¹srclang - ããã¹ããã©ãã¯ã®èšèªlabel - ãŠãŒã¶ãŒå¯èŠã©ãã«default - ä»ã®ããã¹ããã©ãã¯ãããé©åã§ãªãå Žåã«ãã©ãã¯ãäœåãããinterface HTMLTrackElement : HTMLElement {
attribute DOMString kind;
attribute DOMString src;
attribute DOMString srclang;
attribute DOMString label;
attribute boolean default;
const unsigned short NONE = 0;
const unsigned short LOADING = 1;
const unsigned short LOADED = 2;
const unsigned short ERROR = 3;
readonly attribute unsigned short readyState;
readonly attribute TextTrack track;
};
trackèŠçŽ ã¯ãèè
ãã¡ãã£ã¢èŠçŽ ã«å¯ŸããŠæç€ºçã«å€éšèª¿ç¯ãããããã¹ããã©ãã¯ãæå®ã§ããããã®èŠçŽ ã¯ãèªåèªèº«ã§äœãã衚ããã®ã§ã¯ãªãã
kind屿§ã¯ãåæå±æ§ã§ããã以äžã®è¡šã¯ããã®å±æ§ã«å¯ŸããŠå®çŸ©ãããããŒã¯ãŒããåæãããåè¡ã®æåã®ã»ã«ã«äžããããããŒã¯ãŒãã¯ã2çªç®ã®ã»ã«ã§äžããããç¶æ
ã«å¯Ÿå¿ããã
| ããŒã¯ãŒã | ç¶æ | æŠèŠ |
|---|---|---|
subtitles
| Subtitles | é³å£°ãå©çšå¯èœãªå Žåã«é©ããããçè§£ã§ããªãïŒãŠãŒã¶ãŒãã¡ãã£ã¢ãªãœãŒã¹ã®ãªãŒãã£ãªãã©ãã¯ã®èšèªãçè§£ããŠããªããããªã©ïŒå¯Ÿè©±ã®ç¿»åãŸãã¯ç¿»èš³ããããªã«ãªãŒããŒã¬ã€ããã |
captions
| Captions | é³å£°ãå©çšã§ããªãããã¯ã£ãããšèãããªãå Žåé©ããïŒããšãã°ãç¡èšã§ãããåšå²ã®éšé³ã«ãã£ãŠããæ¶ãããããŸãã¯ãŠãŒã¶ãŒãèŽèŠé害è ã§ããã®ã§ïŒã察話ã®ç¿»åãŸãã¯ç¿»èš³ãé³é¿å¹æãé¢é£ãã鳿¥œã®åå³ãããã³ãã®ä»ã®é¢é£ãªãŒãã£ãªæ å ±ããããªã«ãªãŒããŒã¬ã€ããé£èŽè ã«å¯ŸããŠé©åã«è¡šç€ºãããã |
descriptions
| æŠèŠ | æ åã³ã³ããŒãã³ããäžæçãå©çšã§ããªãããŸãã¯äœ¿çšå¯èœã§ãªãïŒããšãã°ãŠãŒã¶ãŒãé転äžã«ç»é¢ãªãã§ã¢ããªã±ãŒã·ã§ã³ãšæ å ±ããããšãããããããŸãã¯ãŠãŒã¶ãŒãç²ç®ã§ããããïŒéã®é³å£°åæã«å¯ŸããŠæå³ããããã¡ãã£ã¢ãªãœãŒã¹ã®ãããªã³ã³ããŒãã³ãã®ããã¹ãèšè¿°ããªãŒãã£ãªãšããŠåæãããã |
chapters
| Chapters | ã¡ãã£ã¢ãªãœãŒã¹ã®ããã²ãŒãã«äœ¿çšãããããšãæå³ãããç« ã®ã¿ã€ãã«ããŠãŒã¶ãŒãšãŒãžã§ã³ãã®ã€ã³ã¿ãŒãã§ãŒã¹å ã®ã€ã³ã¿ã©ã¯ãã£ããªïŒæœåšçã«å ¥ãåãªïŒãªã¹ããšããŠè¡šç€ºãããã |
metadata
| Metadata | ãã©ãã¯ã¯ãã¹ã¯ãªãããã䜿çšããããã®ãã®ã§ããããŠãŒã¶ãŒãšãŒãžã§ã³ãã«ãã£ãŠè¡šç€ºãããªãã |
屿§ã¯çç¥ããŠããããæ¬ æå€ã®ããã©ã«ãã¯ãsubtitlesç¶æ ã§ããã
src屿§ã¯ããã¹ããã©ãã¯ããŒã¿ã®ã¢ãã¬ã¹ãäžãããå€ã¯ãæœåšçã«ã¹ããŒã¹ã§å²ãŸãã劥åœãªç©ºã§ãªãURLã§ãªããã°ãªããªãããã®å±æ§ã¯ååšããªããã°ãªããªãã
If the element has a src attribute whose value is not the
empty string and whose value, when the attribute was set, could be successfully resolved relative to the element, then the element's track
URL is the resulting absolute URL. Otherwise, the element's track
URL is the empty string.
èŠçŽ ã®ãã©ãã¯URLãWebVTTãªãœãŒã¹ãèå¥ãããã®èŠçŽ ã®kind屿§ãã¡ã¿ããŒã¿ç¶æ
ã§ãªãå ŽåãWebVTTãã¡ã€ã«ã¯ãã¥ãŒããã¹ãã䜿çšããWebVTTãã¡ã€ã«ã§ãªããã°ãªããªãã[WEBVTT]
ããã«ãèŠçŽ ã®ãã©ãã¯URLãWebVTTãªãœãŒã¹ãèå¥ãããã®èŠçŽ ã®kind屿§ãchaptersç¶æ
ã§ããå ŽåãWebVTTãã¡ã€ã«ã¯ãã¥ãŒããã¹ãã䜿çšããWebVTTãã¡ã€ã«ãšãã¹ãã®ã¿ããããã¥ãŒã䜿çšããWebVTTãã¡ã€ã«ã®äž¡æ¹ã§ãªããã°ãªããªãã[WEBVTT]
srclang屿§ã¯ãããã¹ããã©ãã¯ããŒã¿ã®èšèªãæäŸãããå€ã¯ã劥åœãªBCP 47èšèªã¿ã°ã§ãªããã°ãªããªããèŠçŽ ã®kind屿§ãåå¹ç¶æ
ã§ããå Žåããã®å±æ§ã¯ååšããªããã°ãªããªãã[BCP47]
If the element has a srclang attribute whose value is
not the empty string, then the element's track language is the value of the attribute.
Otherwise, the element has no track language.
label屿§ã¯ããã©ãã¯ã®ãŠãŒã¶ãŒãèªããã¿ã€ãã«ãäžããããããã®ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ãŒã¹ã§åå¹ããã£ãã·ã§ã³ãããã³é³å£°è§£èª¬ãã©ãã¯ãäžèŠ§è¡šç€ºããéã«ããã®ã¿ã€ãã«ã¯ãŠãŒã¶ãŒãšãŒãžã§ã³ãã«ãã£ãŠäœ¿çšãããã
label屿§ã®å€ã¯å±æ§ãååšããå Žåã空æååã§ãã£ãŠã¯ãªããªãããŸããåãç¶æ
ã«ããkind屿§ã®åãã¡ãã£ã¢èŠçŽ ã«å±ãã2ã€ã®trackèŠçŽ ã®åããã£ãŠã¯ãªããããã®srclangã¯å±æ§ãæ¬ èœããŠããããåãèšèªã衚ãå€ãæã€ãããã³ãã®label屿§ãåã³äž¡æ¹æ¬ èœãããããŸãã¯äž¡æ¹åãå€ãæã€ãã®äž¡æ¹ã§ããã
If the element has a label attribute whose value is not
the empty string, then the element's track label is the value of the attribute.
Otherwise, the element's track label is an empty string.
default屿§ã¯çåœå±æ§ã§ãããæå®ãããå Žåã«ããŠãŒã¶ãŒã®å奜ãå¥ã®ãã©ãã¯ãããé©åã§ããããšã瀺ããªãå Žåããã©ãã¯ãæå¹ã«ãããããšã瀺ãã
åã¡ãã£ã¢èŠçŽ ã¯ãkind屿§ãsubtitlesãŸãã¯captionsç¶æ
ãã€default屿§ãæå®ãããtrackèŠçŽ ã®åãè€æ°åæã£ãŠã¯ãªããªãã
åã¡ãã£ã¢èŠçŽ ã¯ãkind屿§ãdescriptionç¶æ
ãã€default屿§ãæå®ãããtrackèŠçŽ ã®åãè€æ°åæã£ãŠã¯ãªããªãã
åã¡ãã£ã¢èŠçŽ ã¯ãkind屿§ãchaptersç¶æ
ãã€default屿§ãæå®ãããtrackèŠçŽ ã®åãè€æ°åæã£ãŠã¯ãªããªãã
kind屿§ãmetadataç¶æ
ãã€default屿§ãæå®ãããtrackã®æ°ã«å¶éã¯ååšããªãã
readyState以äžã®ãªã¹ãããçªå·ã§è¡šãããããã¹ããã©ãã¯æºåç¶æ ãè¿ãïŒ
NONE (0)LOADING (1)LOADED (2)ERROR (3)ããã¹ããã©ãã¯ãããŒãã«å€±æããç¶æ ã
tracktrackèŠçŽ ã®ããã¹ããã©ãã¯ã«å¯Ÿå¿ããTextTrackãªããžã§ã¯ããè¿ãã
The readyState attribute must return the
numeric value corresponding to the text track readiness state of the
track element's text track, as defined by the following list:
NONE (numeric value 0)LOADING (numeric value 1)LOADED (numeric value 2)ERROR (numeric value 3)The track IDL attribute must, on getting,
return the track element's text track's corresponding
TextTrack object.
The src, srclang, label, and default IDL attributes must reflect the
respective content attributes of the same name. The kind IDL attribute must reflect the content
attribute of the same name, limited to only known values.
ãã®ãããªã¯ãè€æ°èšèªã®åå¹ãæã€ïŒ
<video src="brave.webm"> <track kind=subtitles src=brave.en.vtt srclang=en label="English"> <track kind=captions src=brave.en.hoh.vtt srclang=en label="English for the Hard of Hearing"> <track kind=subtitles src=brave.fr.vtt srclang=fr lang=fr label="Français"> <track kind=subtitles src=brave.de.vtt srclang=de lang=de label="Deutsch"> </video>
ïŒæåŸã®2ã€ã®lang屿§ã¯ãåå¹èªäœã®èšèªã§ã¯ãªããlabel屿§ã®èšèªãèšè¿°ãããåå¹ã®èšèªã¯srclang屿§ã«ãã£ãŠäžãããããïŒ
ã¡ãã£ã¢èŠçŽ ïŒãã®ä»æ§ã§ã¯audioããã³videoïŒã¯æ¬¡ã®ã€ã³ã¿ãŒãã§ãŒã¹ãå®è£
ããïŒ
enum CanPlayTypeEnum { "" /* empty string */, "maybe", "probably" };
interface HTMLMediaElement : HTMLElement {
// error state
readonly attribute MediaError? error;
// network state
attribute DOMString src;
readonly attribute DOMString currentSrc;
attribute DOMString crossOrigin;
const unsigned short NETWORK_EMPTY = 0;
const unsigned short NETWORK_IDLE = 1;
const unsigned short NETWORK_LOADING = 2;
const unsigned short NETWORK_NO_SOURCE = 3;
readonly attribute unsigned short networkState;
attribute DOMString preload;
readonly attribute TimeRanges buffered;
void load();
CanPlayTypeEnum canPlayType(DOMString type);
// ready state
const unsigned short HAVE_NOTHING = 0;
const unsigned short HAVE_METADATA = 1;
const unsigned short HAVE_CURRENT_DATA = 2;
const unsigned short HAVE_FUTURE_DATA = 3;
const unsigned short HAVE_ENOUGH_DATA = 4;
readonly attribute unsigned short readyState;
readonly attribute boolean seeking;
// playback state
attribute double currentTime;
readonly attribute unrestricted double duration;
Date getStartDate();
readonly attribute boolean paused;
attribute double defaultPlaybackRate;
attribute double playbackRate;
readonly attribute TimeRanges played;
readonly attribute TimeRanges seekable;
readonly attribute boolean ended;
attribute boolean autoplay;
attribute boolean loop;
void play();
void pause();
// media controller
attribute DOMString mediaGroup;
attribute MediaController? controller;
// controls
attribute boolean controls;
attribute double volume;
attribute boolean muted;
attribute boolean defaultMuted;
// tracks
readonly attribute AudioTrackList audioTracks;
readonly attribute VideoTrackList videoTracks;
readonly attribute TextTrackList textTracks;
TextTrack addTextTrack(TextTrackKind kind, optional DOMString label = "", optional DOMString language = "");
};
ã¡ãã£ã¢èŠçŽ ã®å±æ§ãsrcãcrossoriginãpreloadãautoplayãmediagroupãloopãmutedãããã³controlsã¯ããã¹ãŠã®ã¡ãã£ã¢èŠçŽ ã«é©çšããããããã¯ããã®ç¯ã§å®çŸ©ãããã
ã¡ãã£ã¢èŠçŽ ã¯ãé³å£°ããŒã¿ããŸãã¯æ åãšé³å£°ã®ããŒã¿ããŠãŒã¶ãŒã«ç€ºãããã«äœ¿çšãããããã®ç¯ã¯é³å£°ãæ åã«å¯Ÿããã¡ãã£ã¢èŠçŽ ã«ãåæ§ã«é©çšãããã®ã§ãããã¯ããã®ç¯ã«ãããŠã¡ãã£ã¢ããŒã¿ãšèŠãªããããçšèªã¡ãã£ã¢ãªãœãŒã¹ã¯ãããšãã°å®å šãªãããªãã¡ã€ã«ããŸãã¯å®å šãªãªãŒãã£ãªãã¡ã€ã«ãªã©ãã¡ãã£ã¢ããŒã¿ã®å®å šãªéåãåç §ããããã«äœ¿çšãããã
ã¡ãã£ã¢ãªãœãŒã¹ã¯ãè€æ°ã®ãªãŒãã£ãªããã³ãããªãã©ãã¯ãæã€ããšãã§ãããã¡ãã£ã¢èŠçŽ ã®ç®çã«å¯ŸããŠãã¡ãã£ã¢ãªãœãŒã¹ã®æ åããŒã¿ã¯ãèŠçŽ ã®videoTracks屿§ã§ïŒããããã°ïŒäžããããçŸåšéžæããããã©ãã¯ã®ã¿ã§ããããŸãã¡ãã£ã¢ãªãœãŒã¹ã®é³å£°ããŒã¿ã¯ãïŒããããã°ïŒèŠçŽ ã®audioTracks屿§ã«ãã£ãŠäžãããããã¹ãŠã®çŸåšã®æå¹ãªãã©ãã¯ã¯ãæ··åã®çµæã§ããã
audioãšvideoã®äž¡æ¹ã®èŠçŽ ã¯ããªãŒãã£ãªãšãããªã®äž¡æ¹ã«äœ¿çšã§ããã2ã€ã®éã®äž»ãªéãã¯ãvideoèŠçŽ ãæã€ã®ã«å¯ŸããŠãaudioèŠçŽ ã¯ãèŠèŠã³ã³ãã³ãïŒãããªããã£ãã·ã§ã³ãªã©ïŒã«å¯Ÿããåçé åãæããªãããšã ãã§ããã
Except where otherwise explicitly specified, the task source for all the tasks queued in this section and its subsections is the media element event task source of the media element in question.
errorèŠçŽ ã®çŸåšã®ãšã©ãŒç¶æ
ã衚ãMediaErrorãªããžã§ã¯ããè¿ãã
ãšã©ãŒãç¡ãå Žånullãè¿ãã
All media elements have an associated error status, which
records the last error the element encountered since its resource selection algorithm was last invoked. The
error attribute, on getting, must return the
MediaError object created for this last error, or null if there has not been an
error.
interface MediaError {
const unsigned short MEDIA_ERR_ABORTED = 1;
const unsigned short MEDIA_ERR_NETWORK = 2;
const unsigned short MEDIA_ERR_DECODE = 3;
const unsigned short MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
readonly attribute unsigned short code;
};
error . codeäžèšã®ãªã¹ããããçŸåšã®ãšã©ãŒã®ãšã©ãŒã³ãŒããè¿ãã
The code attribute of a
MediaError object must return the code for the error, which must be one of the
following:
MEDIA_ERR_ABORTEDïŒæ°å€1ïŒMEDIA_ERR_NETWORKïŒæ°å€2ïŒMEDIA_ERR_DECODEïŒæ°å€3ïŒMEDIA_ERR_SRC_NOT_SUPPORTEDïŒæ°å€4ïŒsrc屿§ã§ç€ºãããã¡ãã£ã¢ãªãœãŒã¹ã¯é©ããªãã£ããã¡ãã£ã¢èŠçŽ ã®srcã³ã³ãã³ã屿§ã¯ã衚瀺ããã¡ãã£ã¢ãªãœãŒã¹ïŒãããªããªãŒãã£ãªïŒã®ã¢ãã¬ã¹ãäžããã屿§ãååšããå Žåãæœåšçã«ã¹ããŒã¹ã§å²ãŸãã劥åœãªç©ºã§ãªãURLãå«ãŸãªããã°ãªããªãã
ã¡ãã£ã¢èŠçŽ äžã®crossoriginã³ã³ãã³ã屿§ã¯ãCORSèšå®å±æ§ã§ããã
If a src attribute of a media element is set
or changed, the user agent must invoke the media element's media element load
algorithm. (Removing the src attribute does
not do this, even if there are source elements present.)
The src IDL attribute on media elements must reflect the content attribute of the same
name.
The crossOrigin IDL attribute must
reflect the crossorigin content
attribute, limited to only known values.
currentSrcçŸåšã®ã¡ãã£ã¢ãªãœãŒã¹ã®ã¢ãã¬ã¹ãè¿ãã
ã¡ãã£ã¢ãªãœãŒã¹ãååšããªãå Žå空æååãè¿ãã
The currentSrc IDL attribute is initially
the empty string. Its value is changed by the resource
selection algorithm defined below.
ã¡ãã£ã¢ãªãœãŒã¹ãsrc屿§ããŸãã¯sourceèŠçŽ ãæå®ãã2ã€ã®æ¹æ³ãããã屿§ã¯èŠçŽ ãäžæžãããã
ã¡ãã£ã¢ãªãœãŒã¹ã¯ãcodecãã©ã¡ãŒã¿ããã€äžéšã®å Žåã«ãããŠããã®ã¿ã€ããå
·äœçã«ã¯MIMEã¿ã€ãã®èгç¹ãã説æã§ãããïŒcodecãã©ã¡ãŒã¿ãèš±å¯ããããŸãã¯MIMEã¿ã€ãã«äŸåããªããã©ããã«é¢ãããªãïŒ[RFC6381]
ã¿ã€ãã¯ãéåžžå€å°äžå®å
šãªèšè¿°ã§ãããããšãã°"video/mpeg"ã¯ãã³ã³ããã¿ã€ããäœã§ããããé€ããŠäœã§ãèšããã"video/mp4; codecs="avc1.42E01E, mp4a.40.2""ã®ãããªåãå®éã®ãããã¬ãŒãïŒæå€§ãããã¬ãŒãã®ã¿ïŒã®ãããªæ
å ±ãå«ãŸããªãããããã£ãŠãã¿ã€ããæå®ããããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãïŒä¿¡é Œã®ã¬ãã«ãå€åãããïŒãã®ã¿ã€ãã®ã¡ãã£ã¢ãåçã§ãããããããªããã©ããããŸãã¯ééããªããã®ã¿ã€ãã®ã¡ãã£ã¢ãåçã§ããªããã©ããããã³ãã³ç¥ãããšãã§ããã
ãŠãŒã¶ãŒãšãŒãžã§ã³ããã¬ã³ããªã³ã°ã§ããªãããšãèªèããã¿ã€ãã¯ãããšãã°ã³ã³ããã®çš®é¡ãèªèããªãããŸãã¯åæãããã³ãŒããã¯ããµããŒãããªãããããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ééããªããµããŒãããªãããšã«ãªãœãŒã¹ãèšè¿°ãããã®ã§ããã
ãã©ã¡ãŒã¿ã®ãªã"application/octet-stream" MIMEã¿ã€ãã¯ããŠãŒã¶ãŒãšãŒãžã§ã³ããã¬ã³ããªã³ã°ã§ããªãããšãèªèããã¿ã€ãã«ãªããªããæœåšçãªã¡ãã£ã¢ãªãœãŒã¹ã«ã©ãã«ãä»ããããã«äœ¿çšãããéããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãæç€ºçãªContent-Typeã¡ã¿ããŒã¿ã®æ¬ åŠãšåçãšããŠãã®ã¿ã€ããæ±ããªããã°ãªããªãã
ããã§ãã©ã¡ãŒã¿ãªãã®MIMEã¿ã€ã "application/octet-stream"ã¯ç¹æ®ãªå Žåã§ãããä»»æã®ãã©ã¡ãŒã¿ãåã«åºçŸããå Žåããã®åã¯ä»ã®MIMEã¿ã€ããšåãããã«æ±ãããã ãããThis is a deviation from the rule that unknown MIME type parameters should be ignored.
canPlayType(type)ãŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãããäžããããåã®ã¡ãã£ã¢ãªãœãŒã¹ãåçã§ãã"maybe"ããŸãã¯"probably"æ¹æ³ã«åºã¥ããŠç©ºã®æååïŒåŠå®å¿çïŒãè¿ãã
The canPlayType(type) method must return the
empty string if type is a type that the user agent knows it cannot
render or is the type "application/octet-stream"; it must return "probably" if the user agent is confident
that the type represents a media resource that it can render if used in with this
audio or video element; and it must return "maybe" otherwise. Implementors are encouraged
to return "maybe" unless the type can be
confidently established as being supported or not. Generally, a user agent should never return
"probably" for a type that allows the codecs parameter if that parameter is not present.
ãã®ã¹ã¯ãªããã¯ããŠãŒã¶ãŒãšãŒãžã§ã³ããåçã«videoèŠçŽ ãŸãã¯ãã©ã°ã€ã³ã䜿çšãããã©ãããæ±ºå®ããïŒæ¶ç©ºã®ïŒæ°ããªãã©ãŒãããããµããŒãããŠãããã©ããããã¹ãããã
<section id="video">
<p><a href="playing-cats.nfv">Download video</a></p>
</section>
<script>
var videoSection = document.getElementById('video');
var videoElement = document.createElement('video');
var support = videoElement.canPlayType('video/x-new-fictional-format;codecs="kittens,bunnies"');
if (support != "probably" && "New Fictional Video Plugin" in navigator.plugins) {
// not confident of browser support
// but we have a plugin
// so use plugin instead
videoElement = document.createElement("embed");
} else if (support == "") {
// no support from browser and no plugin
// do nothing
videoElement = null;
}
if (videoElement) {
while (videoSection.hasChildNodes())
videoSection.removeChild(videoSection.firstChild);
videoElement.setAttribute("src", "playing-cats.nfv");
videoSection.appendChild(videoElement);
}
</script>
sourceèŠçŽ ã®type屿§ã¯ããŠãŒã¶ãŒãšãŒãžã§ã³ããã¬ã³ããªã³ã°ã§ããªããã©ãŒãããã䜿çšãããªãœãŒã¹ã®ããŠã³ããŒããåé¿ã§ããã
networkStateäžèšã®ãªã¹ãã®ã³ãŒããããèŠçŽ ã«å¯Ÿãããããã¯ãŒã¯æŽ»åã®çŸåšã®ç¶æ ãè¿ãã
As media elements interact with the network, their current
network activity is represented by the networkState attribute. On getting, it must
return the current network state of the element, which must be one of the following values:
NETWORK_EMPTYïŒæ°å€0ïŒNETWORK_IDLEïŒæ°å€1ïŒNETWORK_LOADINGïŒæ°å€2ïŒNETWORK_NO_SOURCEïŒæ°å€3ïŒThe resource selection algorithm defined
below describes exactly when the networkState
attribute changes value and what events fire to indicate changes in this state.
load()èŠçŽ ããªã»ãããããæåããæ°ããã¡ãã£ã¢ãªãœãŒã¹ã®éžæãšèªã¿èŸŒã¿ãéå§ãããã
All media elements have an autoplaying flag, which must begin in the true state, and a delaying-the-load-event flag, which must begin in the false state. While the delaying-the-load-event flag is true, the element must delay the load event of its document.
When the load() method on a media
element is invoked, the user agent must run the media element load
algorithm.
The media element load algorithm consists of the following steps.
Abort any already-running instance of the resource selection algorithm for this element.
If there are any tasks from the media element's media element event task source in one of the task queues, then remove those tasks.
If there are any tasks that were queued by the resource selection algorithm (including the algorithms that it itself invokes) for this same media element from the DOM manipulation task source in one of the task queues, then remove those tasks.
Basically, pending events and callbacks for the media element are discarded when the media element starts loading a new resource.
If the media element's networkState is set to NETWORK_LOADING or NETWORK_IDLE, queue a task to fire a
simple event named abort at the media
element.
If the media element's networkState
is not set to NETWORK_EMPTY, then run these
substeps:
Queue a task to fire a simple event named emptied at the media element.
If a fetching process is in progress for the media element, the user agent should stop it.
If readyState is not set to HAVE_NOTHING, then set it to that state.
If the paused attribute is false, then set it to
true.
If seeking is true, set it to false.
Set the current playback position to 0.
Set the official playback position to 0.
If this changed the official playback position, then queue a task
to fire a simple event named timeupdate at the media element.
Set the initial playback position to 0.
Set the timeline offset to Not-a-Number (NaN).
Update the duration attribute to Not-a-Number
(NaN).
The user agent will not fire a durationchange event for this particular change of
the duration.
Set the playbackRate attribute to the value of
the defaultPlaybackRate attribute.
Set the error attribute to null and the
autoplaying flag to true.
Invoke the media element's resource selection algorithm.
Playback of any previously playing media resource for this element stops.
The resource selection algorithm for a media element is as follows. This algorithm is always invoked synchronously, but one of the first steps in the algorithm is to return and continue running the remaining steps asynchronously, meaning that it runs in the background with scripts and other tasks running in parallel. In addition, this algorithm interacts closely with the event loop mechanism; in particular, it has synchronous sections (which are triggered as part of the event loop algorithm). Steps in such sections are marked with â.
Set the element's networkState attribute to
the NETWORK_NO_SOURCE value.
Set the element's show poster flag to true.
Set the media element's delaying-the-load-event flag to true (this delays the load event).
Asynchronously await a stable state, allowing the task that invoked this algorithm to continue. The synchronous section consists of all the remaining steps of this algorithm until the algorithm says the synchronous section has ended. (Steps in synchronous sections are marked with â.)
â If the media element's blocked-on-parser flag is false, then populate the list of pending text tracks.
â If the media element has a src
attribute, then let mode be attribute.
â Otherwise, if the media element does not have a src attribute but has a source element child, then
let mode be children and let candidate
be the first such source element child in tree order.
â Otherwise the media element has neither a src attribute nor a source element child: set the
networkState to NETWORK_EMPTY, and abort these steps; the
synchronous section ends.
â Set the media element's networkState to NETWORK_LOADING.
â Queue a task to fire a simple event named loadstart at the media element.
If mode is attribute, then run these substeps:
â If the src
attribute's value is the empty string, then end the synchronous section, and jump
down to the failed with attribute step below.
â Let absolute URL be the absolute URL that
would have resulted from resolving the URL
specified by the src attribute's value relative to the
media element when the src attribute was last
changed.
â If absolute URL was obtained successfully, set the currentSrc attribute to absolute
URL.
End the synchronous section, continuing the remaining steps asynchronously.
If absolute URL was obtained successfully, run the resource fetch algorithm with absolute URL. If that algorithm returns without aborting this one, then the load failed.
Failed with attribute: Reaching this step indicates that the media resource failed to load or that the given URL could not be resolved. Queue a task to run the following steps, using the DOM manipulation task source:
Set the error attribute to a new
MediaError object whose code attribute
is set to MEDIA_ERR_SRC_NOT_SUPPORTED.
Set the element's networkState attribute
to the NETWORK_NO_SOURCE value.
Set the element's show poster flag to true.
Fire a simple event named error at
the media element.
Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
Wait for the task queued by the previous step to have executed.
Abort these steps. Until the load() method is
invoked or the src attribute is changed, the element won't
attempt to load another resource.
Otherwise, the source elements will be used; run these substeps:
â Let pointer be a position defined by two adjacent nodes in the media element's child list, treating the start of the list (before the first child in the list, if any) and end of the list (after the last child in the list, if any) as nodes in their own right. One node is the node before pointer, and the other node is the node after pointer. Initially, let pointer be the position between the candidate node and the next node, if there are any, or the end of the list, if it is the last node.
As nodes are inserted and removed into the media element, pointer must be updated as follows:
Other changes don't affect pointer.
â Process candidate: If candidate does not have a
src attribute, or if its src attribute's value is the empty string, then end the
synchronous section, and jump down to the failed with elements step
below.
â Let absolute URL be the absolute URL that
would have resulted from resolving the URL
specified by candidate's src
attribute's value relative to the candidate when the src attribute was last changed.
â If absolute URL was not obtained successfully, then end the synchronous section, and jump down to the failed with elements step below.
â If candidate has a type attribute whose value, when parsed as a MIME
type (including any codecs described by the codecs parameter, for
types that define that parameter), represents a type that the user agent knows it cannot
render, then end the synchronous section, and jump down to the failed with elements step below.
â If candidate has a media attribute whose value does not match the environment, then end the synchronous section, and
jump down to the failed with elements step below.
â Set the currentSrc attribute to absolute URL.
End the synchronous section, continuing the remaining steps asynchronously.
Run the resource fetch algorithm with absolute URL. If that algorithm returns without aborting this one, then the load failed.
Failed with elements: Queue a task, using the DOM
manipulation task source, to fire a simple event named error at the candidate element.
Asynchronously await a stable state. The synchronous section consists of all the remaining steps of this algorithm until the algorithm says the synchronous section has ended. (Steps in synchronous sections are marked with â.)
â Forget the media element's media-resource-specific tracks.
â Find next candidate: Let candidate be null.
â Search loop: If the node after pointer is the end of the list, then jump to the waiting step below.
â If the node after pointer is a source element,
let candidate be that element.
â Advance pointer so that the node before pointer is now the node that was after pointer, and the node after pointer is the node after the node that used to be after pointer, if any.
â If candidate is null, jump back to the search loop step. Otherwise, jump back to the process candidate step.
â Waiting: Set the element's networkState attribute to the NETWORK_NO_SOURCE value.
â Set the element's show poster flag to true.
â Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
End the synchronous section, continuing the remaining steps asynchronously.
Wait until the node after pointer is a node other than the end of the list. (This step might wait forever.)
Asynchronously await a stable state. The synchronous section consists of all the remaining steps of this algorithm until the algorithm says the synchronous section has ended. (Steps in synchronous sections are marked with â.)
â Set the element's delaying-the-load-event flag back to true (this delays the load event again, in case it hasn't been fired yet).
â Set the networkState back to NETWORK_LOADING.
â Jump back to the find next candidate step above.
The resource fetch algorithm for a media element and a given absolute URL is as follows:
Let the current media resource be the resource given by the absolute URL passed to this algorithm. This is now the element's media resource.
Remove all media-resource-specific text tracks from the media element's list of pending text tracks, if any.
Optionally, run the following substeps. This is the expected behavior if the user agent
intends to not attempt to fetch the resource until the user requests it explicitly (e.g. as a way
to implement the preload attribute's none keyword).
Set the networkState to NETWORK_IDLE.
Queue a task to fire a simple event named suspend at the element, using the DOM manipulation
task source.
Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
Wait for the task to be run.
Wait for an implementation-defined event (e.g. the user requesting that the media element begin playback).
Set the element's delaying-the-load-event flag back to true (this delays the load event again, in case it hasn't been fired yet).
Set the networkState to NETWORK_LOADING.
Perform a potentially CORS-enabled fetch of the current media resource's absolute URL, with the mode being
the state of the media element's crossorigin content attribute, the origin
being the origin of the media element's Document, and the
default origin behaviour set to taint.
The resource obtained in this fashion, if any, contains the media data. It can
be CORS-same-origin or CORS-cross-origin; this affects whether
subtitles referenced in the media data are exposed in the API and, for
video elements, whether a canvas gets tainted when the video is drawn
on it.
While the load is not suspended (see below), every 350ms (±200ms) or for every byte
received, whichever is least frequent, queue a task to fire a simple
event named progress at the element.
The stall timeout is a user-agent defined length of time, which should be about
three seconds. When a media element that is actively attempting to obtain
media data has failed to receive any data for a duration equal to the stall
timeout, the user agent must queue a task to fire a simple
event named stalled at the element.
User agents may allow users to selectively block or slow media data downloads. When a media element's download has been blocked altogether, the user agent must act as if it was stalled (as opposed to acting as if the connection was closed). The rate of the download may also be throttled automatically by the user agent, e.g. to balance the download with other connections sharing the same bandwidth.
User agents may decide to not download more content at any time, e.g.
after buffering five minutes of a one hour media resource, while waiting for the user to decide
whether to play the resource or not, while waiting for user input in an interactive resource, or
when the user navigates away from the page. When a media element's download has
been suspended, the user agent must queue a task, using the DOM manipulation
task source, to set the networkState to NETWORK_IDLE and fire a simple event named
suspend at the element. If and when downloading of the
resource resumes, the user agent must queue a task to set the networkState to NETWORK_LOADING. Between the queuing of these tasks,
the load is suspended (so progress events don't fire,
as described above).
The preload attribute provides a hint
regarding how much buffering the author thinks is advisable, even in the absence of the autoplay attribute.
When a user agent decides to completely stall a download, e.g. if it is waiting until the user starts playback before downloading any further content, the element's delaying-the-load-event flag must be set to false. This stops delaying the load event.
The user agent may use whatever means necessary to fetch the resource (within the constraints put forward by this and other specifications); for example, reconnecting to the server in the face of network errors, using HTTP range retrieval requests, or switching to a streaming protocol. The user agent must consider a resource erroneous only if it has given up trying to fetch it.
This specification does not currently say whether or how to check the MIME types of the media resources, or whether or how to perform file type sniffing using the actual file data. Implementors differ in their intentions on this matter and it is therefore unclear what the right solution is. In the absence of any requirement here, the HTTP specification's strict requirement to follow the Content-Type header prevails ("Content-Type specifies the media type of the underlying data." ... "If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and./or the name extension(s) of the URI used to identify the resource.").
The networking task source tasks to process the data as it is being fetched must, when appropriate, include the relevant substeps from the following list:
DNS errors, HTTP 4xx and 5xx errors (and equivalents in other protocols), and other fatal network errors that occur before the user agent has established whether the current media resource is usable, as well as the file using an unsupported container format, or using unsupported codecs for all the data, must cause the user agent to execute the following steps:
The user agent should cancel the fetching process.
Abort this subalgorithm, returning to the resource selection algorithm.
Create an AudioTrack object to represent the audio track.
Update the media element's audioTracks attribute's AudioTrackList
object with the new AudioTrack object.
Fire a trusted event with the name addtrack, that does not bubble and is not cancelable, and
that uses the TrackEvent interface, with the track attribute initialized to the new
AudioTrack object, at this AudioTrackList object.
Create a VideoTrack object to represent the video track.
Update the media element's videoTracks attribute's VideoTrackList
object with the new VideoTrack object.
Fire a trusted event with the name addtrack, that does not bubble and is not cancelable, and that
uses the TrackEvent interface, with the track attribute initialized to the new
VideoTrack object, at this VideoTrackList object.
This indicates that the resource is usable. The user agent must follow these substeps:
Establish the media timeline for the purposes of the current playback position, the earliest possible position, and the initial playback position, based on the media data.
Update the timeline offset to the date and time that corresponds to the zero time in the media timeline established in the previous step, if any. If no explicit time and date is given by the media resource, the timeline offset must be set to Not-a-Number (NaN).
Set the current playback position and the official playback position to the earliest possible position.
Update the duration attribute with the time of
the last frame of the resource, if known, on the media timeline established
above. If it is not known (e.g. a stream that is in principle infinite), update the duration attribute to the value positive Infinity.
The user agent will queue a task
to fire a simple event named durationchange at the element at this point.
For video elements, set the videoWidth and videoHeight attributes, and queue a task
to fire a simple event named resize at
the media element.
Further resize events will be fired
if the dimensions subsequently change.
Set the readyState attribute to HAVE_METADATA.
A loadedmetadata DOM event
will be fired as part of setting the readyState attribute to a new value.
Let jumped be false.
If the media element's default playback start position is greater than zero, then seek to that time, and let jumped be true.
Let the media element's default playback start position be zero.
If either the media resource or the address of the current media resource indicate a particular start time, then set the initial playback position to that time and, if jumped is still false, seek to that time and let jumped be true.
For example, with media formats that support the Media Fragments URI fragment identifier syntax, the fragment identifier can be used to indicate a start position. [MEDIAFRAG]
If either the media resource or the address of the current
media resource indicate a particular set of audio or video tracks to enable,
or if the user agent has information that would enable it to select specific tracks to improve the user's experience, then the
relevant audio tracks must be enabled in the element's audioTracks object, and, of the relevant video tracks,
the one that is listed first in the element's videoTracks object must be selected. All other tracks
must be disabled.
This could again be triggered by Media Fragments URI fragment identifier syntax, but it could also be triggered e.g. by the user agent selecting a 5.1 surround sound audio track over a stereo audio track. [MEDIAFRAG]
If the media element has a current media controller, then: if jumped is true and the initial playback position, relative to the current media controller's timeline, is greater than the current media controller's media controller position, then seek the media controller to the media element's initial playback position, relative to the current media controller's timeline; otherwise, seek the media element to the media controller position, relative to the media element's timeline.
Once the readyState attribute reaches HAVE_CURRENT_DATA, after
the loadeddata event has been fired, set the
element's delaying-the-load-event flag to false. This stops delaying the load event.
A user agent that is attempting to reduce network usage while still fetching
the metadata for each media resource would also stop buffering at this point,
following the rules described previously, which involve the
networkState attribute switching to the NETWORK_IDLE value and a suspend event firing.
The user agent is required to determine the duration of the media resource and go through this step before playing.
Fire a simple event named progress
at the media element.
Set the networkState to NETWORK_IDLE and fire a simple event named
suspend at the media element.
If the user agent ever discards any media data and then needs to resume the
network activity to obtain it again, then it must queue a task to set the networkState to NETWORK_LOADING.
If the user agent can keep the media resource loaded, then the algorithm will continue to its final step below, which aborts the algorithm.
Fatal network errors that occur after the user agent has established whether the current media resource is usable (i.e. once the media element's
readyState attribute is no longer HAVE_NOTHING) must cause the user agent to execute the
following steps:
The user agent should cancel the fetching process.
Set the error attribute to a new
MediaError object whose code attribute
is set to MEDIA_ERR_NETWORK.
Fire a simple event named error at
the media element.
Set the element's networkState attribute
to the NETWORK_IDLE value.
Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
Abort the overall resource selection algorithm.
Fatal errors in decoding the media data that occur after the user agent has established whether the current media resource is usable must cause the user agent to execute the following steps:
The user agent should cancel the fetching process.
Set the error attribute to a new
MediaError object whose code attribute
is set to MEDIA_ERR_DECODE.
Fire a simple event named error at
the media element.
If the media element's readyState
attribute has a value equal to HAVE_NOTHING, set
the element's networkState attribute to the
NETWORK_EMPTY value, set the element's
show poster flag to true, and fire a simple event named emptied at the element.
Otherwise, set the element's networkState
attribute to the NETWORK_IDLE value.
Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
Abort the overall resource selection algorithm.
The fetching process is aborted by the user, e.g. because the user
pressed a "stop" button, the user agent must execute the following steps. These steps are not
followed if the load() method itself is invoked while
these steps are running, as the steps above handle that particular kind of abort.
The user agent should cancel the fetching process.
Set the error attribute to a new
MediaError object whose code attribute
is set to MEDIA_ERR_ABORTED.
Fire a simple event named abort at
the media element.
If the media element's readyState
attribute has a value equal to HAVE_NOTHING, set
the element's networkState attribute to the
NETWORK_EMPTY value, set the element's
show poster flag to true, and fire a simple event named emptied at the element.
Otherwise, set the element's networkState
attribute to the NETWORK_IDLE value.
Set the element's delaying-the-load-event flag to false. This stops delaying the load event.
Abort the overall resource selection algorithm.
The server returning data that is partially usable but cannot be optimally rendered must cause the user agent to render just the bits it can handle, and ignore the rest.
If the media data is CORS-same-origin, run the steps to expose a media-resource-specific text track with the relevant data.
Cross-origin videos do not expose their subtitles, since that would allow attacks such as hostile sites reading subtitles from confidential videos on a user's intranet.
When the networking task source has queued the last task as part of fetching the media resource (i.e. once the download has completed), if the fetching process completes without errors, including decoding the media data, and if all of the data is available to the user agent without network access, then, the user agent must move on to the next step. This might never happen, e.g. when streaming an infinite resource such as Web radio, or if the resource is longer than the user agent's ability to cache data.
While the user agent might still need network access to obtain parts of the media resource, the user agent must remain on this step.
For example, if the user agent has discarded the first half of a video, the
user agent will remain at this step even once the playback has
ended, because there is always the chance the user will seek back to the start. In fact,
in this situation, once playback has ended, the user agent
will end up firing a suspend event, as described
earlier.
If the user agent ever reaches this step (which can only happen if the entire resource gets loaded and kept available): abort the overall resource selection algorithm.
When a media element is to forget the media element's media-resource-specific
tracks, the user agent must remove from the media element's list of text
tracks all the media-resource-specific
text tracks, then empty the media element's audioTracks attribute's AudioTrackList object,
then empty the media element's videoTracks
attribute's VideoTrackList object. No events (in particular, no removetrack events) are fired as part of this; the error and emptied
events, fired by the algorithms that invoke this one, can be used instead.
preload屿§ã¯åæå±æ§ã§ãããæ¬¡ã®è¡šã¯ãããŒã¯ãŒããšå±æ§ã®ç¶æ
ã瀺ãã1åç®ã®ããŒã¯ãŒãã¯ãããŒã¯ãŒããšåãè¡ã§2åç®ã®ã»ã«å
ã®ç¶æ
ã«å¯Ÿå¿ã¥ãããã¡ãã£ã¢ãªãœãŒã¹ããããã¡ãŸãã¯åçãããŠããå Žåã§ã屿§ã倿Žã§ãããäžèšã®è¡šã®èª¬æã§ã¯ããã®ç¹ã«çæããŠè§£éãããã¹ãã§ããã
| ããŒã¯ãŒã | ç¶æ | æŠèŠ |
|---|---|---|
ãªã
| ãªã | èè ãã¡ãã£ã¢ãªãœãŒã¹ãå¿ èŠãšããããšããŠãŒã¶ãŒã«æåŸ ããªãããŸãã¯ãµãŒããŒãäžèŠãªãã©ãã£ãã¯ãæå°éã«ãããã®ããããã®ãŠãŒã¶ãŒãšãŒãžã§ã³ããžã®ãã³ãããããã¡ãªã³ã°ã¯ãšã«ããéå§ããïŒããšãã°ãŠãŒã¶ãŒã"play"ã«åœããïŒå Žåããã®ç¶æ ã¯ãã¡ãã£ã¢ãªãœãŒã¹ãå®éã«ããŠã³ããŒãããæ¹æ³ã«é¢ããŠç©æ¥µçã«ãã³ããæäŸããªãã |
metadata
| Metadata | èè
ãã¡ãã£ã¢ãªãœãŒã¹ãå¿
èŠãšãããšãŠãŒã¶ãŒã«æåŸ
ããªããããªãœãŒã¹ã®ã¡ã¿ããŒã¿ïŒå¯žæ³ããã©ãã¯ãªã¹ããæéãªã©ïŒãã§ãããããããŠããããæåã®æ°ãã¬ãŒã ãåççã§ãããŠãŒã¶ãŒãšãŒãžã§ã³ããžã®ãã³ãããŠãŒã¶ãŒãšãŒãžã§ã³ããæ£ç¢ºã«ã¡ã¿ããŒã¿ä»¥äžã®ãã®ããã§ããããªãå Žåãå
žåçã«ã¯ãäžéšã®ãã¬ãŒã ãåæ§ã«åŸãããããããHAVE_CURRENT_DATAãŸãã¯HAVE_FUTURE_DATAã«ãªãã«ãããããããã¡ãã£ã¢èŠçŽ ã¯HAVE_METADATAã«èšå®ãããreadyState屿§ã«çµãããã¡ãã£ã¢ãªãœãŒã¹ãåçããéãããšãã°ã¡ãã£ã¢ããŒã¿ãäŸç¶ãšããŠäžè²«ããåçãç¶æãæãé
ãå¯èœæ§ã®ã¬ãŒãã§åŸãããããã«ããŠã³ããŒããçµãããšã瀺åãããããªã垯åå¹
ã®äžè¶³ãèæ
®ãã¹ãã§ãããšãããŠãŒã¶ãŒãšãŒãžã§ã³ããžã®ãã³ãã
|
auto
| Automatic | ãŠãŒã¶ãŒãšãŒãžã§ã³ãããæ¥œèгçã«å šäœã®ãªãœãŒã¹ã®ããŠã³ããŒããå«ãããµãŒããŒãžã®ãªã¹ã¯ãªãã«ãæåã®ãŠãŒã¶ãŒã®ããŒãºã眮ãããšãã§ãããšãããŠãŒã¶ãŒãšãŒãžã§ã³ããžã®ãã³ãã |
空æååããŸã劥åœãªããŒã¯ãŒãã§ãããèªåç¶æ ã«å¯Ÿå¿ã¥ãããã¡ã¿ããŒã¿ç¶æ ã¯ãµãŒããŒã®è² è·ã軜æžããæé©ãªãŠãŒã¶ãŒãšã¯ã¹ããªãšã³ã¹ãæäŸãã劥åç¹ãšããŠç€ºåãããããã©ãã屿§ã®æ¬ æããã©ã«ãå€ã¯ããŠãŒã¶ãŒãšãŒãžã§ã³ãå®çŸ©ã§ããã
äžåºŠãŠãŒã¶ãŒãåçãå§ãããšãèè
ã¯ãåçã«"none"ãŸãã¯"metadata"ãã"auto"ã«å±æ§ãåãæ¿ãããããããªããããšãã°ãå€ãã®ãããªããã€ããŒãžäžã§ãèŠæ±ãããªããäžåºŠã«åç»ãç©æ¥µçã«ããŠã³ããŒããããéããããã¯å€ãã®åç»ãããŠã³ããŒããããã¹ãã§ã¯ãªãããšã瀺ãããã«äœ¿çšããããããããªãã
The preload attribute is intended to provide a hint to
the user agent about what the author thinks will lead to the best user experience. The attribute
may be ignored altogether, for example based on explicit user preferences or based on the
available connectivity.
The preload IDL attribute must
reflect the content attribute of the same name, limited to only known
values.
ïŒã¡ãã£ã¢ãåçããå Žåãpreload屿§ã«ãã£ãŠäžãããããã³ãã«ããããããèªç¶ã«æåã®ãããã¡ãæã€ã®ã§ïŒautoplay屿§ã¯preload屿§ãäžæžãã§ãããããããäž¡æ¹ãå«ããããšã¯ãšã©ãŒã§ã¯ãªãã
bufferedãŠãŒã¶ãŒãšãŒãžã§ã³ãããããã¡ãªã³ã°ããã¡ãã£ã¢ãªãœãŒã¹ã®ç¯å²ã衚ãTimeRangesãªããžã§ã¯ããè¿ãã
The buffered attribute must return a new
static normalized TimeRanges object that represents the ranges of the
media resource, if any, that the user agent has buffered, at the time the attribute
is evaluated. Users agents must accurately determine the ranges available, even for media streams
where this can only be determined by tedious inspection.
Typically this will be a single range anchored at the zero point, but if, e.g. the user agent uses HTTP range requests in response to seeking, then there could be multiple ranges.
User agents may discard previously buffered data.
Thus, a time position included within a range of the objects return by the buffered attribute at one time can end up being not included in
the range(s) of objects returned by the same attribute at later times.
durationã¡ãã£ã¢ãªãœãŒã¹ã®å§ç¹ãæéãŒãã§ãããšä»®å®ããŠãç§åäœã§ã¡ãã£ã¢ãªãœãŒã¹ã®é·ããè¿ãã
æéãå©çšã§ããªãå Žåã¯NaNãè¿ãã
ééã®ãªãã¹ããªãŒã ã«å¯ŸããŠInfinityãè¿ãã
currentTime [ = value ]ç§åäœã§ãå ¬åŒã®åçäœçœ®ãè¿ãã
æå®æéã«ã·ãŒã¯ããããã«ãèšå®å¯èœã§ããã
éžæããã¡ãã£ã¢ãªãœãŒã¹ããªãå ŽåããŸãã¯çŸåšã®ã¡ãã£ã¢ã³ã³ãããŒã©ãããå ŽåãInvalidStateErroräŸå€ãæããã
A media resource has a media timeline that maps times (in seconds) to positions in the media resource. The origin of a timeline is its earliest defined position. The duration of a timeline is its last defined position.
Establishing the media
timeline: If the media resource somehow specifies an explicit timeline whose
origin is not negative (i.e. gives each frame a specific time offset and gives the first frame a
zero or positive offset), then the media timeline should be that timeline. (Whether
the media resource can specify a timeline or not depends on the media resource's format.) If the media resource specifies an
explicit start time and date, then that time and date should be considered the zero point
in the media timeline; the timeline offset will be the time and date,
exposed using the getStartDate() method.
If the media resource has a discontinuous timeline, the user agent must extend the timeline used at the start of the resource across the entire resource, so that the media timeline of the media resource increases linearly starting from the earliest possible position (as defined below), even if the underlying media data has out-of-order or even overlapping time codes.
For example, if two clips have been concatenated into one video file, but the video format exposes the original times for the two clips, the video data might expose a timeline that goes, say, 00:15..00:29 and then 00:05..00:38. However, the user agent would not expose those times; it would instead expose the times as 00:15..00:29 and 00:29..01:02, as a single video.
In the rare case of a media resource that does not have an explicit timeline, the
zero time on the media timeline should correspond to the first frame of the
media resource. In the even rarer case of a media resource with no
explicit timings of any kind, not even frame durations, the user agent must itself determine the
time for each frame in a user-agent-defined manner.
An example of a file format with no explicit timeline but with explicit frame
durations is the Animated GIF format. An example of a file format with no explicit timings at all
is the JPEG-push format (multipart/x-mixed-replace with JPEG frames, often
used as the format for MJPEG streams).
If, in the case of a resource with no timing information, the user agent will nonetheless be able to seek to an earlier point than the first frame originally provided by the server, then the zero time should correspond to the earliest seekable time of the media resource; otherwise, it should correspond to the first frame received from the server (the point in the media resource at which the user agent began receiving the stream).
At the time of writing, there is no known format that lacks explicit frame time offsets yet still supports seeking to a frame before the first frame sent by the server.
Consider a stream from a TV broadcaster, which begins streaming on a sunny Friday afternoon in
October, and always sends connecting user agents the media data on the same media timeline, with
its zero time set to the start of this stream. Months later, user agents connecting to this
stream will find that the first frame they receive has a time with millions of seconds. The getStartDate() method would always return the date that the
broadcast started; this would allow controllers to display real times in their scrubber (e.g.
"2:30pm") rather than a time relative to when the broadcast began ("8 months, 4 hours, 12
minutes, and 23 seconds").
Consider a stream that carries a video with several concatenated fragments, broadcast by a
server that does not allow user agents to request specific times but instead just streams the
video data in a predetermined order, with the first frame delivered always being identified as
the frame with time zero. If a user agent connects to this stream and receives fragments defined
as covering timestamps 2010-03-20 23:15:00 UTC to 2010-03-21 00:05:00 UTC and 2010-02-12 14:25:00
UTC to 2010-02-12 14:35:00 UTC, it would expose this with a media timeline starting
at 0s and extending to 3,600s (one hour). Assuming the streaming server disconnected at the end
of the second clip, the duration attribute would then
return 3,600. The getStartDate() method would return a
Date object with a time corresponding to 2010-03-20 23:15:00 UTC. However, if a
different user agent connected five minutes later, it would (presumably) receive
fragments covering timestamps 2010-03-20 23:20:00 UTC to 2010-03-21 00:05:00 UTC and 2010-02-12
14:25:00 UTC to 2010-02-12 14:35:00 UTC, and would expose this with a media timeline
starting at 0s and extending to 3,300s (fifty five minutes). In this case, the getStartDate() method would return a Date object
with a time corresponding to 2010-03-20 23:20:00 UTC.
In both of these examples, the seekable attribute
would give the ranges that the controller would want to actually display in its UI; typically, if
the servers don't support seeking to arbitrary times, this would be the range of time from the
moment the user agent connected to the stream up to the latest frame that the user agent has
obtained; however, if the user agent starts discarding earlier information, the actual range
might be shorter.
In any case, the user agent must ensure that the earliest possible position (as defined below) using the established media timeline, is greater than or equal to zero.
The media timeline also has an associated clock. Which clock is used is user-agent defined, and may be media resource-dependent, but it should approximate the user's wall clock.
All the media elements that share current media controller use the same clock for their media timeline.
Media elements have a current playback position, which must initially (i.e. in the absence of media data) be zero seconds. The current playback position is a time on the media timeline.
Media elements also have an official playback position, which must initially be set to zero seconds. The official playback position is an approximation of the current playback position that is kept stable while scripts are running.
Media elements also have a default playback start position, which must initially be set to zero seconds. This time is used to allow the element to be seeked even before the media is loaded.
Each media element has a show poster flag. When a media
element is created, this flag must be set to true. This flag is used to control when the
user agent is to show a poster frame for a video element instead of showing the video
contents.
The currentTime attribute must, on
getting, return the media element's default playback start position,
unless that is zero, in which case it must return the element's official playback
position. The returned value must be expressed in seconds. On setting, if the media
element has a current media controller, then the user agent must throw an
InvalidStateError exception; otherwise, if the media element's readyState is HAVE_NOTHING, then it must set the media
element's default playback start position to the new value; otherwise, it must
set the official playback position to the new value and then seek to the new value. The new value must be interpreted as being in
seconds.
Media elements have an initial playback position, which must initially (i.e. in the absence of media data) be zero seconds. The initial playback position is updated when a media resource is loaded. The initial playback position is a time on the media timeline.
If the media resource is a streaming resource, then the user agent might be unable to obtain certain parts of the resource after it has expired from its buffer. Similarly, some media resources might have a media timeline that doesn't start at zero. The earliest possible position is the earliest position in the stream or resource that the user agent can ever obtain again. It is also a time on the media timeline.
The earliest possible position is not explicitly exposed in the API;
it corresponds to the start time of the first range in the seekable attribute's TimeRanges object, if any, or
the current playback position otherwise.
When the earliest possible position changes, then: if the current playback
position is before the earliest possible position, the user agent must seek to the earliest possible position; otherwise, if
the user agent has not fired a timeupdate event at the
element in the past 15 to 250ms and is not still running event handlers for such an event, then
the user agent must queue a task to fire a simple event named timeupdate at the element.
Because of the above requirement and the requirement in the resource fetch algorithm that kicks in when the metadata of the clip becomes known, the current playback position can never be less than the earliest possible position.
If at any time the user agent learns that an audio or video track has ended and all media
data relating to that track corresponds to parts of the media timeline that
are before the earliest possible position, the user agent may queue a
task to first remove the track from the audioTracks
attribute's AudioTrackList object or the videoTracks attribute's VideoTrackList object as
appropriate and then fire a trusted event with the name removetrack, that does not bubble and is not cancelable, and that
uses the TrackEvent interface, with the track attribute initialized to the AudioTrack or
VideoTrack object representing the track, at the media element's
aforementioned AudioTrackList or VideoTrackList object.
The duration attribute must return the time
of the end of the media resource, in seconds, on the media timeline. If
no media data is available, then the attributes must return the Not-a-Number (NaN)
value. If the media resource is not known to be bounded (e.g. streaming radio, or a
live event with no announced end time), then the attribute must return the positive Infinity
value.
The user agent must determine the duration of the media resource before playing
any part of the media data and before setting readyState to a value equal to or greater than HAVE_METADATA, even if doing so requires fetching multiple
parts of the resource.
When the length of the media resource changes to a known value
(e.g. from being unknown to known, or from a previously established length to a new length) the
user agent must queue a task to fire a simple event named durationchange at the media element. (The
event is not fired when the duration is reset as part of loading a new media resource.) If the
duration is changed such that the current playback position ends up being greater
than the time of the end of the media resource, then the user agent must also seek to the time of the end of the media resource.
If an "infinite" stream ends for some reason, then the duration would change
from positive Infinity to the time of the last frame or sample in the stream, and the durationchange event would be fired. Similarly, if the
user agent initially estimated the media resource's duration instead of determining
it precisely, and later revises the estimate based on new information, then the duration would
change and the durationchange event would be
fired.
Some video files also have an explicit date and time corresponding to the zero time in the media timeline, known as the timeline offset. Initially, the timeline offset must be set to Not-a-Number (NaN).
The getStartDate() method must return a new Date object representing the current
timeline offset.
loop屿§ã¯çåœå±æ§ã§ãããæå®ãããå Žåãçµç«¯ã«éãããšã¡ãã£ã¢ãªãœãŒã¹ã®å
é ã«æ»ã£ãŠã·ãŒã¯ããã¡ãã£ã¢èŠçŽ ã§ããããšã瀺ãã
èŠçŽ ãçŸåšã®ã¡ãã£ã¢ã³ã³ãããŒã©ãæã€äžæ¹ã§ãloop屿§ã¯å¹æããªãã
The loop IDL attribute must reflect
the content attribute of the same name.
readyState以äžã®ãªã¹ãã®ã³ãŒããããçŸåšã®åçäœçœ®ãã¬ã³ããªã³ã°ã«å¯ŸããèŠçŽ ã®çŸåšã®ç¶æ ã衚ãå€ãè¿ãã
Media elements have a ready state, which describes to what degree they are ready to be rendered at the current playback position. The possible values are as follows; the ready state of a media element at any particular time is the greatest value describing the state of the element:
HAVE_NOTHINGïŒæ°å€0ïŒã¡ãã£ã¢ãªãœãŒã¹ã«é¢ããæ
å ±ãå
¥æã§ããªããçŸåšã®åçäœçœ®ã®ããŒã¿ãå
¥æã§ããªããnetworkState屿§ãNETWORK_EMPTYã«èšå®ãããã¡ãã£ã¢èŠçŽ ã¯åžžã«HAVE_NOTHINGç¶æ
ã«ããã
HAVE_METADATAïŒæ°å€1ïŒãªãœãŒã¹ã®ç¶ç¶æéã䜿çšå¯èœã§ãããããªãååãªãªãœãŒã¹ãåŸãããŠãããvideoèŠçŽ ã®å Žåããããªã®å¯žæ³ããŸãå©çšå¯èœã§ãããã·ãŒã¯æã«APIã¯ãã¯ãäŸå€ãæããªããã¡ãã£ã¢ããŒã¿ã¯ãããã«çŸåšã®åçäœçœ®ã«å¯ŸããŠå©çšã§ããªãã
HAVE_CURRENT_DATAïŒæ°å€2ïŒçŽæ¥ã®çŸåšã®åçäœçœ®ã«å¯ŸããããŒã¿ã¯äœ¿çšå¯èœã§ããããçŽã¡ã«HAVE_METADATAç¶æ
ã«æ»ãããšãªãããŸã£ããåçæ¹åã«ãªãçŸåšã®åçäœçœ®ãæ£åžžã«é²ããããšãã§ãããŠãŒã¶ãŒãšãŒãžã§ã³ããå©çšå¯èœãšããã®ã«ååãªããŒã¿ããªãããåçæ¹åã§å
¥æããããã®ãã以äžããŒã¿ãååšããªããã®ããããã§ãããããšãã°ããããªã«ãããŠçŸåšã®åçäœçœ®ãçŸåšã®ãã¬ãŒã ã®ç«¯ã«ãããããã³åçãçµäºããå Žåãããã¯æ¬¡ã®ãã¬ãŒã ã§ã¯ãªããçŸåšã®ãã¬ãŒã ããããŒã¿ãæã€ãŠãŒã¶ãŒãšãŒãžã§ã³ãã«å¯Ÿå¿ããã
HAVE_FUTURE_DATAïŒæ°å€3ïŒçŽæ¥ã®çŸåšã®åçäœçœ®ã«å¯ŸããããŒã¿ãå©çšå¯èœã§ãããçŽã¡ã«HAVE_METADATAã®ç¶æ
ã«æ»ãããšãªããå°ãªããšãåçæ¹åã§ã®çŸåšã®åçäœçœ®ãé²ããããã®ãŠãŒã¶ãŒãšãŒãžã§ã³ãã«å¯ŸããååãªããŒã¿ãåæ§ã«ãããããã¹ããã©ãã¯ã¯æºåãæŽããããšãã°ããããªã«ãããŠãçŸåšã®åçäœçœ®ã2ã€ã®ãã¬ãŒã éã®ç¬éã§ããéã«ãå°ãªããšãçŸåšã®ãã¬ãŒã ãšæ¬¡ã®ãã¬ãŒã ã«å¯ŸããããŒã¿ãæã€ãŠãŒã¶ãŒãšãŒãžã§ã³ãã«ããã¯å¯Ÿå¿ããããçŸåšã®åçäœçœ®ããã¬ãŒã ã®éäžã«ããéãå°ãªããšãåçãç¶æããããã®çŸåšã®ãã¬ãŒã ãšé³å£°ããŒã¿ã«å¯ŸãããããªããŒã¿ãæã€ãŠãŒã¶ãŒãšãŒãžã§ã³ãã«å¯Ÿå¿ããããã®å Žåã«ãããŠãçŸåšã®åçäœçœ®ã¯é²ããããšã¯ã§ããªãã®ã§ãåçãçµäºããå Žåã«ãŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãã®ç¶æ
ã«ã¯ãªããªãã
HAVE_ENOUGH_DATAïŒæ°å€4ïŒHAVE_FUTURE_DATAç¶æ
ã«ã€ããŠèª¬æããããã¹ãŠã®æ¡ä»¶ãæºããããå ããŠã以äžã®ããããã®æ¡ä»¶ãçã§ããïŒ
å®éã«ã¯ãHAVE_METADATAãšHAVE_CURRENT_DATAãšã®éãã¯ãããããã§ãããcanvasã«videoèŠçŽ ãæç»ããéã®ã¿ãæ¬åœã«éããé¢é£ããŠãããããã§ãäœããæç»ãããïŒHAVE_CURRENT_DATA以äžïŒå Žåãšäœãæç»ãããªãïŒHAVE_METADATA以äžïŒå Žåãåºå¥ãããåæ§ã«ãHAVE_CURRENT_DATAïŒçŸåšã®ãã¬ãŒã ã®ã¿ïŒãšHAVE_FUTURE_DATAïŒå°ãªããšããã®ãã¬ãŒã ãšæ¬¡ïŒã®å·®ã¯ãç¡èŠã§ããïŒæ¥µç«¯ã«ã¯ã1ãã¬ãŒã ã ãïŒãããŒãžã"ãã¬ãŒã ããšã®"ããã²ãŒã·ã§ã³ã«ã€ã³ã¿ãŒãã§ãŒã¹ãæäŸããéã«ãæ¹åãæ¬åœã«éèŠãªåãªãæéã§ããã
When the ready state of a media element whose networkState is not NETWORK_EMPTY changes, the user agent must follow the steps
given below:
Apply the first applicable set of substeps from the following list:
HAVE_NOTHING,
and the new ready state is HAVE_METADATAQueue a task to fire a simple event named loadedmetadata at the element.
Before this task is run, as part of the event loop mechanism, the
rendering will have been updated to resize the video element if appropriate.
HAVE_METADATA and the new ready state is HAVE_CURRENT_DATA or greaterIf this is the first time this occurs for this media
element since the load() algorithm was last
invoked, the user agent must queue a task to fire a simple event
named loadeddata at the element.
If the new ready state is HAVE_FUTURE_DATA
or HAVE_ENOUGH_DATA, then the relevant steps
below must then be run also.
HAVE_FUTURE_DATA or more, and the new ready state is
HAVE_CURRENT_DATA or lessIf the media element was potentially
playing before its readyState attribute
changed to a value lower than HAVE_FUTURE_DATA, and the element has not
ended playback, and playback has not stopped due to errors,
paused for user interaction, or paused for in-band content, the user
agent must queue a task to fire a simple event named timeupdate at the element, and queue a task
to fire a simple event named waiting at
the element.
HAVE_CURRENT_DATA or less, and the new ready state
is HAVE_FUTURE_DATAThe user agent must queue a task to fire a simple event named
canplay at the element.
If the element's paused attribute is false, the user
agent must queue a task to fire a simple event named playing at the element.
HAVE_ENOUGH_DATAIf the previous ready state was HAVE_CURRENT_DATA or less, the user agent must
queue a task to fire a simple event named canplay at the element, and, if the element's paused attribute is false, queue a task to
fire a simple event named playing
at the element.
If the autoplaying flag is true, and the paused attribute is true, and the media element
has an autoplay attribute specified, and the
media element's Document's active sandboxing flag set
does not have the sandboxed automatic features browsing context flag set, then
the user agent may also run the following substeps:
paused attribute to false.play at the element.playing at the element.User agents do not need to support autoplay, and it is suggested that user
agents honor user preferences on the matter. Authors are urged to use the autoplay attribute rather than using script to force the
video to play, so as to allow the user to override the behavior if so desired.
In any case, the user agent must finally queue a task to fire a simple
event named canplaythrough at the element.
If the media element has a current media controller, then report the controller state for the media element's current media controller.
ã¡ãã£ã¢èŠçŽ ã®æºåç¶æ
ã¯ããããã®ç¶æ
éãäžé£ç¶ã«ãžã£ã³ãããããšãå¯èœã§ãããããšãã°ãã¡ãã£ã¢èŠçŽ ã®ç¶æ
ã¯ãHAVE_CURRENT_DATAãšHAVE_FUTURE_DATAç¶æ
ãçµç±ããã«HAVE_METADATAããHAVE_ENOUGH_DATAã«çŽæ¥ãžã£ã³ãã§ããã
The readyState IDL attribute must, on
getting, return the value described above that describes the current ready state of the
media element.
autoplay屿§ã¯çåœå±æ§ã§ãããWhen present, the user agent (as described in the algorithm described herein) will automatically begin playback of the media resource as soon as it can do so without stopping.
èè
ã¯ãæãŸããªãå Žåãããšãã°ã¹ã¯ãªãŒã³ãªãŒããŒã䜿çšããå ŽåããŠãŒã¶ãŒãèªååçãäžæžãã§ãããããèªååçãèªçºããããã®ã¹ã¯ãªããã䜿çšããããããautoplay屿§ã䜿çšããããã«ä¿ããããèè
ã¯ãŸããäžåèªååçã®åäœã䜿çšããããšãªãã代ããã«æç€ºçã«åçãéå§ããããã®ãŠãŒã¶ãŒã«å¯ŸããŠãŠãŒã¶ãŒãšãŒãžã§ã³ããåŸ
æ©ããªãããèæ
®ããããšãæšå¥šãããã
The autoplay IDL attribute must
reflect the content attribute of the same name.
pausedåçãäžæåæ¢ãããå Žåã¯trueãè¿ããããã§ãªããã°falseãè¿ãã
endedåçãã¡ãã£ã¢ãªãœãŒã¹ã®çµããã«éããå Žåtrueãè¿ãã
defaultPlaybackRate [ = value ]ã¡ãã£ã¢ãªãœãŒã¹ãä»ããŠãŠãŒã¶ãŒãæ©éããŸãã¯å·»ãæ»ãããªãå Žåã«å¯Ÿããåçã®ããã©ã«ãçãè¿ãã
åçã®ããã©ã«ãçã倿Žããèšå®ãå¯èœã§ããã
ããã©ã«ãçã¯åçã«çŽæ¥åœ±é¿ãäžããªããããŠãŒã¶ãŒãæ©éãã¢ãŒãã«åãæ¿ããå Žåãã¢ãŒããéåžžã®åçã¢ãŒãã«æ»ã£ãéã«ãåçé床ãåçã®ããã©ã«ãçã«æ»ãããããšãæåŸ ãããã
èŠçŽ ãçŸåšã®ã¡ãã£ã¢ã³ã³ãããŒã©ãæã€å ŽåãdefaultPlaybackRate屿§ã¯ç¡èŠãããçŸåšã®ã¡ãã£ã¢ã³ã³ãããŒã©ã®defaultPlaybackRateã代ããã«äœ¿çšãããã
playbackRate [ = value ]çŸåšã®åççãè¿ããããã§1.0ãéåžžã®é床ã§ããã
åçé床ã倿Žããèšå®ãå¯èœã§ããã
èŠçŽ ãçŸåšã®ã¡ãã£ã¢ã³ã³ãããŒã©ãæã€å ŽåãplaybackRate屿§ã¯ç¡èŠãããçŸåšã®ã¡ãã£ã¢ã³ã³ãããŒã©ã®playbackRateã代ããã«äœ¿çšãããã
playedãŠãŒã¶ãŒãšãŒãžã§ã³ããåçããã¡ãã£ã¢ãªãœãŒã¹ã®ç¯å²ã衚ãTimeRangesãªããžã§ã¯ããè¿ãã
play()å¿
èŠã«å¿ããŠã¡ãã£ã¢ãªãœãŒã¹ãèªã¿èŸŒãã§åçãéå§ããpaused屿§ãfalseã«èšå®ãããåçãçµäºããå ŽåãæåãããªãœãŒã¹ãåã¹ã¿ãŒãããã
pause()å¿
èŠã«å¿ããŠãã¡ãã£ã¢ãªãœãŒã¹ãèªã¿èŸŒã¿ãpaused屿§ãtrueã«èšå®ããã
The paused attribute represents whether the
media element is paused or not. The attribute must initially be true.
A media element is a blocked media element if its readyState attribute is in the HAVE_NOTHING state, the HAVE_METADATA state, or the HAVE_CURRENT_DATA state, or if the element has
paused for user interaction or paused for in-band content.
A media element is said to be potentially playing when its paused attribute is false, the element has not ended
playback, playback has not stopped due to errors, the element either has no
current media controller or has a current media controller but is not
blocked on its media controller, and the element is not a blocked media
element.
A waiting DOM event can be fired as a result of an element that is
potentially playing stopping playback due to its readyState attribute changing to a value lower than HAVE_FUTURE_DATA.
A media element is said to have ended playback when:
readyState attribute is HAVE_METADATA or greater, and
Either:
loop attribute specified, or the media element has
a current media controller.
ãŸãã¯ïŒ
The ended attribute must return true if, the
last time the event loop reached step 1, the media element had
ended playback and the direction of playback was forwards, and false
otherwise.
A media element is said to have stopped due to errors when the
element's readyState attribute is HAVE_METADATA or greater, and the user agent encounters a non-fatal error during the processing of the
media data, and due to that error, is not able to play the content at the
current playback position.
A media element is said to have paused for user interaction when its
paused attribute is false, the readyState attribute is either HAVE_FUTURE_DATA or HAVE_ENOUGH_DATA and the user agent has reached a point
in the media resource where the user has to make a selection for the resource to
continue. If the media element has a current media controller when this
happens, then the user agent must report the controller state for the media
element's current media controller. If the media element has a
current media controller when the user makes a selection, allowing playback to
resume, the user agent must similarly report the controller state for the media
element's current media controller.
It is possible for a media element to have both ended playback and paused for user interaction at the same time.
When a media element that is potentially playing stops playing
because it has paused for user interaction, the user agent must queue a
task to fire a simple event named timeupdate at the element.
A media element is said to have paused for in-band content when its
paused attribute is false, the readyState attribute is either HAVE_FUTURE_DATA or HAVE_ENOUGH_DATA and the user agent has suspended
playback of the media resource in order to play content that is temporally anchored
to the media resource and has a non-zero length, or to play content that is
temporally anchored to a segment of the media resource but has a length longer than
that segment. If the media element has a current media controller when
this happens, then the user agent must report the controller state for the
media element's current media controller. If the media
element has a current media controller when the user agent unsuspends
playback, the user agent must similarly report the controller state for the
media element's current media controller.
One example of when a media element would be paused for in-band content is when the user agent is playing audio descriptions from an external WebVTT file, and the synthesized speech generated for a cue is longer than the time between the text track cue start time and the text track cue end time.
When the current playback position reaches the end of the media resource when the direction of playback is forwards, then the user agent must follow these steps:
If the media element has a loop
attribute specified and does not have a current media controller, then seek to the earliest possible position of the
media resource and abort these steps.
As defined above, the ended IDL attribute starts
returning true once the event loop's current task
ends.
Queue a task to fire a simple event named timeupdate at the media element.
Queue a task that, if the media element does not have a
current media controller, and the media element has still ended
playback, and the direction of playback is still forwards, and paused is false, changes paused to true and fires a
simple event named pause at the media
element.
Queue a task to fire a simple event named ended at the media element.
If the media element has a current media controller, then report the controller state for the media element's current media controller.
When the current playback position reaches the earliest possible
position of the media resource when the direction of playback is
backwards, then the user agent must only queue a task to fire a simple
event named timeupdate at the element.
The defaultPlaybackRate attribute
gives the desired speed at which the media resource is to play, as a multiple of its
intrinsic speed. The attribute is mutable: on getting it must return the last value it was set to,
or 1.0 if it hasn't yet been set; on setting the attribute must be set to the new value.
The defaultPlaybackRate is used
by the user agent when it exposes a user
interface to the user.
The playbackRate attribute gives the
effective playback rate (assuming there is no current media controller
overriding it), which is the speed at which the media resource plays, as a multiple
of its intrinsic speed. If it is not equal to the defaultPlaybackRate, then the implication is that the
user is using a feature such as fast forward or slow motion playback. The attribute is mutable: on
getting it must return the last value it was set to, or 1.0 if it hasn't yet been set; on setting
the attribute must be set to the new value, and the playback will change speed (if the element is
potentially playing and there is no current media controller).
When the defaultPlaybackRate
or playbackRate attributes change value (either by
being set by script or by being changed directly by the user agent, e.g. in response to user
control) the user agent must queue a task to fire a simple event named
ratechange at the media element.
The defaultPlaybackRate and
playbackRate attributes have no effect when the
media element has a current media controller; the namesake attributes on
the MediaController object are used instead in that situation.
The played attribute must return a new static
normalized TimeRanges object that represents the ranges of points on the
media timeline of the media resource reached through the usual monotonic
increase of the current playback position during normal playback, if any, at the time
the attribute is evaluated.
When the play() method on a media
element is invoked, the user agent must run the following steps.
If the media element's networkState attribute has the value NETWORK_EMPTY, invoke the media element's
resource selection algorithm.
If the playback has ended and the direction of playback is forwards, and the media element does not have a current media controller, seek to the earliest possible position of the media resource.
This will cause the user agent to queue a
task to fire a simple event named timeupdate at the media element.
If the media element has a current media controller, then bring the media element up to speed with its new media controller.
If the media element's paused attribute is
true, run the following substeps:
Change the value of paused to false.
If the show poster flag is true, set the element's show poster flag to false and run the time marches on steps.
Queue a task to fire a simple event named play at the element.
If the media element's readyState
attribute has the value HAVE_NOTHING, HAVE_METADATA, or HAVE_CURRENT_DATA, queue a task to
fire a simple event named waiting at the
element.
Otherwise, the media element's readyState attribute has the value HAVE_FUTURE_DATA or HAVE_ENOUGH_DATA: queue a task to
fire a simple event named playing at the
element.
Set the media element's autoplaying flag to false.
If the media element has a current media controller, then report the controller state for the media element's current media controller.
When the pause() method is invoked, and when
the user agent is required to pause the media element, the user agent must run the
following steps:
If the media element's networkState attribute has the value NETWORK_EMPTY, invoke the media element's
resource selection algorithm.
Set the media element's autoplaying flag to false.
If the media element's paused attribute
is false, run the following steps:
Change the value of paused to true.
Queue a task to fire a simple
event named timeupdate at the
element.
Queue a task to fire a simple
event named pause
at the element.
Set the official playback position to the current playback position.
If the media element has a current media controller, then report the controller state for the media element's current media controller.
The effective playback rate is not necessarily the element's playbackRate. When a media element has a
current media controller, its effective playback rate is the
MediaController's media controller playback rate. Otherwise, the
effective playback rate is just the element's playbackRate. Thus, the current media
controller overrides the media element.
If the effective playback rate is positive or zero, then the direction of playback is forwards. Otherwise, it is backwards.
When a media element is potentially playing and
its Document is a fully active Document, its current
playback position must increase monotonically at effective playback rate units
of media time per unit time of the media timeline's clock. (This specification always
refers to this as an increase, but that increase could actually be a decrease if
the effective playback rate is negative.)
The effective playback rate can be 0.0, in which case the
current playback position doesn't move, despite playback not being paused (paused doesn't become true, and the pause event doesn't fire).
This specification doesn't define how the user agent achieves the appropriate playback rate â depending on the protocol and media available, it is plausible that the user agent could negotiate with the server to have the server provide the media data at the appropriate rate, so that (except for the period between when the rate is changed and when the server updates the stream's playback rate) the client doesn't actually have to drop or interpolate any frames.
Any time the user agent provides a stable state, the official playback position must be set to the current playback position.
When the direction of playback is backwards, any corresponding audio must be muted. When the effective playback rate is so low or so high that the user agent cannot play audio usefully, the corresponding audio must also be muted. If the effective playback rate is not 1.0, the user agent may apply pitch adjustments to the audio as necessary to render it faithfully.
Media elements that are potentially playing
while not in a Document must not play any video, but should play any
audio component. Media elements must not stop playing just because all references to them have
been removed; only once a media element is in a state where no further audio could ever be played
by that element may the element be garbage collected.
It is possible for an element to which no explicit references exist to play audio, even if such an element is not still actively playing: for instance, it could have a current media controller that still has references and can still be unpaused, or it could be unpaused but stalled waiting for content to buffer.
Each media element has a list of newly introduced cues, which must be initially empty. Whenever a text track cue is added to the list of cues of a text track that is in the list of text tracks for a media element, that cue must be added to the media element's list of newly introduced cues. Whenever a text track is added to the list of text tracks for a media element, all of the cues in that text track's list of cues must be added to the media element's list of newly introduced cues. When a media element's list of newly introduced cues has new cues added while the media element's show poster flag is not set, then the user agent must run the time marches on steps.
When a text track cue is removed from the list of cues of a text track that is in the list of text tracks for a media element, and whenever a text track is removed from the list of text tracks of a media element, if the media element's show poster flag is not set, then the user agent must run the time marches on steps.
When the current playback position of a media element changes (e.g. due to playback or seeking), the user agent must run the time marches on steps. If the current playback position changes while the steps are running, then the user agent must wait for the steps to complete, and then must immediately rerun the steps. (These steps are thus run as often as possible or needed â if one iteration takes a long time, this can cause certain cues to be skipped over as the user agent rushes ahead to "catch up".)
The time marches on steps are as follows:
Let current cues be a list of cues, initialized to contain all the cues of all the hidden or showing text tracks of the media element (not the disabled ones) whose start times are less than or equal to the current playback position and whose end times are greater than the current playback position.
Let other cues be a list of cues, initialized to contain all the cues of hidden and showing text tracks of the media element that are not present in current cues.
Let last time be the current playback position at the time this algorithm was last run for this media element, if this is not the first time it has run.
If the current playback position has, since the last time this algorithm was run, only changed through its usual monotonic increase during normal playback, then let missed cues be the list of cues in other cues whose start times are greater than or equal to last time and whose end times are less than or equal to the current playback position. Otherwise, let missed cues be an empty list.
Remove all the cues in missed cues that are also in the media element's list of newly introduced cues, and then empty the element's list of newly introduced cues.
If the time was reached through the usual monotonic increase of the current playback
position during normal playback, and if the user agent has not fired a timeupdate event at the element in the past 15 to 250ms and
is not still running event handlers for such an event, then the user agent must queue a
task to fire a simple event named timeupdate at the element. (In the other cases, such as
explicit seeks, relevant events get fired as part of the overall process of changing the
current playback position.)
The event thus is not to be fired faster than about 66Hz or slower than 4Hz (assuming the event handlers don't take longer than 250ms to run). User agents are encouraged to vary the frequency of the event based on the system load and the average cost of processing the event each time, so that the UI updates are not any more frequent than the user agent can comfortably handle while decoding the video.
If all of the cues in current cues have their text track cue active flag set, none of the cues in other cues have their text track cue active flag set, and missed cues is empty, then abort these steps.
If the time was reached through the usual monotonic increase of the current playback position during normal playback, and there are cues in other cues that have their text track cue pause-on-exit flag set and that either have their text track cue active flag set or are also in missed cues, then immediately pause the media element.
In the other cases, such as explicit seeks, playback is not paused by going past the end time of a cue, even if that cue has its text track cue pause-on-exit flag set.
Let events be a list of tasks, initially empty. Each task in this list will be associated with a text track, a text track cue, and a time, which are used to sort the list before the tasks are queued.
Let affected tracks be a list of text tracks, initially empty.
When the steps below say to prepare an event named event for a text track cue target with a time time, the user agent must run these substeps:
Let track be the text track with which the text track cue target is associated.
Create a task to fire a simple event named event at target.
Add the newly created task to events, associated with the time time, the text track track, and the text track cue target.
Add track to affected tracks.
For each text track cue in missed
cues, prepare an event named enter for the
TextTrackCue object with the text track cue start time.
For each text track cue in other
cues that either has its text track cue active flag set or is in missed cues, prepare an event named exit for the TextTrackCue object with the later of the
text track cue end time and the text track cue start time.
For each text track cue in current
cues that does not have its text track cue active flag set, prepare an
event named enter for the TextTrackCue
object with the text track cue start time.
Sort the tasks in events in ascending time order (tasks with earlier times first).
Further sort tasks in events that have the same time by the relative text track cue order of the text track cues associated with these tasks.
Finally, sort tasks in events that have
the same time and same text track cue order by placing tasks that fire enter events before
those that fire exit events.
Sort affected tracks in the same order as the text tracks appear in the media element's list of text tracks, and remove duplicates.
For each text track in affected tracks, in the list
order, queue a task to fire a simple event named cuechange at the TextTrack object, and, if the
text track has a corresponding track element, to then fire a
simple event named cuechange at the
track element as well.
Set the text track cue active flag of all the cues in the current cues, and unset the text track cue active flag of all the cues in the other cues.
Run the rules for updating the text track rendering of each of the text tracks in affected tracks that are showing. For example, for text tracks based on WebVTT, the rules for updating the display of WebVTT text tracks. [WEBVTT]
For the purposes of the algorithm above, a text track cue is considered to be part of a text track only if it is listed in the text track list of cues, not merely if it is associated with the text track.
If the media element's Document stops being a
fully active document, then the playback will stop
until the document is active again.
When a media element is removed
from a Document, the user agent must run the following steps:
Asynchronously await a stable state, allowing the task that removed the media element from the
Document to continue. The synchronous section consists of all the
remaining steps of this algorithm. (Steps in the synchronous section are marked with
â.)
â If the media element is in a Document,
abort these steps.
â If the media element's networkState attribute has the value NETWORK_EMPTY, abort these steps.
â Pause the media element.
seekingãŠãŒã¶ãŒãšãŒãžã§ã³ããçŸåšã·ãŒã¯ããŠããå Žåã«trueãè¿ãã
seekableãŠãŒã¶ãŒãšãŒãžã§ã³ããã·ãŒã¯å¯èœã§ããã¡ãã£ã¢ãªãœãŒã¹ã®ç¯å²ã衚ãTimeRangesãªããžã§ã¯ããè¿ãã
The seeking attribute must initially have the
value false.
When the user agent is required to seek to a particular new playback position in the media resource, optionally with the approximate-for-speed flag set, it means that the user agent must run the following steps. This algorithm interacts closely with the event loop mechanism; in particular, it has a synchronous section (which is triggered as part of the event loop algorithm). Steps in that section are marked with â.
Set the media element's show poster flag to false.
If the media element's readyState
is HAVE_NOTHING, abort these steps.
If the element's seeking IDL attribute is true,
then another instance of this algorithm is already running. Abort that other instance of the
algorithm without waiting for the step that it is running to complete.
Set the seeking IDL attribute to true.
If the seek was in response to a DOM method call or setting of an IDL attribute, then continue the script. The remainder of these steps must be run asynchronously. With the exception of the steps marked with â, they could be aborted at any time by another instance of this algorithm being invoked.
If the new playback position is later than the end of the media resource, then let it be the end of the media resource instead.
If the new playback position is less than the earliest possible position, let it be that position instead.
If the (possibly now changed) new playback position is not in one of
the ranges given in the seekable attribute, then let it
be the position in one of the ranges given in the seekable attribute that is the nearest to the new
playback position. If two positions both satisfy that constraint (i.e. the new playback position is exactly in the middle between two ranges in the seekable attribute) then use the position that is closest to
the current playback position. If there are no ranges given in the seekable attribute then set the seeking IDL attribute to false and abort these steps.
If the approximate-for-speed flag is set, adjust the new playback position to a value that will allow for playback to resume promptly. If new playback position before this step is before current playback position, then the adjusted new playback position must also be before the current playback position. Similarly, if the new playback position before this step is after current playback position, then the adjusted new playback position must also be after the current playback position.
For example, the user agent could snap to the nearest key frame, so that it doesn't have to spend time decoding then discarding intermediate frames before resuming playback.
Queue a task to fire a simple event named seeking at the element.
Set the current playback position to the given new playback position.
If the media element was potentially playing
immediately before it started seeking, but seeking caused its readyState attribute to change to a value lower than HAVE_FUTURE_DATA, then a waiting will be
fired at the element.
The currentTime attribute does not
get updated asynchronously, as it returns the official playback position, not the
current playback position.
Wait until the user agent has established whether or not the media data for the new playback position is available, and, if it is, until it has decoded enough data to play back that position.
Await a stable state. The synchronous section consists of all the remaining steps of this algorithm. (Steps in the synchronous section are marked with â.)
â Set the seeking IDL attribute to
false.
â Run the time marches on steps.
â Queue a task to fire a simple event
named timeupdate at the element.
â Queue a task to fire a simple event named seeked at the element.
The seekable attribute must return a new
static normalized TimeRanges object that represents the ranges of the
media resource, if any, that the user agent is able to seek to, at the time the
attribute is evaluated.
If the user agent can seek to anywhere in the media resource, e.g.
because it is a simple movie file and the user agent and the server support HTTP Range requests,
then the attribute would return an object with one range, whose start is the time of the first
frame (the earliest possible position, typically zero), and whose end is the same as
the time of the first frame plus the duration attribute's
value (which would equal the time of the last frame, and might be positive Infinity).
The range might be continuously changing, e.g. if the user agent is buffering a sliding window on an infinite stream. This is the behavior seen with DVRs viewing live TV, for instance.
Media resources might be internally scripted or interactive. Thus, a media element could play in a non-linear fashion. If this happens, the user agent must act as if the algorithm for seeking was used whenever the current playback position changes in a discontinuous fashion (so that the relevant events fire). If the media element has a current media controller, then the user agent must seek the media controller appropriately instead.
ã¡ãã£ã¢ãªãœãŒã¹ ã¯ãè€æ°ã®åã蟌ã¿ãªãŒãã£ãªããã³ãããªãã©ãã¯ãæã€ããšãã§ãããããšãã°ãäž»ãããªãã©ãã¯ãšãªãŒãã£ãªãã©ãã¯ã«å ããŠãã¡ãã£ã¢ãªãœãŒã¹ã¯ãå€åœèªå¹ãæ¿ãã®ãããšããç£ç£ã®è§£èª¬ãé³å£°ã«ãã説æã代æ¿ã¢ã³ã°ã«ããŸãã¯æè©±ã®ãªãŒããŒã¬ã€ãæã€ãããããªãã
audioTracksã¡ãã£ã¢ãªãœãŒã¹ã§äœ¿çšå¯èœãªãªãŒãã£ãªãã©ãã¯ã衚ãAudioTrackListãªããžã§ã¯ããè¿ãã
videoTracksã¡ãã£ã¢ãªãœãŒã¹ã§äœ¿çšå¯èœãªãããªãã©ãã¯ã衚ãVideoTrackListãªããžã§ã¯ããè¿ãã
The audioTracks attribute of a
media element must return a live AudioTrackList object
representing the audio tracks available in the media element's media
resource. The same object must be returned each time.
The videoTracks attribute of a
media element must return a live VideoTrackList object
representing the video tracks available in the media element's media
resource. The same object must be returned each time.
There are only ever one AudioTrackList object and one
VideoTrackList object per media element, even if another media
resource is loaded into the element: the objects are reused. (The AudioTrack
and VideoTrack objects are not, though.)
ãã®äŸã«ãããŠãã¹ã¯ãªããã¯ããããªããã³åç»ãé 眮ãããèŠçŽ ã®åç §ãžã®URLãååŸãã颿°ãå®çŸ©ããããã®æ©èœã¯ãããªã®èªã¿èŸŒã¿ã詊ã¿ããããŠãäžåºŠèªã¿èŸŒãŸãããšãå©çšå¯èœãªæè©±ãã©ãã¯ããããã©ããããã§ãã¯ãããååšããå Žåããã®ãã©ãã¯ã衚瀺ãããäž¡æ¹ã®ãã©ãã¯ã¯äžããããã³ã³ããã«ã®ã¿é 眮ããããã¹ã¿ã€ã«ãå·§åŠãªæ¹æ³ã§ãã®äœæ¥ãè¡ãããã«é©çšãããããšãåæã«ããŠããã
<script>
function loadVideo(url, container) {
var controller = new MediaController();
var video = document.createElement('video');
video.src = url;
video.autoplay = true;
video.controls = true;
video.controller = controller;
container.appendChild(video);
video.onloadedmetadata = function (event) {
for (var i = 0; i < video.videoTracks.length; i += 1) {
if (video.videoTracks[i].kind == 'sign') {
var sign = document.createElement('video');
sign.src = url + '#track=' + video.videoTracks[i].id;
sign.autoplay = true;
sign.controller = controller;
container.appendChild(sign);
return;
}
}
};
}
</script>
AudioTrackListããã³VideoTrackListãªããžã§ã¯ãAudioTrackListããã³VideoTrackListã€ã³ã¿ãŒãã§ãŒã¹ã¯ãåç¯ã§å®çŸ©ããã屿§ã§äœ¿çšãããã
interface AudioTrackList : EventTarget {
readonly attribute unsigned long length;
getter AudioTrack (unsigned long index);
AudioTrack? getTrackById(DOMString id);
attribute EventHandler onchange;
attribute EventHandler onaddtrack;
attribute EventHandler onremovetrack;
};
interface AudioTrack {
readonly attribute DOMString id;
readonly attribute DOMString kind;
readonly attribute DOMString label;
readonly attribute DOMString language;
attribute boolean enabled;
};
interface VideoTrackList : EventTarget {
readonly attribute unsigned long length;
getter VideoTrack (unsigned long index);
VideoTrack? getTrackById(DOMString id);
readonly attribute long selectedIndex;
attribute EventHandler onchange;
attribute EventHandler onaddtrack;
attribute EventHandler onremovetrack;
};
interface VideoTrack {
readonly attribute DOMString id;
readonly attribute DOMString kind;
readonly attribute DOMString label;
readonly attribute DOMString language;
attribute boolean selected;
};
audioTracks . lengthvideoTracks . lengthãªã¹ãå ã®ãã©ãã¯ã®æ°ãè¿ãã
audioTracks[index]videoTracks[index]æå®AudioTrackãŸãã¯VideoTrackãªããžã§ã¯ããè¿ãã
audioTracks . getTrackById( id )videoTracks . getTrackById( id )äžããããèå¥åãšãšãã«AudioTrackãŸãã¯VideoTrackãªããžã§ã¯ããè¿ãããŸãã¯äžåãã©ãã¯ããã®èå¥åãæããªãå Žånullãè¿ãã
ididæå®ããããã©ãã¯ã®IDãè¿ãããã©ãŒããããMedia Fragments URIæ§æããµããŒãããgetTrackById()ã¡ãœãããšãšãã«äœ¿çšã§ããå Žåãããã¯ããã©ã°ã¡ã³ãèå¥åã§äœ¿çšã§ããIDã§ããã[MEDIAFRAG]
kindkindäžãããããã©ãã¯ã«è©²åœããã«ããŽãªãè¿ããå¯èœãªãã©ãã¯ã«ããŽãªã¯ä»¥äžã®éãã
labellabelæ¢ç¥ã®å Žåãæå®ããããã©ãã¯ã®ã©ãã«ãè¿ããããã§ãªããã°ç©ºæååãè¿ãã
languagelanguageæ¢ç¥ã®å Žåãæå®ããããã©ãã¯ã®èšèªãè¿ããããã§ãªããã°ç©ºã®æååãè¿ãã
enabled [ = value ]æå®ããããã©ãã¯ãã¢ã¯ãã£ãã§ããå Žåãtrueãè¿ããããã§ãªããã°falseãè¿ãã
ãã©ãã¯ãæå¹ãã©ããã倿Žããèšå®ãå¯èœã§ãããè€æ°ã®ãªãŒãã£ãªãã©ãã¯ãåæã«æå¹ã§ããå Žåãããããæ··åšããŠããã
videoTracks . selectedIndexããããã°ãçŸåšéžæãããŠãããã©ãã¯ã®ã€ã³ããã¯ã¹ãè¿ããããã§ãªããã°-1ãè¿ãã
selected [ = value ]æå®ããããã©ãã¯ãã¢ã¯ãã£ãã§ããå Žåãtrueãè¿ããããã§ãªããã°falseãè¿ãã
ãã©ãã¯ãéžæããããã©ããã倿Žããèšå®ãå¯èœã§ããã0åãŸãã¯1ã€ã®ããããã®ãããªãã©ãã¯ãéžæããããåã®1ã€ãéžæãããŠããéã«æ°ãããã©ãã¯ãéžæãããšã1ã€åã®éžæãè§£é€ããã
An AudioTrackList object represents a dynamic list of zero or more audio tracks,
of which zero or more can be enabled at a time. Each audio track is represented by an
AudioTrack object.
A VideoTrackList object represents a dynamic list of zero or more video tracks, of
which zero or one can be selected at a time. Each video track is represented by a
VideoTrack object.
Tracks in AudioTrackList and VideoTrackList objects must be
consistently ordered. If the media resource is in a format that defines an order,
then that order must be used; otherwise, the order must be the relative order in which the tracks
are declared in the media resource. The order used is called the natural order
of the list.
Each track in a TrackList thus has an index; the first has the index
0, and each subsequent track is numbered one higher than the previous one. If a media
resource dynamically adds or removes audio or video tracks, then the indices of the tracks
will change dynamically. If the media resource changes entirely, then all the
previous tracks will be removed and replaced with new tracks.
The AudioTrackList.length and VideoTrackList.length attributes must return
the number of tracks represented by their objects at the time of getting.
The supported property indices of AudioTrackList and
VideoTrackList objects at any instant are the numbers from zero to the number of
tracks represented by the respective object minus one, if any tracks are represented. If an
AudioTrackList or VideoTrackList object represents no tracks, it has no
supported property indices.
To determine the value of an indexed property for a given index index in an AudioTrackList or VideoTrackList object list, the user agent must return the AudioTrack or
VideoTrack object that represents the indexth track in list.
The AudioTrackList.getTrackById(id) and VideoTrackList.getTrackById(id) methods must return the first AudioTrack or
VideoTrack object (respectively) in the AudioTrackList or
VideoTrackList object (respectively) whose identifier is equal to the value of the
id argument (in the natural order of the list, as defined above). When no
tracks match the given argument, the methods must return null.
The AudioTrack and VideoTrack objects represent specific tracks of a
media resource. Each track can have an identifier, category, label, and language.
These aspects of a track are permanent for the lifetime of the track; even if a track is removed
from a media resource's AudioTrackList or VideoTrackList
objects, those aspects do not change.
In addition, AudioTrack objects can each be enabled or disabled; this is the audio
track's enabled state. When an AudioTrack is created, its enabled state
must be set to false (disabled). The resource fetch
algorithm can override this.
Similarly, a single VideoTrack object per VideoTrackList object can
be selected, this is the video track's selection state. When a VideoTrack is
created, its selection state must be set to false (not selected). The resource fetch algorithm can override this.
The AudioTrack.id and VideoTrack.id attributes must return the identifier
of the track, if it has one, or the empty string otherwise. If the media resource is
in a format that supports the Media Fragments URI fragment identifier syntax, the
identifier returned for a particular track must be the same identifier that would enable the track
if used as the name of a track in the track dimension of such a fragment identifier. [MEDIAFRAG]
For example, in Ogg files, this would be the Name header field of the track. [OGGSKELETONHEADERS]
The AudioTrack.kind and VideoTrack.kind attributes must return the category
of the track, if it has one, or the empty string otherwise.
The category of a track is the string given in the first column of the table below that is the
most appropriate for the track based on the definitions in the table's second and third columns,
as determined by the metadata included in the track in the media resource. The cell
in the third column of a row says what the category given in the cell in the first column of that
row applies to; a category is only appropriate for an audio track if it applies to audio tracks,
and a category is only appropriate for video tracks if it applies to video tracks. Categories must
only be returned for AudioTrack objects if they are appropriate for audio, and must
only be returned for VideoTrack objects if they are appropriate for video.
| ã«ããŽãª | å®çŸ© | é©çšå¯Ÿè±¡ |
|---|---|---|
"alternative"
| ã¡ã€ã³ãã©ãã¯ãžã®å¯èœãªä»£æ¿ãããšãã°ãæ²ã®å¥ãã€ã¯ïŒãªãŒãã£ãªïŒããŸãã¯å¥ã¢ã³ã°ã«ïŒãããªïŒã | Audioãšvideoã |
"captions"
| çŒãä»ãåå¹ããã€äž»ãããªãã©ãã¯ã®ããŒãžã§ã³ãïŒã¬ã¬ã·ãŒã³ã³ãã³ãçšãæ°ããã³ã³ãã³ãã¯ããã¹ããã©ãã¯ã䜿çšãããïŒ | Videoã®ã¿ã |
"descriptions"
| ãããªãã©ãã¯ã®é³å£°è§£èª¬ã | Audioã®ã¿ã |
"main"
| äž»ãªãŒãã£ãªãŸãã¯ãããªãã©ãã¯ã | Audioãšvideoã |
"main-desc"
| é³å£°è§£èª¬ãšæ··åããããäž»ãªãŒãã£ãªãã©ãã¯ã | Audioã®ã¿ã |
"sign"
| ãªãŒãã£ãªãã©ãã¯ã®æè©±éèš³ã | Videoã®ã¿ã |
"subtitles"
| çŒãä»ãåå¹ããã€äž»ãããªãã©ãã¯ã®ããŒãžã§ã³ãïŒã¬ã¬ã·ãŒã³ã³ãã³ãçšãæ°ããã³ã³ãã³ãã¯ããã¹ããã©ãã¯ã䜿çšãããïŒ | Videoã®ã¿ã |
"translation"
| äž»ãªãŒãã£ãªãã©ãã¯ã®ç¿»èš³ããŒãžã§ã³ã | Audioã®ã¿ã |
"commentary"
| äž»ãªãŒãã£ãªãŸãã¯ãããªãã©ãã¯ã®ã³ã¡ã³ã¿ãªãããšãã°ãã£ã¬ã¯ã¿ãŒã®ã³ã¡ã³ãã | Audioãšvideoã |
""ïŒç©ºæååïŒ
| æç€ºçãªçš®é¡ããªããããã©ãã¯ã®ã¡ã¿ããŒã¿ã§æå®ãããçš®é¡ã¯ããŠãŒã¶ãŒãšãŒãžã§ã³ãã«ãã£ãŠèªèãããªãã | Audioãšvideoã |
The AudioTrack.label and VideoTrack.label attributes must return the label
of the track, if it has one, or the empty string otherwise.
The AudioTrack.language and VideoTrack.language attributes must return the
BCP 47 language tag of the language of the track, if it has one, or the empty string otherwise. If
the user agent is not able to express that language as a BCP 47 language tag (for example because
the language information in the media resource's format is a free-form string without
a defined interpretation), then the method must return the empty string, as if the track had no
language.
Source attribute values for id, kind, label and language of multitrack audio and video tracks as described for the relevant media resource format. [INBANDTRACKS]
The AudioTrack.enabled attribute, on
getting, must return true if the track is currently enabled, and false otherwise. On setting, it
must enable the track if the new value is true, and disable it otherwise. (If the track is no
longer in an AudioTrackList object, then the track being enabled or disabled has no
effect beyond changing the value of the attribute on the AudioTrack object.)
Whenever an audio track in an AudioTrackList is enabled or disabled, the user
agent must queue a task to fire a simple event named change at the AudioTrackList object.
The VideoTrackList.selectedIndex attribute
must return the index of the currently selected track, if any. If the VideoTrackList
object does not currently represent any tracks, or if none of the tracks are selected, it must
instead return â1.
The VideoTrack.selected attribute, on
getting, must return true if the track is currently selected, and false otherwise. On setting, it
must select the track if the new value is true, and unselect it otherwise. If the track is in a
VideoTrackList, then all the other VideoTrack objects in that list must
be unselected. (If the track is no longer in a VideoTrackList object, then the track
being selected or unselected has no effect beyond changing the value of the attribute on the
VideoTrack object.)
Whenever a track in a VideoTrackList that was previously not selected is selected,
the user agent must queue a task to fire a simple event named change at the VideoTrackList object. This task must be queued before the
task that fires the resize event, if any.
The following are the event handlers (and their corresponding event handler event types) that must be supported, as event handler IDL attributes,
by all objects implementing the AudioTrackList and VideoTrackList
interfaces:
| ã€ãã³ããã³ãã© | ã€ãã³ããã³ãã©ã€ãã³ãå |
|---|---|
onchange | change
|
onaddtrack | addtrack
|
onremovetrack | removetrack
|
ãã®ã»ã¯ã·ã§ã³ã«èšèŒãããã¿ã¹ã¯ã®ã¿ã¹ã¯ãœãŒã¹ã¯ãDOMæäœã¿ã¹ã¯ãœãŒã¹ã§ããã
audioTracksããã³videoTracks屿§ã¯ã¹ã¯ãªãããåçãã¹ããã®ãã©ãã¯ãéžæã§ããããã¡ãã£ã¢ãªãœãŒã¹ã®URLã®ãã©ã°ã¡ã³ãèå¥åã§ç¹å®ã®ãã©ãã¯ãæå®ããããšã«ããã宣èšçã«ç¹å®ã®ãã©ãã¯ãéžæããããšãå¯èœã§ããããã©ã°ã¡ã³ãèå¥åã®åœ¢åŒã¯ãã¡ãã£ã¢ãªãœãŒã¹ã®MIMEã¿ã€ãã«äŸåããã[RFC2046] [URL]
ãã®äŸã«ãããŠãMedia Fragments URIãã©ã°ã¡ã³ãèå¥åã®æ§æããµããŒããã圢åŒã䜿çšãããããªããã©ãã«"Alternative"ãšããŠä»£æ¿ã¢ã³ã°ã«ãããã©ã«ãã®ãããªãã©ãã¯ã®ä»£ããã«æå¹ã«ãããããã«åã蟌ãŸããŠããã[MEDIAFRAG]
<video src="myvideo#track=Alternative"></video>
åã¡ãã£ã¢èŠçŽ ã¯MediaControllerãæã€ããšãã§ãããMediaControllerã¯ãããšãã°æè©±éèš³ã®ãã©ãã¯ãåæãåã£ãŠãããªãã©ãã¯ã«éããããšãã§ãããããªãè€æ°ã®ã¡ãã£ã¢èŠçŽ ã®åçã調æŽãããªããžã§ã¯ãã§ããã
ããã©ã«ãã§ãã¡ãã£ã¢èŠçŽ ã¯MediaControllerãæããªããæé»ã®MediaControllerã¯mediagroupã³ã³ãã³ã屿§ã䜿çšããŠå²ãåœãŠãããšãã§ãããæç€ºçãªMediaControllerã¯ãçŽæ¥controllerIDL屿§ã䜿çšããŠå²ãåœãŠãããšãã§ããã
MediaControllerã䌎ãã¡ãã£ã¢èŠçŽ ã¯ããã®ã³ã³ãããŒã©ã«åŸå±ãããšèšããããMediaControllerã¯ãåçé床ãšããã«åŸå±ããã¡ãã£ã¢èŠçŽ ã®ããããã®åçé³éã倿Žãããã®åŸå±ããã¡ãã£ã¢èŠçŽ ã®ãããããäºæãã倱éããå Žåã仿¹ãåæã«åæ¢ããããšãä¿èšŒããã
ã¡ãã£ã¢èŠçŽ ãMediaControllerã«åŸå±ãããå Žåããã®åçé床ã¯åãMediaControllerã®ä»ã®ãã©ãã¯ã®ãã®ã«åºå®ãããä»»æã®ã«ãŒããç¡å¹ã«ãªãã
enum MediaControllerPlaybackState { "waiting", "playing", "ended" };
[Constructor]
interface MediaController : EventTarget {
readonly attribute unsigned short readyState; // uses HTMLMediaElement.readyState's values
readonly attribute TimeRanges buffered;
readonly attribute TimeRanges seekable;
readonly attribute unrestricted double duration;
attribute double currentTime;
readonly attribute boolean paused;
readonly attribute MediaControllerPlaybackState playbackState;
readonly attribute TimeRanges played;
void pause();
void unpause();
void play(); // calls play() on all media elements as well
attribute double defaultPlaybackRate;
attribute double playbackRate;
attribute double volume;
attribute boolean muted;
attribute EventHandler onemptied;
attribute EventHandler onloadedmetadata;
attribute EventHandler onloadeddata;
attribute EventHandler oncanplay;
attribute EventHandler oncanplaythrough;
attribute EventHandler onplaying;
attribute EventHandler onended;
attribute EventHandler onwaiting;
attribute EventHandler ondurationchange;
attribute EventHandler ontimeupdate;
attribute EventHandler onplay;
attribute EventHandler onpause;
attribute EventHandler onratechange;
attribute EventHandler onvolumechange;
};
MediaController()æ°ããMediaControllerãªããžã§ã¯ããè¿ãã
controller [ = controller ]ããããã°ãã¡ãã£ã¢èŠçŽ ã«å¯ŸããçŸåšã®MediaControllerãè¿ããããã§ãªããã°nullãè¿ãã
æç€ºçãªMediaControllerãèšå®ããããšãå¯èœã§ãããããããã°ãèšå®ããŠmediagroup屿§ãåé€ããã
readyStateMediaControllerã¯ããããã³ã³ãããŒã©ã®ç¶æ
ãå ±åããçµæãšããŠã€ãã³ããçºçãããæåŸã®æéã§ãã£ãç¶æ
ãè¿ãããã®å±æ§ã®å€ã¯ãã¡ãã£ã¢èŠçŽ ã®readyState屿§ã®å Žåãšåãã§ããã
bufferedãŠãŒã¶ãŒãšãŒãžã§ã³ããããã¹ãŠã®åŸå±ã¡ãã£ã¢èŠçŽ ã«é¢é£ãããã¹ãŠã®ã¡ãã£ã¢ã®ããŒã¿ãæã€æéç¯å²ã®å
±ééšåã衚ãTimeRangesãªããžã§ã¯ããè¿ãã
seekableãŠãŒã¶ãŒãšãŒãžã§ã³ããããã¹ãŠã®åŸå±ã¡ãã£ã¢èŠçŽ ãã·ãŒã¯ã§ããæéç¯å²ã®å
±ééšåã衚ãTimeRangesãªããžã§ã¯ããè¿ãã
durationïŒåé¡ã®ããŒã¿ãå®éã«ãããã¡ãªã³ã°ãããããŸãã¯çŽæ¥ã·ãŒã¯å¯èœã§ã¯ãªãããç¡éã®ã¹ããªãŒã ã«å¯Ÿããå°æ¥ã®æéãå«ããã©ãããèæ ®ããªãïŒæãæ©ãåçæç¹ãšæãé ãåçæç¹ã®å·®ãè¿ããã¡ãã£ã¢ãååšããªãå Žåã¯0ãè¿ãã
currentTime [ = value ]ç§åäœã§ã0æéãšçŸåšæéã®durationã®éã®äœçœ®ãšããŠãçŸåšã®åçäœçœ®ãè¿ãã
æå®æéã«ã·ãŒã¯ããããã«ãèšå®å¯èœã§ããã
pausedåçãäžæåæ¢ãããå Žåã¯trueãè¿ããããã§ãªããã°falseãè¿ãããã®å±æ§ãtrueã®å Žåããã®ã³ã³ãããŒã©ã«åŸå±ãããã¹ãŠã®ã¡ãã£ã¢èŠçŽ ã忢ãããã
playbackStateMediaControllerã¯ããããã³ã³ãããŒã©ã®ç¶æ
ãå ±åããçµæãšããŠã€ãã³ããçºçãããæåŸã®æéã§ãã£ãç¶æ
ãè¿ãããã®å±æ§ã®å€ã¯ãã¡ãã£ã¢ãç©æ¥µçã«åçãããããšã瀺ã"playing"ããã¹ãŠã®åŸå±ã¡ãã£ã¢èŠçŽ ã®æåŸã«å°éããŠããããã«åçãããŠããªãããšã瀺ã"ended"ããŸãã¯ãã®ä»ã®çç±ïŒããšãã°MediaControllerãäžæåæ¢ãããŠããïŒã®ããã«åçãããŠããªãããšã瀺ã"waiting"ã®ããããã§ããã
pause()trueã«paused屿§ãèšå®ããã
unpause()falseã«paused屿§ãèšå®ããã
play()falseã«paused屿§ãèšå®ããååŸå±ã¡ãã£ã¢èŠçŽ ã®play()ã¡ãœãããåŒã³åºãã
playedåçãããŠãããã¹ãŠã®åŸå±ã¡ãã£ã¢èŠçŽ ã§æéç¯å²ã®åéåã衚ãTimeRangesãªããžã§ã¯ããè¿ãã
defaultPlaybackRate [ = value ]åçã®ããã©ã«ãçãè¿ãã
åçã®ããã©ã«ãçã倿Žããèšå®ãå¯èœã§ããã
ããã©ã«ãçã¯åçã«çŽæ¥åœ±é¿ãäžããªããããŠãŒã¶ãŒãæ©éãã¢ãŒãã«åãæ¿ããå Žåãã¢ãŒããéåžžã®åçã¢ãŒãã«æ»ã£ãéã«ãåçé床ïŒplaybackRateïŒãããã©ã«ãçã«æ»ãããããšãæåŸ
ãããã
playbackRate [ = value ]åçã®çŸåšé床ãè¿ãã
åçé床ã倿Žããèšå®ãå¯èœã§ããã
volume [ = value ]0.0ãã1.0ãŸã§ã®ç¯å²ã®æ°åãšããŠãçŸåšã®åçé³éã®ä¹æ°ãè¿ããããã§0.0ã¯æå°é³éã§1.0ã¯æå€§é³éã§ããã
é³éã®ä¹æ°ã倿Žããèšå®ãå¯èœã§ããã
æ°ããå€ãç¯å²0.0ãã1.0ã«å«ãŸããªãå ŽåãIndexSizeErrorãæããã
muted [ = value ]ïŒã³ã³ãããŒã©äžããŸãã¯ãã®ã³ã³ãããŒã©ã«åŸå±ããä»»æã®ã¡ãã£ã¢èŠçŽ ã®ããããã§ä»ã®å±æ§ã«é¢ä¿ãªãïŒãã¹ãŠã®ãªãŒãã£ãªããã¥ãŒãã§ããå Žåãtrueãè¿ããããã§ãªããã°falseãè¿ãã
ãªãŒãã£ãªããã¥ãŒãã§ãããã©ããã倿Žããèšå®ãå¯èœã§ããã
A media element can have a current media controller, which is a
MediaController object. When a media element is created without a mediagroup attribute, it does not have a current media
controller. (If it is created with such an attribute, then that attribute
initializes the current media controller, as defined below.)
The slaved media elements of a MediaController are the media elements whose current media controller is that
MediaController. All the slaved media elements of a
MediaController must use the same clock for their definition of their media
timeline's unit time. When the user agent is required to act on each slaved media element in turn, they must be processed in the order that they
were last associated with the MediaController.
The controller attribute on a media
element, on getting, must return the element's current media controller, if
any, or null otherwise. On setting, the user agent must run the following steps:
Let m be the media element in question.
Let old controller be m's current media controller, if it currently has one, and null otherwise.
Let new controller be null.
Let m have no current media controller, if it currently has one.
Remove the element's mediagroup content
attribute, if any.
If the new value is null, then jump to the update controllers step below.
Let m's current media controller be the new value.
Let new controller be m's current media controller.
Bring the media element up to speed with its new media controller.
Update controllers: If old controller and new controller are the same (whether both null or both the same controller) then abort these steps.
If old controller is not null and still has one or more slaved media elements, then report the controller state for old controller.
If new controller is not null, then report the controller state for new controller.
The MediaController() constructor, when
invoked, must return a newly created MediaController object.
The readyState attribute must
return the value to which it was most recently set. When the MediaController object
is created, the attribute must be set to the value 0 (HAVE_NOTHING). The value is updated by the report the
controller state algorithm below.
The seekable attribute must return
a new static normalized TimeRanges object that represents the
intersection of the ranges of the media resources of the
slaved media elements that the user agent is able to seek to, at the time the
attribute is evaluated.
The buffered attribute must return
a new static normalized TimeRanges object that represents the
intersection of the ranges of the media resources of the
slaved media elements that the user agent has buffered, at the time the attribute is
evaluated. Users agents must accurately determine the ranges available, even for media streams
where this can only be determined by tedious inspection.
The duration attribute must return
the media controller duration.
Every 15 to 250ms, or whenever the MediaController's media controller
duration changes, whichever happens least often, the user agent must queue a
task to fire a simple event named durationchange at the
MediaController. If the MediaController's media controller
duration decreases such that the media controller position is greater than the
media controller duration, the user agent must immediately seek the media
controller to media controller duration.
The currentTime attribute must
return the media controller position on getting, and on setting must seek the
media controller to the new value.
Every 15 to 250ms, or whenever the MediaController's media controller
position changes, whichever happens least often, the user agent must queue a
task to fire a simple event named timeupdate at the
MediaController.
When a MediaController is created it is a playing media controller. It
can be changed into a paused media controller and back either via the user agent's user
interface (when the element is exposing a user
interface to the user) or by script using the APIs defined in this section (see below).
The paused attribute must return
true if the MediaController object is a paused media controller, and
false otherwise.
When the pause() method is invoked,
if the MediaController is a playing media controller then the user agent
must change the MediaController into a paused media controller,
queue a task to fire a simple event named pause at the MediaController, and then
report the controller state of the MediaController.
When the unpause() method is
invoked, if the MediaController is a paused media controller, the user
agent must change the MediaController into a playing media controller,
queue a task to fire a simple event named play at the MediaController, and then
report the controller state of the MediaController.
When the play() method is invoked, the
user agent must invoke the play() method of each slaved media element in turn, and then invoke the unpause method of the MediaController.
The playbackState attribute
must return the value to which it was most recently set. When the MediaController
object is created, the attribute must be set to the value "waiting". The value is updated by the report the
controller state algorithm below.
The played attribute must return a
new static normalized TimeRanges object that represents the union of the
ranges of points on the media timelines of the media resources of the slaved media elements that the
user agent has so far reached through the usual monotonic increase of their current playback positions during normal playback, at the time the
attribute is evaluated.
A MediaController has a media controller default playback rate and a
media controller playback rate, which must both be set to 1.0 when the
MediaController object is created.
The defaultPlaybackRate
attribute, on getting, must return the MediaController's media controller
default playback rate, and on setting, must set the MediaController's
media controller default playback rate to the new value, then queue a
task to fire a simple event named ratechange at the
MediaController.
The playbackRate attribute, on
getting, must return the MediaController's media controller playback
rate, and on setting, must set the MediaController's media controller
playback rate to the new value, then queue a task to fire a simple
event named ratechange at the
MediaController.
A MediaController has a media controller volume multiplier, which must
be set to 1.0 when the MediaController object is created, and a media controller
mute override, much must initially be false.
The volume attribute, on getting,
must return the MediaController's media controller volume multiplier,
and on setting, if the new value is in the range 0.0 to 1.0 inclusive, must set the
MediaController's media controller volume multiplier to the new value
and queue a task to fire a simple event named volumechange at the
MediaController. If the new value is outside the range 0.0 to 1.0 inclusive, then, on
setting, an IndexSizeError exception must be thrown instead.
The muted attribute, on getting, must
return the MediaController's media controller mute override, and on
setting, must set the MediaController's media controller mute override
to the new value and queue a task to fire a simple event named volumechange at the
MediaController.
The media resources of all the slaved media
elements of a MediaController have a defined temporal relationship which
provides relative offsets between the zero time of each such media resource: for
media resources with a timeline offset, their
relative offsets are the difference between their timeline offset; the zero times of
all the media resources without a timeline offset
are not offset from each other (i.e. the origins of their timelines are cotemporal); and finally,
the zero time of the media resource with the earliest timeline offset
(if any) is not offset from the zero times of the media
resources without a timeline offset (i.e. the origins of media resources without a timeline offset are further cotemporal
with the earliest defined point on the timeline of the media resource with the
earliest timeline offset).
The media resource end position of a media resource in a media element is defined as follows: if the media resource has a finite and known duration, the media resource end position is the duration of the media resource's timeline (the last defined position on that timeline); otherwise, the media resource's duration is infinite or unknown, and the media resource end position is the time of the last frame of media data currently available for that media resource.
Each MediaController also has its own defined timeline. On this timeline, all the
media resources of all the slaved media elements
of the MediaController are temporally aligned according to their defined offsets. The
media controller duration of that MediaController is the time from the
earliest earliest possible position, relative to this MediaController
timeline, of any of the media resources of the slaved
media elements of the MediaController, to the time of the latest media
resource end position of the media resources of the
slaved media elements of the MediaController, again relative to this
MediaController timeline.
Each MediaController has a media controller position. This is the time
on the MediaController's timeline at which the user agent is trying to play the
slaved media elements. When a MediaController is created, its
media controller position is initially zero.
When the user agent is to bring a media element up to speed with its new media controller, it must seek that media element to the
MediaController's media controller position relative to the media
element's timeline.
When the user agent is to seek the media controller to a particular new playback position, it must follow these steps:
If the new playback position is less than zero, then set it to zero.
If the new playback position is greater than the media controller duration, then set it to the media controller duration.
Set the media controller position to the new playback position.
Seek each slaved media element to the new playback position relative to the media element timeline.
A MediaController is a restrained media controller if the
MediaController is a playing media controller, and none of its
slaved media elements are blocked media
elements, but either at least one of its slaved media elements whose
autoplaying flag is true still has its paused
attribute set to true, or, all of its slaved media elements have their paused attribute set to true.
A MediaController is a blocked media controller if the
MediaController is a paused media controller, or if any of its
slaved media elements are blocked media
elements, or if any of its slaved media elements whose autoplaying
flag is true still have their paused attribute set to
true, or if all of its slaved media elements have their paused attribute set to true.
A media element is blocked on its media controller if the
MediaController is a blocked media controller, or if its media
controller position is either before the media resource's earliest
possible position relative to the MediaController's timeline or after the end
of the media resource relative to the MediaController's timeline.
When a MediaController is not a blocked media
controller and it has at least one slaved media
element whose Document is a fully active Document,
the MediaController's media controller position must increase
monotonically at media controller playback rate units of time on the
MediaController's timeline per unit time of the clock used by its slaved media
elements.
When the zero point on the timeline of a MediaController moves relative to the
timelines of the slaved media elements by a time difference ÎT, the MediaController's media controller
position must be decremented by ÎT.
In some situations, e.g. when playing back a live stream without buffering anything, the media controller position would increase monotonically as described above at the same rate as the ÎT described in the previous paragraph decreases it, with the end result that for all intents and purposes, the media controller position would appear to remain constant (probably with the value 0).
A MediaController has a most recently reported readiness state, which
is a number from 0 to 4 derived from the numbers used for the media element readyState attribute, and a most recently reported
playback state, which is either playing, waiting, or ended.
When a MediaController is created, its most recently reported readiness
state must be set to 0, and its most recently reported playback state must be
set to waiting.
When a user agent is required to report the controller state for a
MediaController, the user agent must run the following steps:
If the MediaController has no slaved media elements, let new readiness state be 0.
Otherwise, let it have the lowest value of the readyState IDL attributes of all of its slaved media
elements.
If the MediaController's most recently reported readiness state is
less than the new readiness state, then run these substeps:
Let next state be the MediaController's most
recently reported readiness state.
Loop: Increment next state by one.
Queue a task to run the following steps:
Set the MediaController's readyState attribute to the value next state.
Fire a simple event at the MediaController object, whose
name is the event name corresponding to the value of next state given in
the table below.
If next state is less than new readiness state, then return to the step labeled loop.
Otherwise, if the MediaController's most recently reported readiness
state is greater than new readiness state then queue a
task to fire a simple event at the MediaController object,
whose name is the event name corresponding to the value of new readiness
state given in the table below.
| Value of new readiness state | ã€ãã³ãå |
|---|---|
| 0 | emptied
|
| 1 | loadedmetadata
|
| 2 | loadeddata
|
| 3 | canplay
|
| 4 | canplaythrough
|
Let the MediaController's most recently reported readiness state
be new readiness state.
Initialize new playback state by setting it to the state given for the first matching condition from the following list:
MediaController has no slaved media elementsMediaController's slaved media elements have
ended playback and the media controller playback rate is positive or
zeroMediaController is a blocked media controllerIf the MediaController's most recently reported playback state
is not equal to new playback state and the new playback
state is ended, then queue a task that, if the
MediaController object is a playing media controller, and all of the
MediaController's slaved media elements have still ended
playback, and the media controller playback rate is still positive or zero,
changes the MediaController object to a paused media controller and
then fires a simple event named pause at the MediaController
object.
If the MediaController's most recently reported playback state is
not equal to new playback state then queue a task to run the
following steps:
Set the MediaController's playbackState attribute to the value given in
the second column of the row of the following table whose first column contains the new playback state.
Fire a simple event at the MediaController object, whose name
is the value given in the third column of the row of the following table whose first column
contains the new playback state.
| New playback state | New value for playbackState
| ã€ãã³ãå |
|---|---|---|
| playing | "playing"
| playing
|
| waiting | "waiting"
| waiting
|
| ended | "ended"
| ended
|
Let the MediaController's most recently reported playback state
be new playback state.
The following are the event handlers (and their corresponding event handler event types) that must be supported, as event handler IDL attributes,
by all objects implementing the MediaController interface:
| ã€ãã³ããã³ãã© | ã€ãã³ããã³ãã©ã€ãã³ãå |
|---|---|
onemptied | emptied
|
onloadedmetadata | loadedmetadata
|
onloadeddata | loadeddata
|
oncanplay | canplay
|
oncanplaythrough | canplaythrough
|
onplaying | playing
|
onended | ended
|
onwaiting | waiting
|
ondurationchange | durationchange
|
ontimeupdate | timeupdate
|
onplay | play
|
onpause | pause
|
onratechange | ratechange
|
onvolumechange | volumechange
|
ãã®ã»ã¯ã·ã§ã³ã«èšèŒãããã¿ã¹ã¯ã®ã¿ã¹ã¯ãœãŒã¹ã¯ãDOMæäœã¿ã¹ã¯ãœãŒã¹ã§ããã
ã¡ãã£ã¢èŠçŽ ã®mediagroupã³ã³ãã³ã屿§ã¯ãæé»çã«MediaControllerãäœæããããšã«ãã£ãŠãè€æ°ã®ã¡ãã£ã¢èŠçŽ ããªã³ã¯ããããã«äœ¿çšã§ãããå€ã¯ããã¹ãã§ãããåãå€ãæã€ã¡ãã£ã¢èŠçŽ ã¯ãŠãŒã¶ãŒãšãŒãžã§ã³ãã«ãã£ãŠèªåçã«ãªã³ã¯ãããã
When a media element is created with a mediagroup attribute, and when a media element's
mediagroup attribute is set, changed, or removed, the
user agent must run the following steps:
Let m be the media element in question.
Let old controller be m's current media controller, if it currently has one, and null otherwise.
Let new controller be null.
Let m have no current media controller, if it currently has one.
If m's mediagroup attribute
is being removed, then jump to the update controllers step below.
If there is another media element whose Document is the same as
m's Document (even if one or both of these elements are not
actually in the Document), and which
also has a mediagroup attribute, and whose mediagroup attribute has the same value as the new value of
m's mediagroup attribute, then
let controller be that media element's current media
controller.
Otherwise, let controller be a newly created
MediaController.
Let m's current media controller be controller.
Let new controller be m's current media controller.
Bring the media element up to speed with its new media controller.
Update controllers: If old controller and new controller are the same (whether both null or both the same controller) then abort these steps.
If old controller is not null and still has one or more slaved media elements, then report the controller state for old controller.
If new controller is not null, then report the controller state for new controller.
The mediaGroup IDL attribute on media elements must reflect the mediagroup content attribute.
åãã¡ãã£ã¢ãªãœãŒã¹ãåç
§ããè€æ°ã®ã¡ãã£ã¢èŠçŽ ã¯ãåäžã®ãããã¯ãŒã¯èŠæ±ãå
±æãããããã¯ãç»é¢äžã®2ã€ã®ç°ãªãå Žæã§åãã¡ãã£ã¢ãªãœãŒã¹ãã2ã€ã®ïŒãããªïŒãã©ãã¯ãå¹ççã«åçããããã«äœ¿çšã§ãããmediagroup屿§ãšå
±ã«äœ¿çšããŠããããã®èŠçŽ ã¯ãŸãåæãç¶æã§ããã
ãã®äŸã«ãããŠãã ãŒããŒãã¡ã€ã«ç±æ¥ã®æè©±éèš³ãã©ãã¯ãã2ã€ã®videoèŠçŽ ãè€æ°ã®CSSãããã³æé»çãªMediaControllerã䜿çšããããã®åããããªãã¡ã€ã«ã®äž»ãããªãã©ãã¯äžã«ãªãŒããŒã¬ã€ãããïŒ
<article>
<style>
div { margin: 1em auto; position: relative; width: 400px; height: 300px; }
video { position; absolute; bottom: 0; right: 0; }
video:first-child { width: 100%; height: 100%; }
video:last-child { width: 30%; }
</style>
<div>
<video src="movie.vid#track=Video&track=English" autoplay controls mediagroup=movie></video>
<video src="movie.vid#track=sign" autoplay mediagroup=movie></video>
</div>
</article>
ã¡ãã£ã¢èŠçŽ ã¯ãã¡ãã£ã¢èŠçŽ ã®ããã¹ããã©ãã¯ã®ãªã¹ããšããŠç¥ãããé¢é£ããããã¹ããã©ãã¯ã®ã°ã«ãŒããæã€ããšãã§ãããããã¹ããã©ãã¯ã¯ä»¥äžã®ããã«ãœãŒããããïŒ
trackèŠçŽ ã®åã«å¯Ÿå¿ããããã¹ããã©ãã¯ãaddTextTrack()ã¡ãœããã䜿çšããŠè¿œå ãããä»»æã®ããã¹ããã©ãã¯ãããã¹ããã©ãã¯ã®æ§æèŠçŽ ã¯æ¬¡ã®ãšããïŒ
ããã¯ããã©ãã¯ããŠãŒã¶ãŒãšãŒãžã§ã³ãã«ãã£ãŠåŠçãããæ¹æ³ã決å®ãããçš®é¡ã¯æååã§è¡šããããå¯èœæ§ã®ããæååã¯æ¬¡ã®ãšããïŒ
subtitles
captions
descriptions
chapters
metadata
trackèŠçŽ ã«å¯Ÿå¿ããããã¹ããã©ãã¯ã®å Žåããã©ãã¯ã®çš®é¡ã¯åçã«å€æŽã§ããã
ããã¯ããŠãŒã¶ãŒã«å¯Ÿãããã©ãã¯ãç¹å®ããããã«æå³ããå€èªå¯èœãªæååã§ããã
trackèŠçŽ ã«å¯Ÿå¿ããããã¹ããã©ãã¯ã®å Žåããã©ãã¯ã®ã©ãã«ã¯åçã«å€æŽã§ããã
ããã¹ããã©ãã¯ã®ã©ãã«ãç©ºã®æååã§ããå ŽåããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯èªåçã«ãã®ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ãŒã¹ã§äœ¿çšããããã®ããã¹ããã©ãã¯ã®ä»ã®ããããã£ãŒïŒããšãã°ããã¹ããã©ãã¯ã®çš®é¡ãšããã¹ããã©ãã¯ã®èšèªãªã©ïŒããé©åãªã©ãã«ãçæãã¹ãã§ããããã®èªåçæãããã©ãã«ã¯ãAPIã§å ¬éãããªãã
ããã¯ãææžå ã®å¥ã®ã¹ã¯ãªããã«æŽŸé£ã§ããããã«ããããã«ãã©ãã¯ãæå¹ã«ãã垯åå ã¡ã¿ããŒã¿ãã©ãã¯ã«å¯Ÿããã¡ãã£ã¢ãªãœãŒã¹ããæœåºãããæååã§ããã
ããšãã°ããŠã§ãäžããŠã§ãåºæã®ã€ã³ã¿ã©ã¯ãã£ãæ©èœã§ã®ã¹ããªãŒãã³ã°ã«ããåŸæ¥ã®TVå±ã®æŸéã¯ãåºå察象ãã²ãŒã ã·ã§ãŒã®éã®ããªãã¢ã²ãŒã ããŒã¿ãã¹ããŒãã²ãŒã ã®éã®éžæã®ç¶æ ãé£ç³§èšç»äžã®ã¬ã·ãæ å ±ãªã©ã«å¯Ÿããã¡ã¿ããŒã¿ããã€ããã¹ããã©ãã¯ãå«ããããããªããåããã°ã©ã ãéå§ããã³çµäºãããšãæ°ãããã©ãã¯ã远å ããããã¹ããªãŒã ããåé€ãããããåãã©ãã¯ã远å ããããšããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãã®å±æ§å€ã䜿çšããå°çšã®ã¹ã¯ãªããã¢ãžã¥ãŒã«ã«ãã©ãã¯ãçµåã§ããã
垯åå ã®ã¡ã¿ããŒã¿ããã¹ããã©ãã¯ä»¥å€ã§ã¯ã垯åå ã®ã¡ã¿ããŒã¿ãã©ãã¯ãã£ã¹ãããã¿ã€ãã¯ãç©ºã®æååã§ããããã®å€ãç°ãªãã¡ãã£ã¢åœ¢åŒã«å¯ŸããŠã©ã®ããã«èšå®ããããã¯ãã¡ãã£ã¢ãªãœãŒã¹åºæã®ããã¹ããã©ãã¯ãå ¬éããããã®æé ã«èšèŒãããã
ããã¯ãããã¹ããã©ãã¯ã®ãã¥ãŒã®èšèªã衚ãæååïŒBCP 47èšèªã¿ã°ïŒã§ããã[BCP47]
trackèŠçŽ ã«å¯Ÿå¿ããããã¹ããã©ãã¯ã®å Žåãããã¹ããã©ãã¯ã®èšèªã¯ãåçã«å€æŽã§ããã
以äžã®ãã¡ã®1ã€ããšãïŒ
ããã¹ããã©ãã¯ã®ãã¥ãŒãåŸãããŠããªãããšã瀺ãã
ããã¹ããã©ãã¯ãããŒããããŠããããããŸã§ã«æ€åºãããèŽåœçãªãšã©ãŒããªãããšã瀺ãã远å ã®ãã¥ãŒã¯ãäŸç¶ãšããŠããŒãµã«ãã£ãŠãã©ãã¯ã«è¿œå ããããããããªãã
ããã¹ããã©ãã¯ãèŽåœçãªãšã©ãŒãªãã§ããŒããããããšã瀺ãã
ããã¹ããã©ãã¯ã¯æå¹ã§ãããããŠãŒã¶ãŒãšãŒãžã§ã³ãããã©ãã¯ãååŸããããšããéããããäœããã®æ¹æ³ïŒããšãã°URLã解決ã§ããªãã£ãããããã¯ãŒã¯ãšã©ãŒãæªç¥ã®ããã¹ããã©ãã¯åœ¢åŒãªã©ïŒã§å€±æããããšã瀺ãããã¥ãŒã®äžéšãŸãã¯å šéšã¯ãããããæ¬ èœããŠããããå«ãŸããŠããªãã ããã
ãã©ãã¯ãåŸãããããã«ãããã¹ããã©ãã¯ã®æºåç¶æ ãåçã«å€æŽããã
以äžã®ãã¡ã®1ã€ããšãïŒ
ããã¹ããã©ãã¯ãã¢ã¯ãã£ãã§ãªãããšã瀺ããDOMå ã®ãã©ãã¯ãå ¬éããç®ç以å€ã§ã¯ããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ããã¹ããã©ãã¯ãç¡èŠããŠãããã©ã®ãã¥ãŒãã¢ã¯ãã£ãã§ãªããã©ã®ã€ãã³ããçºç«ããããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ããã©ãã¯ã®ãã¥ãŒãåŸãããšã詊ã¿ãããšã¯ãªãã
ããã¹ããã©ãã¯ãã¢ã¯ãã£ãã§ãããããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãç©æ¥µçã«ãã¥ãŒã衚瀺ããŠããªãããšã瀺ããã©ã®è©Šã¿ããŸã ãã©ãã¯ã®ãã¥ãŒãåŸãããã«è¡ãããŠããªãå ŽåããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãäžç¬ãã®ãããªè©Šã¿ãå®è¡ããããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ããã¥ãŒãã¢ã¯ãã£ãã§ãããªã¹ããç¶æããŠãããã€ãã³ãã¯ããã«å¿ããŠçºç«ãããŠããã
ããã¹ããã©ãã¯ãã¢ã¯ãã£ãã§ããããšã瀺ããã©ã®è©Šã¿ããŸã ãã©ãã¯ã®ãã¥ãŒãåŸãããã«è¡ãããŠããªãå ŽåããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãäžç¬ãã®ãããªè©Šã¿ãå®è¡ããããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ããã¥ãŒãã¢ã¯ãã£ãã§ãããªã¹ããç¶æããŠãããã€ãã³ãã¯ããã«å¿ããŠçºç«ãããŠããããŸããçš®é¡ãsubtitlesãcaptionsã§ããããã¹ããã©ãã¯ã§ããã¥ãŒã¯å¿
èŠã«å¿ããŠãããªã«ãªãŒããŒã¬ã€ãããŠãããçš®é¡ãdescriptionsã§ããããã¹ããã©ãã¯ã§ããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãéèŠèŠçãªæ¹æ³ã§ãŠãŒã¶ãŒã«äœ¿çšå¯èœãªãã¥ãŒãäœæããŠããããããŠãçš®é¡ãchaptersã§ããããã¹ããã©ãã¯ã§ããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ããŠãŒã¶ãŒããã¥ãŒãéžæããããšã«ãã£ãŠã¡ãã£ã¢ãªãœãŒã¹ã®ä»»æã®ãã€ã³ãã«ç§»åããããšãã§ããã¡ã«ããºã ããŠãŒã¶ãŒã«å©çšå¯èœã«ããŠããã
ããã¹ããã©ãã¯ã®ã¬ã³ããªã³ã°ãæŽæ°ããããã®èŠåãšãšãã«ãããã¹ããã©ãã¯ãã¥ãŒã®ãªã¹ããããšãã°ãWebVTTã«å¯ŸããŠãWebVTTããã¹ããã©ãã¯ã®è¡šç€ºãæŽæ°ããããã®èŠåã[WEBVTT]
ããã¹ããã©ãã¯ã®ãã¥ãŒã®ãªã¹ãã¯ãããã¹ã·ãã©ãã¯ããŸã ããŒããããŠããªããããã§ã«ããŒãäžã§ããããŸãã¯DOMæäœã«èµ·å ããŠã®ããããã®ããã«ãåçã«å€æŽã§ããã
åããã¹ããã©ãã¯ã¯ã察å¿ããTextTrackãªããžã§ã¯ããæã€ã
åã¡ãã£ã¢èŠçŽ ã¯ãæåã¯ç©ºã§ãªããã°ãªããªãä¿çäžã®ããã¹ããã©ãã¯ã®ãªã¹ããæåã¯falseã§ãªããã°ãªããªãblocked-on-parserãã©ã°ãæåã¯falseã§ãªããã°ãªããªãdid-perform-automatic-track-selectionãã©ã°ãæã€ã
When the user agent is required to populate the list of pending text tracks of a media element, the user agent must add to the element's list of pending text tracks each text track in the element's list of text tracks whose text track mode is not disabled and whose text track readiness state is loading.
trackèŠçŽ ã®èŠªããŒãã倿Žãšãã¯ãã€ã§ãããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãèŠçŽ ãå±ããå
šä¿çäžã®ããã¹ããã©ãã¯ã®ãªã¹ããã該åœããããã¹ããã©ãã¯ãåé€ããªããã°ãªããªãã
ããã¹ããã©ãã¯ã®ããã¹ããã©ãã¯ã®æºåç¶æ ãããŒããããããããŒãã«å€±æããã®ããããã«å€æŽããããšãã¯ãã€ã§ãããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãããã¹ããã©ãã¯ãå±ããå šä¿çäžã®ããã¹ããã©ãã¯ã®ãªã¹ãããåé€ããªããã°ãªããªãã
ã¡ãã£ã¢èŠçŽ ãHTMLããŒãµãXMLããŒãµã«ãã£ãŠäœæãããå ŽåããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãèŠçŽ ã®blocked-on-parserãã©ã°ãtrueã«èšå®ããªããã°ãªããªããã¡ãã£ã¢èŠçŽ ãHTMLããŒãµãXMLããŒãµã®ãªãŒãã³èŠçŽ ã®ã¹ã¿ãã¯ããããããããå ŽåããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãèªåããã¹ããã©ãã¯ã®éžæã«å¯ŸããŠãŠãŒã¶ãŒã®å¥œã¿ãå°éããªããã°ãªãããä¿çäžã®ããã¹ããã©ãã¯ã®ãªã¹ãã远å ããèŠçŽ ã®blocked-on-parserãã©ã°ãfalseã«èšå®ããã
èŠçŽ ã®ä¿çäžã®ããã¹ããã©ãã¯ã®ãªã¹ãã空ã§ãããèŠçŽ ã®blocked-on-parserãã©ã°ãfalseã®äž¡æ¹ã§ããå Žåãã¡ãã£ã¢èŠçŽ ã®ããã¹ããã©ãã¯ã¯æºåãã§ããŠããã
åã¡ãã£ã¢èŠçŽ ã¯ãæåã«æªèšå®ã§ãªããã°ãªããªãä¿çäžã®ããã¹ããã©ãã¯å€æŽéç¥ãã©ã°ãæã€ã
ã¡ãã£ã¢èŠçŽ ã®ããã¹ããã©ãã¯ã®ãªã¹ãã«å±ããããã¹ããã©ãã¯ãããã®ããã¹ããã©ãã¯ã¢ãŒã倿Žå€ãæã€ãã³ã«ããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãã¡ãã£ã¢èŠçŽ ã®ããã«æ¬¡ã®æé ãå®è¡ããªããã°ãªããªãïŒ
ã¡ãã£ã¢èŠçŽ ã®ä¿çäžã®ããã¹ããã©ãã¯ã®å€æŽéç¥ãã©ã°ãèšå®ãããå Žåããã®æé ãäžæ¢ããã
ã¡ãã£ã¢èŠçŽ ã®ä¿çäžã®ããã¹ããã©ãã¯å€æŽéç¥ãã©ã°ãèšå®ããã
æ¬¡ã®æé ãå®è¡ãããã¥ãŒã¿ã¹ã¯ïŒ
ã¡ãã£ã¢èŠçŽ ã®ä¿çäžã®ããã¹ããã©ãã¯å€æŽéç¥ãã©ã°ãèšå®è§£é€ããã
ã¡ãã£ã¢èŠçŽ ã®textTracks屿§ã®TextTrackListãªããžã§ã¯ãã§changeã«åä»ããããåçŽã€ãã³ããçºç«ããã
ã¡ãã£ã¢èŠçŽ ã®ã·ã§ãŒãã¹ã¿ãŒãã©ã°ãèšå®ãããŠããªãå Žåãæé ã®æéè¡é²ãå®è¡ããã
ãã®ã»ã¯ã·ã§ã³ã«èšèŒãããã¿ã¹ã¯ã®ã¿ã¹ã¯ãœãŒã¹ã¯ãDOMæäœã¿ã¹ã¯ãœãŒã¹ã§ããã
ããã¹ããã©ãã¯ãã¥ãŒã¯ãç¹å®ã®æå»ã«è¡šç€ºããå¥ã®æå»ã«æ¶æ» ããããã¹ãã«åå¹ããã£ãã·ã§ã³ã«å¯Ÿããã€ã³ã¹ã¿ã³ã¹ã«å¯Ÿå¿ãããããã¹ããã©ãã¯ã§æå»äŸåã®ããŒã¿ã®åäœã§ããã
åããã¹ããã©ãã¯ãã¥ãŒã®æ§æã¯æ¬¡ã®ãšããïŒ
ä»»æã®æååã
æå»ã¯ãç§ãç§ã®å°æ°ã§ããã¥ãŒãé©çšãããã¡ãã£ã¢ããŒã¿ã®ç¯å²ã®éå§ã衚çŸããã
æå»ã¯ãç§ãç§ã®å°æ°ã§ããã¥ãŒãé©çšãããã¡ãã£ã¢ããŒã¿ã®ç¯å²ã®çµäºã衚çŸããã
ãã¥ãŒãé©çšãããç¯å²ã®æåŸã«éããéã®ãã¡ãã£ã¢ãªãœãŒã¹ã®åçãäžæåæ¢ãããã©ããã瀺ãçåœå€ã
ãã©ãŒãããã®ããã«å¿ èŠãªãã®ãšããŠã®ã远å ãã£ãŒã«ããããšãã°ãWebVTTã¯ãããã¹ããã©ãã¯ãã¥ãŒæžãèŸŒã¿æ¹åãªã©ãæã€ã[WEBVTT]
ãã¥ãŒã®çããŒã¿ãããã³åé¢ããŠãã¥ãŒãã¬ã³ããªã³ã°ããããã®èŠåã
ãã®ããŒã¿ã®æ£ç¢ºãªç¹åŸŽã¯ããã©ãŒãããã«ãã£ãŠå®çŸ©ããããããšãã°ãWebVTTã¯ããã¹ãã䜿çšããã
ããã¹ããã©ãã¯ãã¥ãŒã®éå§æå»ããã³ããã¹ããã©ãã¯ãã¥ãŒã®çµäºæå»ã¯è² ã§ãã£ãŠããããïŒæå»ãŒããã¢ã¯ãã£ãã«ããããšã¯ã§ããªãåã®å šäœã®ãã¥ãŒãããããçŸåšã®åçäœçœ®ã¯è² ã«ãªãããšã¯ãªããïŒ
åããã¹ããã©ãã¯ãã¥ãŒã¯ã察å¿ããTextTrackCueãªããžã§ã¯ãïŒããå
·äœçã«ã¯ãããšãã°WebVTTã®ãã¥ãŒãVTTCueã€ã³ã¿ãŒãã§ãŒã¹ã䜿çšãããããªãTextTrackCueãç¶æ¿ãããªããžã§ã¯ãïŒãæã€ãããã¹ããã©ãã¯ãã¥ãŒã®ã¡ã¢ãªå
衚çŸã¯ãåçã«ãã®TextTrackCue APIãéããŠå€æŽã§ããã[WEBVTT]
ããã¹ããã©ãã¯ãã¥ãŒã¯ãããã¹ããã©ãã¯ãã¥ãŒã®ç¹å®ã®çš®é¡ã«å¯ŸããŠä»æ§ã§å®çŸ©ãããŠãããããã¹ããã©ãã¯ã¬ã³ããªã³ã°ãæŽæ°ããããã®èŠåã«é¢é£ä»ããããããããã®èŠåã¯ããã¥ãŒã衚ããªããžã§ã¯ããaddCue()ã¡ãœããã䜿çšããŠTextTrackãªããžã§ã¯ãã«è¿œå ãããéã«ç¹ã«äœ¿çšãããã
å ããŠãåããã¹ããã©ãã¯ãã¥ãŒã¯ãåçãª2ã€ã®æ å ±ãæã€ïŒ
ãã®ãã©ã°ã¯ãæåã«èšå®ãè§£é€ãããªããã°ãªããªãããã¥ãŒãã¢ã¯ãã£ããŸãã¯éã¢ã¯ãã£ãã«ãªã£ãéããã©ã°ã¯ãã€ãã³ããé©åã«çºç«ãããããã«ãããã³å³ã®ãã¥ãŒãã¬ã³ããªã³ã°ãããããšã確èªããããã«äœ¿çšãããã
ããã¹ããã©ãã¯ãã¥ãŒããã®ããã¹ããã©ãã¯ã®ãã¥ãŒã®ããã¹ããã©ãã¯ãªã¹ãããåé€ããããã³ã«ãããã¹ããã©ãã¯èªäœã¯ãã®ã¡ãã£ã¢èŠçŽ ã®ããã¹ããã©ãã¯ã®ãªã¹ãããåé€ãããããŸãã¯ç¡å¹ã«å€æŽããããã®ããã¹ããã©ãã¯ã¢ãŒããæã€ãã³ã«ããã€ã¡ãã£ã¢èŠçŽ ã®readyStateãHAVE_NOTHINGã«æ»ããããã³ã«ããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯åæçã«ãã®ãã©ã°ãèšå®è§£é€ããªããã°ãªããªãããã©ã°ããé¢é£ä»åž¯æ¡ä»¶ããåã«è¡šç€ºãããŠããããã¹ããã©ãã¯å
ã®1ã€ä»¥äžã®ãã¥ãŒã«å¯ŸããŠãã®æ¹æ³ã§è§£é€ãããå Žåã圱é¿ãåãããã¹ãŠã®ãã¥ãŒã«å¯ŸããŠãã©ã°ãè§£é€ããåŸããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ããããã®ããã¹ããã©ãã¯ã«å±ããããã¹ããã©ãã¯ã®ã¬ã³ããªã³ã°ãæŽæ°ããããã®èŠåãé©çšããªããã°ãªããªããããšãã°ãWebVTTã«åºã¥ãããã¹ããã©ãã¯çšãWebVTTããã¹ããã©ãã¯ã®è¡šç€ºãæŽæ°ããããã®èŠåãªã©ã[WEBVTT]
ããã¯ãäžè²«æ§ã®ããäœçœ®ã«ãã¥ãŒãä¿ã€ããã«ãã¬ã³ããªã³ã°ã¢ãã«ã®äžéšãšããŠäœ¿çšããããããã¯æåã¯ç©ºã§ãªããã°ãªããªããããã¹ããã©ãã¯ãã¥ãŒã®ã¢ã¯ãã£ããã©ã°ãèšå®è§£é€ããããã³ã«ããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ããã¹ããã©ãã¯ãã¥ãŒã®è¡šç€ºç¶æ ã空ã«ããªããã°ãªããªãã
ã¡ãã£ã¢èŠçŽ ã®ããã¹ããã©ãã¯ã®ããã¹ããã©ãã¯ãã¥ãŒã¯ãããã¹ããã©ãã¯ãã¥ãŒé ã«äºãã«çžå¯Ÿçã«é åºä»ãããã以äžã®ããã«æ±ºå®ãããïŒã¡ãã£ã¢èŠçŽ ã®ããã¹ããã©ãã¯ã®ãªã¹ãã«åºçŸãããããã®ããã¹ããã©ãã¯ãšããŠåãé åºã§ãœãŒããããã°ã«ãŒãããã€ããããã®ããã¹ããã©ãã¯ã§æåã®ã°ã«ãŒãã®ãã¥ãŒïŒæ¬¡ã«ãåã°ã«ãŒãå ã§ããã¥ãŒã¯ãæãæ©ããã®ã®é ã«ããã®éå§æå»ã§ãœãŒããããªããã°ãªããªãããããããåãéå§æå»ãæã€ä»»æã®ãã¥ãŒã¯ãæãé ããã®ã®é ã«ããã®çµäºæå»ã§ãœãŒããããªããã°ãªãããæåŸã«ãåäžã®çµäºæå»ãæã€ä»»æã®ãã¥ãŒã¯ãæãå€ããã®ã®é ã«ãããããããããã®ãã¥ãŒã®ããã¹ããã©ãã¯ãªã¹ãã«æåŸã«è¿œå ããé ã«ãœãŒããããªããã°ãªããªããïŒããšãã°ãWebVTTãã¡ã€ã«ç±æ¥ã®ãã¥ãŒã«å¯ŸããŠãæåã«ãã¡ã€ã«ã«èšèŒãããŠããé ã§ãªã©ãïŒ[WEBVTT]
ã¡ãã£ã¢ãªãœãŒã¹åºæã®ããã¹ããã©ãã¯ã¯ã¡ãã£ã¢ãªãœãŒã¹ã§èŠã€ããããããŒã¿ã«å¯Ÿå¿ããããã¹ããã©ãã¯ã§ããã
Rules for processing and rendering such data are defined by the relevant specifications, e.g. the specification of the video format if the media resource is a video.
When a media resource contains data that the user agent recognises and supports as being equivalent to a text track, the user agent runs the steps to expose a media-resource-specific text track with the relevant data, as follows.
Associate the relevant data with a new text track and its corresponding new
TextTrack object. The text track is a media-resource-specific
text track.
Set the new text track's kind, label, and language based on the semantics of the relevant data, as defined for the relevant format [INBANDTRACKS]. If there is no label in that data, then the label must be set to the empty string.
Associate the text track list of cues with the rules for updating the text track rendering appropriate for the format in question.
If the new text track's kind is metadata, then set the text track in-band
metadata track dispatch type as follows, based on the type of the media
resource:
CodecID element. [WEBMCG]stsd box of the
first stbl box of the
first minf box of the
first mdia box of the
text track's trak box in the
first moov box
of the file be the stsd box, if any.
If the file has no stsd box, or if the stsd box has neither a mett box nor a metx box, then the text track
in-band metadata track dispatch type must be set to the empty string.
Otherwise, if the stsd box has a mett box then the text
track in-band metadata track dispatch type must be set to the concatenation of the
string "mett", a U+0020 SPACE character, and the value of the first mime_format field of the first mett box of the stsd
box, or the empty string if that field is absent in that box.
Otherwise, if the stsd box has no mett box but has a metx box then the text track in-band metadata track dispatch type
must be set to the concatenation of the string "metx", a U+0020 SPACE
character, and the value of the first namespace field of the first metx box of the stsd box, or the empty string if that field is absent in
that box.
[MPEG4]
Populate the new text track's list of cues with the cues parsed so far, following the guidelines for exposing cues, and begin updating it dynamically as necessary.
Set the new text track's readiness state to loaded.
Set the new text track's mode to the mode consistent with the user's preferences and the requirements of the relevant specification for the data.
Add the new text track to the media element's list of text tracks.
Fire a trusted event with the name addtrack, that does not bubble and is not cancelable, and that uses
the TrackEvent interface, with the track
attribute initialized to the text track's TextTrack object, at the
media element's textTracks attribute's
TextTrackList object.
When a track element is created, it must be associated with a new text
track (with its value set as defined below) and its corresponding new
TextTrack object.
The text track kind is determined from the state of the element's kind attribute according to the following table; for a state given
in a cell of the first column, the kind is the string given
in the second column:
| ç¶æ | String |
|---|---|
| Subtitles | subtitles
|
| Captions | captions
|
| æŠèŠ | descriptions
|
| Chapters | chapters
|
| Metadata | metadata
|
The text track label is the element's track label.
The text track language is the element's track language, if any, or the empty string otherwise.
As the kind, label,
and srclang attributes are set, changed, or removed, the
text track must update accordingly, as per the definitions above.
Changes to the track URL are handled in the algorithm below.
The text track readiness state is initially not loaded, and the text track mode is initially disabled.
The text track list of cues is initially empty. It is dynamically modified when the referenced file is parsed. Associated with the list are the rules for updating the text track rendering appropriate for the format in question; for WebVTT, this is the rules for updating the display of WebVTT text tracks. [WEBVTT]
When a track element's parent element changes and the new parent is a media
element, then the user agent must add the track element's corresponding
text track to the media element's list of text tracks, and
then queue a task to fire a trusted event with the name addtrack, that does not bubble and is not cancelable, and that uses
the TrackEvent interface, with the track
attribute initialized to the text track's TextTrack object, at the
media element's textTracks attribute's
TextTrackList object.
When a track element's parent element changes and the old parent was a media
element, then the user agent must remove the track element's corresponding
text track from the media element's list of text tracks,
and then queue a task to fire a trusted event with the name removetrack, that does not bubble and is not cancelable, and that
uses the TrackEvent interface, with the track attribute initialized to the text track's
TextTrack object, at the media element's textTracks attribute's TextTrackList object.
When a text track corresponding to a track element is added to a
media element's list of text tracks, the user agent must queue a
task to run the following steps for the media element:
If the element's blocked-on-parser flag is true, abort these steps.
If the element's did-perform-automatic-track-selection flag is true, abort these steps.
Honor user preferences for automatic text track selection for this element.
When the user agent is required to honor user preferences for automatic text track selection for a media element, the user agent must run the following steps:
Perform automatic text track selection for subtitles and captions.
If there are any text tracks in the media
element's list of text tracks whose text track kind is metadata that correspond to track
elements with a default attribute set whose text
track mode is set to disabled, then set the
text track mode of all such tracks to hidden
Set the element's did-perform-automatic-track-selection flag to true.
When the steps above say to perform automatic text track selection for one or more text track kinds, it means to run the following steps:
Let candidates be a list consisting of the text tracks in the media element's list of text tracks whose text track kind is one of the kinds that were passed to the algorithm, if any, in the order given in the list of text tracks.
If candidates is empty, then abort these steps.
If any of the text tracks in candidates have a text track mode set to showing, abort these steps.
If the user has expressed an interest in having a track from candidates enabled based on its text track kind, text track language, and text track label, then set its text track mode to showing
For example, the user could have set a browser preference to the effect of "I want French captions whenever possible", or "If there is a subtitle track with 'Commentary' in the title, enable it", or "If there are audio description tracks available, enable one, ideally in Swiss German, but failing that in Standard Swiss German or Standard German".
Otherwise, if there are any text tracks in candidates that correspond to track elements with a default attribute set whose text track mode is
set to disabled, then set the text track
mode of the first such track to showing.
When a text track corresponding to a track element experiences any of
the following circumstances, the user agent must start the track processing
model for that text track and its track element:
track element is created.track element's parent element changes and the new parent is a media
element.When a user agent is to start the track processing model for a
text track and its track element, it must run the following algorithm.
This algorithm interacts closely with the event loop mechanism; in particular, it has
a synchronous section (which is triggered as part of the event loop
algorithm). The steps in that section are marked with â.
If another occurrence of this algorithm is already running for this text
track and its track element, abort these steps, letting that other algorithm
take care of this element.
If the text track's text track mode is not set to one of hidden or showing, abort these steps.
If the text track's track element does not have a media
element as a parent, abort these steps.
Run the remainder of these steps asynchronously, allowing whatever caused these steps to run to continue.
Top: Await a stable state. The synchronous section consists of the following steps. (The steps in the synchronous section are marked with â.)
â Set the text track readiness state to loading.
â If the track element's parent is a media element then
let CORS mode be the state of the parent media element's crossorigin content attribute. Otherwise, let CORS mode be No CORS.
End the synchronous section, continuing the remaining steps asynchronously.
If URL is not the empty string, perform a potentially CORS-enabled
fetch of URL, with the mode being CORS mode, the origin being the origin of the
track element's Document, and the default origin behaviour set
to fail.
The resource obtained in this fashion, if any, contains the text track data. If any data is obtained, it is by definition CORS-same-origin (cross-origin resources that are not suitably CORS-enabled do not get this far).
The tasks queued by the fetching algorithm on the networking task source to process the data as it is being fetched must determine the type of the resource If the type of the resource is not a supported text track format, the load will fail, as described below. Otherwise, the resource's data must be passed to the appropriate parser (e.g. the WebVTT parser) as it is received, with the text track list of cues being used for that parser's output. [WEBVTT]
The appropriate parser will synchronously (during these networking task source tasks) and incrementally (as each such task is run with whatever data has been received from the network) update the text track list of cues.
This specification does not currently say whether or how to check the MIME types of text tracks, or whether or how to perform file type sniffing using the actual file data. Implementors differ in their intentions on this matter and it is therefore unclear what the right solution is. In the absence of any requirement here, the HTTP specification's strict requirement to follow the Content-Type header prevails ("Content-Type specifies the media type of the underlying data." ... "If and only if the media type is not given by a Content-Type field, the recipient MAY attempt to guess the media type via inspection of its content and./or the name extension(s) of the URI used to identify the resource.").
If the fetching algorithm fails for any reason (network error, the server returns an error code, a cross-origin check fails, etc), if URL is the empty string, or if the type of the resource is not a supported text track format, then run these steps:
Queue a task to first change the text track readiness state to
failed to load and then fire a simple
event named error at the track
element.
Wait until the text track readiness state is no longer set to loading.
Wait until the track URL is no longer equal to URL, at the same time as the text track mode is set to hidden or showing.
Jump to the step labeled top.
If the fetching algorithm does not fail, then the final task that is queued by the networking task source must run the following steps after it has tried to parse the data:
Change the text track readiness state to loaded.
If the file was successfully processed, fire a simple event named load at the track element.
Otherwise, the file was not successfully processed (e.g. the format in question is an XML
format and the file contained a well-formedness error that the XML specification requires be
detected and reported to the application); fire a simple event named error at the track element.
Wait until the track URL is no longer equal to URL, at the same time as the text track mode is set to hidden or showing.
Jump back to the step labeled top.
If, while the fetching algorithm is active, either:
...then the user agent must run the following steps:
Abort the fetching algorithm, discarding any pending tasks generated by that algorithm (and in particular, not adding any cues to the text track list of cues after the moment the URL changed).
Jump back to the step labeled top.
Until one of the above circumstances occurs, the user agent must remain on this step.
Whenever a track element has its src attribute
set, changed, or removed, the user agent must synchronously empty the element's text
track's text track list of cues. (This also causes the algorithm above to stop
adding cues from the resource being obtained using the previously given URL, if any.)
How a specific format's text track cues are to be interpreted for the purposes of processing by an HTML user agent is defined by that format [INBANDTRACKS]. In the absence of such a specification, this section provides some constraints within which implementations can attempt to consistently expose such formats.
To support the text track model of HTML, each unit of timed data is converted to a text track cue. Where the mapping of the format's features to the aspects of a text track cue as defined in this specification are not defined, implementations must ensure that the mapping is consistent with the definitions of the aspects of a text track cue as defined above, as well as with the following constraints:
Should be set to the empty string if the format has no obvious analogue to a per-cue identifier.
Should be set to false.
interface TextTrackList : EventTarget {
readonly attribute unsigned long length;
getter TextTrack (unsigned long index);
TextTrack? getTrackById(DOMString id);
attribute EventHandler onchange;
attribute EventHandler onaddtrack;
attribute EventHandler onremovetrack;
};
textTracks . lengthã¡ãã£ã¢èŠçŽ ïŒããšãã°trackèŠçŽ ããïŒã«é¢é£ä»ããããããã¹ããã©ãã¯ã®æ°ãè¿ããããã¯ãã¡ãã£ã¢èŠçŽ ã®ããã¹ããã©ãã¯ã®ãªã¹ãã§ããã¹ããã©ãã¯ã®æ°ã§ããã
textTracks[ n ]ã¡ãã£ã¢èŠçŽ ã®ããã¹ããã©ãã¯ã®ãªã¹ãã§nçªç®ã®ããã¹ããã©ãã¯ã衚ãTextTrackãªããžã§ã¯ããè¿ãã
textTracks . getTrackById( id )äžããããèå¥åãšãšãã«TextTrackãªããžã§ã¯ããè¿ãããŸãã¯äžåãã©ãã¯ããã®èå¥åãæããªãå Žånullãè¿ãã
tracktrackèŠçŽ ã®ããã¹ããã©ãã¯ã衚ãTextTrackãªããžã§ã¯ããè¿ãã
A TextTrackList object represents a dynamically updating list of text tracks in a given order.
The textTracks attribute of media elements must return a TextTrackList object
representing the TextTrack objects of the text tracks
in the media element's list of text tracks, in the same order as in the
list of text tracks. The same object must be returned each time the attribute is
accessed. [WEBIDL]
The length attribute of a
TextTrackList object must return the number of text
tracks in the list represented by the TextTrackList object.
The supported property indices of a TextTrackList object at any
instant are the numbers from zero to the number of text tracks in
the list represented by the TextTrackList object minus one, if any. If there are no
text tracks in the list, there are no supported property
indices.
To determine the value of an indexed property of a TextTrackList
object for a given index index, the user agent must return the indexth text track in the list represented by the
TextTrackList object.
The getTrackById(id) method must return the first TextTrack in the
TextTrackList object whose id IDL attribute
would return a value equal to the value of the id argument. When no tracks
match the given argument, the method must return null.
enum TextTrackMode { "disabled", "hidden", "showing" };
enum TextTrackKind { "subtitles", "captions", "descriptions", "chapters", "metadata" };
interface TextTrack : EventTarget {
readonly attribute TextTrackKind kind;
readonly attribute DOMString label;
readonly attribute DOMString language;
readonly attribute DOMString id;
readonly attribute DOMString inBandMetadataTrackDispatchType;
attribute TextTrackMode mode;
readonly attribute TextTrackCueList? cues;
readonly attribute TextTrackCueList? activeCues;
void addCue(TextTrackCue cue);
void removeCue(TextTrackCue cue);
attribute EventHandler oncuechange;
};
addTextTrack( kind [, label [, language ] ] )ã¡ãã£ã¢èŠçŽ ã®ããã¹ããã©ãã¯ã®ãªã¹ãã«è¿œå ãããæ°ããTextTrackãªããžã§ã¯ããäœæããŠè¿ãã
kindããã¹ããã©ãã¯ã®çš®é¡ã®æååãè¿ãã
labelååšããããŸãã¯ç©ºã®æååïŒãªããžã§ã¯ãããŠãŒã¶ãŒã«å ¬éãããå Žåããªããžã§ã¯ãã®ä»ã®å±æ§ããããããçæããå¿ èŠãããã«ã¹ã¿ã ã©ãã«ã瀺ãïŒãããå Žåãããã¹ããã©ãã¯ã®ã©ãã«ãè¿ãã
languageããã¹ããã©ãã¯ã®èšèªã®æååãè¿ãã
idæå®ããããã©ãã¯ã®IDãè¿ãã
垯åå
ãã©ãã¯ã«å¯ŸããŠããã©ãŒããããMedia Fragments URIæ§æããµããŒãããgetTrackById()ã¡ãœãããšãšãã«äœ¿çšã§ããå Žåãããã¯ããã©ã°ã¡ã³ãèå¥åã§äœ¿çšã§ããIDã§ããã[MEDIAFRAG]
trackèŠçŽ ã«å¯Ÿå¿ããTextTrackãªããžã§ã¯ãã«å¯ŸããŠãããã¯trackèŠçŽ ã®IDã§ããã
inBandMetadataTrackDispatchTypeããã¹ããã©ãã¯åž¯åå ã®ã¡ã¿ããŒã¿ãã©ãã¯ãã£ã¹ãããã¿ã€ãã®æååãè¿ãã
mode [ = value ]以äžã®ãªã¹ãããæååã«ãã£ãŠè¡šããããããã¹ããã©ãã¯ã¢ãŒããè¿ãïŒ
disabled"ããã¹ããã©ãã¯ç¡å¹ã¢ãŒãã
hidden"ããã¹ããã©ãã¯é衚瀺ã¢ãŒãã
showing"ããã¹ããã©ãã¯è¡šç€ºã¢ãŒãã
ã¢ãŒãã倿Žããèšå®ãå¯èœã§ããã
cuesTextTrackCueListãªããžã§ã¯ããšããŠããã¥ãŒã®ããã¹ããã©ãã¯ãªã¹ããè¿ãã
activeCuesTextTrackCueListãªããžã§ã¯ããšããŠãçŸåšã¢ã¯ãã£ãã§ãããã¥ãŒã®ããã¹ããã©ãã¯ãªã¹ããããããã¹ããã©ãã¯ãã¥ãŒãè¿ãïŒã€ãŸããçŸåšã®åçäœçœ®ã®åã«éå§ãããã®åŸã§çµäºããïŒã
addCue( cue )textTrackã®ãã¥ãŒã®ããã¹ããã©ãã¯ãªã¹ãã«æå®ããããã¥ãŒã远å ããã
removeCue( cue )textTrackã®ãã¥ãŒã®ããã¹ããã©ãã¯ãªã¹ãããæå®ããããã¥ãŒãåé€ããã
The addTextTrack(kind, label, language) method of media elements, when invoked, must run the following steps:
Create a new TextTrack object.
Create a new text track corresponding to the new object, and set its text track kind to kind, its text track label to label, its text track language to language, its text track readiness state to the text track loaded state, its text track mode to the text track hidden mode, and its text track list of cues to an empty list.
Initially, the text track list of cues is not associated with any rules for updating the text track rendering. When a text track cue is added to it, the text track list of cues has its rules permanently set accordingly.
Add the new text track to the media element's list of text tracks.
Queue a task to fire a trusted event with the name addtrack, that does not bubble and is not cancelable, and
that uses the TrackEvent interface, with the track attribute initialized to the new text
track's TextTrack object, at the media element's textTracks attribute's TextTrackList
object.
Return the new TextTrack object.
The kind attribute must return the
text track kind of the text track that the TextTrack object
represents.
The label attribute must return the
text track label of the text track that the TextTrack
object represents.
The language attribute must return the
text track language of the text track that the TextTrack
object represents.
The id attribute returns the track's
identifier, if it has one, or the empty string otherwise. For tracks that correspond to
track elements, the track's identifier is the value of the element's id attribute, if any. For in-band tracks, the track's identifier is
specified by the media resource. If the media resource is in a format
that supports the Media Fragments URI fragment identifier syntax, the identifier
returned for a particular track must be the same identifier that would enable the track if used as
the name of a track in the track dimension of such a fragment identifier. [MEDIAFRAG]
The inBandMetadataTrackDispatchType
attribute must return the text track in-band metadata track dispatch type of the
text track that the TextTrack object represents.
The mode attribute, on getting, must return
the string corresponding to the text track mode of the text track that
the TextTrack object represents, as defined by the following list:
disabled"hidden"showing"On setting, if the new value isn't equal to what the attribute would currently return, the new value must be processed as follows:
disabled"Set the text track mode of the text track that the
TextTrack object represents to the text track disabled mode.
hidden"Set the text track mode of the text track that the
TextTrack object represents to the text track hidden mode.
showing"Set the text track mode of the text track that the
TextTrack object represents to the text track showing mode.
If the text track mode of the text track that the
TextTrack object represents is not the text track disabled mode, then
the cues attribute must return a
live TextTrackCueList object that represents the subset of the
text track list of cues of the text track that the
TextTrack object represents whose end
times occur at or after the earliest possible position when the script
started, in text track cue order. Otherwise, it must return null. When an
object is returned, the same object must be returned each time.
The earliest possible position when the script started is whatever the earliest possible position was the last time the event loop reached step 1.
If the text track mode of the text track that the
TextTrack object represents is not the text track disabled mode, then
the activeCues attribute must return a
live TextTrackCueList object that represents the subset of the
text track list of cues of the text track that the
TextTrack object represents whose active flag was set when the script
started, in text track cue order. Otherwise, it must return null. When an
object is returned, the same object must be returned each time.
A text track cue's active flag was set when the script started if its text track cue active flag was set the last time the event loop reached step 1.
The addCue(cue) method
of TextTrack objects, when invoked, must run the following steps:
If the text track list of cues does not yet have any associated rules for updating the text track rendering, then associate the text track list of cues with the rules for updating the text track rendering appropriate to cue.
If text track list of cues' associated rules for updating the text
track rendering are not the same rules for updating the text track rendering
as appropriate for cue, then throw an InvalidStateError
exception and abort these steps.
If the given cue is in a text track list of cues, then remove cue from that text track list of cues.
Add cue to the method's TextTrack object's text
track's text track list of cues.
The removeCue(cue)
method of TextTrack objects, when invoked, must run the following steps:
If the given cue is not currently listed in the method's
TextTrack object's text track's text track list of cues,
then throw a NotFoundError exception and abort these steps.
Remove cue from the method's TextTrack object's
text track's text track list of cues.
ãã®äŸã«ãããŠãaudioèŠçŽ ã¯ã倿°ã®ãµãŠã³ããšãã§ã¯ããå«ããµãŠã³ããã¡ã€ã«ããç¹å®ã®ãµãŠã³ããšãã§ã¯ããåçããããã«äœ¿çšãããããã¥ãŒã¯ãããšããã©ãŠã¶ãäžéšã®ã¹ã¯ãªãããå®è¡ããŠããžãŒã§ãã£ãŠãããªãŒãã£ãªãã¯ãªããã®æåŸã§æ£ç¢ºã«çµäºããããããªãŒãã£ãªãäžæåæ¢ããããã«äœ¿çšããããããŒãžããªãŒãã£ãªãäžæåæ¢ããã¹ã¯ãªããã«äŸåãããã©ãŠã¶ã¯æå®ãããæ£ç¢ºãªæéã«ã¹ã¯ãªãããå®è¡ããããšãã§ããªãã£ãå Žåãæ¬¡ã®ã¯ãªããã®åºã ããèããŠãããããããªãã
var sfx = new Audio('sfx.wav');
var sounds = sfx.addTextTrack('metadata');
// add sounds we care about
function addFX(start, end, name) {
var cue = new VTTCue(start, end, '');
cue.id = name;
cue.pauseOnExit = true;
sounds.addCue(cue);
}
addFX(12.783, 13.612, 'dog bark');
addFX(13.612, 15.091, 'kitten mew'))
function playSound(id) {
sfx.currentTime = sounds.getCueById(id).startTime;
sfx.play();
}
// play a bark as soon as we can
sfx.oncanplaythrough = function () {
playSound('dog bark');
}
// meow when the user tries to leave
window.onbeforeunload = function () {
playSound('kitten mew');
return 'Are you sure you want to leave this awesome page?';
}
interface TextTrackCueList {
readonly attribute unsigned long length;
getter TextTrackCue (unsigned long index);
TextTrackCue? getCueById(DOMString id);
};
lengthãªã¹ãå ã®ãã¥ãŒã®æ°ãè¿ãã
ãªã¹ãå ã®ã€ã³ããã¯ã¹indexãæã€ããã¹ããã©ãã¯ãã¥ãŒãè¿ãããã¥ãŒã¯ãããã¹ããã©ãã¯ãã¥ãŒé ã«ãœãŒããããã
getCueById( id )ããã¹ããã©ãã¯ãã¥ãŒèå¥åidãæã€ïŒããã¹ããã©ãã¯ãã¥ãŒé ã§ïŒæåã®ããã¹ããã©ãã¯ãã¥ãŒãè¿ãã
ãããã®ãã¥ãŒãæå®ãããèå¥åãæããªãå ŽåããŸãã¯åŒæ°ãç©ºã®æååã§ããå Žåãnullãè¿ãã
A TextTrackCueList object represents a dynamically updating list of text track cues in a given order.
The length attribute must return
the number of cues in the list represented by the
TextTrackCueList object.
The supported property indices of a TextTrackCueList object at any
instant are the numbers from zero to the number of cues in the
list represented by the TextTrackCueList object minus one, if any. If there are no
cues in the list, there are no supported property
indices.
To determine the value of an indexed property for a given index index, the user agent must return the indexth text track
cue in the list represented by the TextTrackCueList object.
The getCueById(id) method, when called with an argument other than the empty string,
must return the first text track cue in the list represented by the
TextTrackCueList object whose text track cue identifier is id, if any, or null otherwise. If the argument is the empty string, then the method
must return null.
interface TextTrackCue : EventTarget {
readonly attribute TextTrack? track;
attribute DOMString id;
attribute double startTime;
attribute double endTime;
attribute boolean pauseOnExit;
attribute EventHandler onenter;
attribute EventHandler onexit;
};
ååšããå Žåããã®ããã¹ããã©ãã¯ãã¥ãŒãå±ããTextTrackãªããžã§ã¯ããè¿ããããã§ãªããã°nullãè¿ãã
ããã¹ããã©ãã¯ãã¥ãŒèå¥åãè¿ãã
èšå®å¯èœã§ããã
ç§åäœã§ãããã¹ããã©ãã¯ãã¥ãŒã®éå§æå»ãè¿ãã
èšå®å¯èœã§ããã
ç§åäœã§ãããã¹ããã©ãã¯ãã¥ãŒã®çµäºæå»ãè¿ãã
èšå®å¯èœã§ããã
ããã¹ã·ãã©ãã¯Â·ãã¥ãŒpause-on-exitãã©ã°ãèšå®ãããå Žåtrueãè¿ããããã§ãªããã°falseãè¿ãã
èšå®å¯èœã§ããã
The track attribute, on getting, must
return the TextTrack object of the text track in whose list of cues the text track cue that the
TextTrackCue object represents finds itself, if any; or null otherwise.
The id attribute, on getting, must return
the text track cue identifier of the text track cue that the
TextTrackCue object represents. On setting, the text track cue
identifier must be set to the new value.
The startTime attribute, on getting,
must return the text track cue start time of the text track cue that the
TextTrackCue object represents, in seconds. On setting, the text track cue
start time must be set to the new value, interpreted in seconds; then, if the
TextTrackCue object's text track cue is in a text track's
list of cues, and that text track is in
a media element's list of text tracks, and the media
element's show poster flag is not set, then run the time marches on
steps for that media element.
The endTime attribute, on getting,
must return the text track cue end time of the text track cue that the
TextTrackCue object represents, in seconds. On setting, the text track cue end
time must be set to the new value, interpreted in seconds; then, if the
TextTrackCue object's text track cue is in a text track's
list of cues, and that text track is in
a media element's list of text tracks, and the media
element's show poster flag is not set, then run the time marches on
steps for that media element.
The pauseOnExit attribute, on
getting, must return true if the text track cue pause-on-exit flag of the text
track cue that the TextTrackCue object represents is set; or false otherwise.
On setting, the text track cue pause-on-exit flag must be set if the new value is
true, and must be unset otherwise.
ç« ã¯ãæå®ãããã¿ã€ãã«ããã€ã¡ãã£ã¢ãªãœãŒã¹ã®åºåã§ãããææžã¢ãŠãã©ã€ã³ã®ã»ã¯ã·ã§ã³ã§ãµãã»ã¯ã·ã§ã³ãæã€ããšãã§ããã®ãšåãããã«ãç« ã¯å ¥ãåã«ã§ããã
ç« ãèšè¿°ããããã«äœ¿çšãããŠããããã¹ããã©ãã¯å ã®åããã¹ããã©ãã¯ãã¥ãŒã¯ãç« ã®éå§æå»ãäžããããã¹ããã©ãã¯ãã¥ãŒã®éå§æå»ãç« ã®çµäºæå»ãäžããããã¹ããã©ãã¯ãã¥ãŒã®çµäºæå»ãããã³ç« ã®ã¿ã€ãã«ãäžããããã¹ããã©ãã¯ãã¥ãŒã®ããã¹ãã®3ã€ã®äž»èŠãªæ©èœãæã€ã
The rules for constructing the chapter tree from a text track are as follows. They produce a potentially nested list of chapters, each of which have a start time, end time, title, and a list of nested chapters. This algorithm discards cues that do not correctly nest within each other, or that are out of order.
Let list be a copy of the list of cues of the text track being processed.
Remove from list any text track cue whose text track cue end time is before its text track cue start time.
Let output be an empty list of chapters, where a chapter is a record consisting of a start time, an end time, a title, and a (potentially empty) list of nested chapters. For the purpose of this algorithm, each chapter also has a parent chapter.
Let current chapter be a stand-in chapter whose start time is negative infinity, whose end time is positive infinity, and whose list of nested chapters is output. (This is just used to make the algorithm easier to describe.)
Loop: If list is empty, jump to the step labeled end.
Let current cue be the first cue in list, and then remove it from list.
If current cue's text track cue start time is less than the start time of current chapter, then return to the step labeled loop.
While current cue's text track cue start time is greater than or equal to current chapter's end time, let current chapter be current chapter's parent chapter.
If current cue's text track cue end time is greater than the end time of current chapter, then return to the step labeled loop.
Create a new chapter new chapter, whose start time is current cue's text track cue start time, whose end time is current cue's text track cue end time, whose title is current cue's text track cue data interpreted according to its rules for rendering the cue in isolation, and whose list of nested chapters is empty.
For WebVTT, the rules for rendering the cue in isolation are the rules for interpreting WebVTT cue text. [WEBVTT]
Append new chapter to current chapter's list of nested chapters, and let current chapter be new chapter's parent.
Let current chapter be new chapter.
Return to the step labeled loop.
End: Return output.
WebVTTãã¡ã€ã«ã®ä»¥äžã®æçã¯ããã¹ããããç« ãããŒã¯ã¢ããããæ§åã瀺ãããã¡ã€ã«ã¯ã3ã€ã®50åã®ç« ã"Astrophysics"ã"Computational Physics"ãããã³"General Relativity"ãèšè¿°ããã1ã€ç®ã¯3ã€ã®ãµããã£ãã¿ãŒãæã¡ã2ã€ç®ã¯4ã€ã3ã€ç®ã¯2ã€ã®ãµããã£ãã¿ãŒãæã€ã[WEBVTT]
WEBVTT 00:00:00.000 --> 00:50:00.000 Astrophysics 00:00:00.000 --> 00:10:00.000 Introduction to Astrophysics 00:10:00.000 --> 00:45:00.000 The Solar System 00:00:00.000 --> 00:10:00.000 Coursework Description 00:50:00.000 --> 01:40:00.000 Computational Physics 00:50:00.000 --> 00:55:00.000 Introduction to Programming 00:55:00.000 --> 01:30:00.000 Data Structures 01:30:00.000 --> 01:35:00.000 Answers to Last Exam 01:35:00.000 --> 01:40:00.000 Coursework Description 01:40:00.000 --> 02:30:00.000 General Relativity 01:40:00.000 --> 02:00:00.000 Tensor Algebra 02:00:00.000 --> 02:30:00.000 The General Relativistic Field Equations
The following are the event handlers that (and their corresponding event handler event types) must be supported, as event handler IDL
attributes, by all objects implementing the TextTrackList interface:
| ã€ãã³ããã³ãã© | ã€ãã³ããã³ãã©ã€ãã³ãå |
|---|---|
onchange | change
|
onaddtrack | addtrack
|
onremovetrack | removetrack
|
The following are the event handlers that (and their corresponding event handler event types) must be supported, as event handler IDL
attributes, by all objects implementing the TextTrack interface:
| ã€ãã³ããã³ãã© | ã€ãã³ããã³ãã©ã€ãã³ãå |
|---|---|
oncuechange | cuechange
|
The following are the event handlers that (and their corresponding event handler event types) must be supported, as event handler IDL
attributes, by all objects implementing the TextTrackCue interface:
| ã€ãã³ããã³ãã© | ã€ãã³ããã³ãã©ã€ãã³ãå |
|---|---|
onenter | enter
|
onexit | exit
|
controls屿§ã¯çåœå±æ§ã§ãããååšããå Žåãèè
ãã¹ã¯ãªããåãããã³ã³ãããŒã©ãæäŸããŠãããããŠãŒã¶ãŒãšãŒãžã§ã³ãã«ç¬èªã®ã³ã³ãããŒã«ã»ãããæäŸããããšèããŠããããšã瀺ãã
If the attribute is present, or if scripting is disabled for the media element, then the user agent should expose a user interface to the user. This user interface should include features to begin playback, pause playback, seek to an arbitrary position in the content (if the content supports arbitrary seeking), change the volume, change the display of closed captions or embedded sign-language tracks, select different audio tracks or turn on audio descriptions, and show the media content in manners more suitable to the user (e.g. full-screen video or in an independent resizable window). Other controls may also be made available.
If the media element has a current media controller, then the user
agent should expose audio tracks from all the slaved media elements (although
avoiding duplicates if the same media resource is being used several times). If a
media resource's audio track exposed in this way has no known name, and it is the
only audio track for a particular media element, the user agent should use the
element's title attribute, if any, as the name (or as part of the
name) of that track.
Even when the attribute is absent, however, user agents may provide controls to affect playback
of the media resource (e.g. play, pause, seeking, and volume controls), but such features should
not interfere with the page's normal rendering. For example, such features could be exposed in the
media element's context menu. The user agent may implement this simply by exposing a user interface to the user as
described above (as if the controls attribute was
present).
If the user agent exposes a user interface to
the user by displaying controls over the media element, then the user agent
should suppress any user interaction events while the user agent is interacting with this
interface. (For example, if the user clicks on a video's playback control, mousedown events and so forth would not simultaneously be fired at
elements on the page.)
Where possible (specifically, for starting, stopping, pausing, and unpausing playback, for seeking, for changing the rate of playback, for fast-forwarding or rewinding, for listing, enabling, and disabling text tracks, and for muting or changing the volume of the audio), user interface features exposed by the user agent must be implemented in terms of the DOM API described above, so that, e.g., all the same events fire.
When a media element has a current media controller, the user agent's
user interface for pausing and unpausing playback, for seeking, for changing the rate of playback,
for fast-forwarding or rewinding, and for muting or changing the volume of audio of the entire
group must be implemented in terms of the MediaController API exposed on that
current media controller. When a media element has a current media
controller, and all the slaved media elements of that
MediaController are paused, the user agent should also unpause all the slaved
media elements when the user invokes a user agent interface control for beginning
playback.
The "play" function in the user agent's interface must set the playbackRate attribute to the value of the defaultPlaybackRate attribute before invoking the play()
method. When a media element has a current media controller, the
attributes and method with those names on that MediaController object must be used.
Otherwise, the attributes and method with those names on the media element itself
must be used.
Features such as fast-forward or rewind must be implemented by only changing the playbackRate attribute (and not the defaultPlaybackRate
attribute). Again, when a media element has a current media controller,
the attributes with those names on that MediaController object must be used;
otherwise, the attributes with those names on the media element itself must be used.
When a media element has a current media controller, seeking must be
implemented in terms of the currentTime
attribute on that MediaController object. Otherwise, the user agent must directly
seek to the requested position in the media
element's media timeline. For media resources where seeking to an arbitrary
position would be slow, user agents are encouraged to use the approximate-for-speed flag
when seeking in response to the user manipulating an approximate position interface such as a seek
bar.
When a media element has a current media controller, user agents may
additionally provide the user with controls that directly manipulate an individual media
element without affecting the MediaController, but such features are
considered relatively advanced and unlikely to be useful to most users.
The activation behavior of a media element that is exposing a user interface to the user must be to run the following steps:
If the media element has a current media controller, and that
current media controller is a restrained media controller, then invoke
the play() method of the
MediaController.
Otherwise, if the media element has a current media controller,
and that current media controller is a paused media controller, then
invoke the unpause() method of the
MediaController.
Otherwise, if the media element has a current media controller,
then that current media controller is a playing media controller;
invoke the pause() method of the
MediaController.
Otherwise, the media element has no current media controller; if
the media element's paused attribute is true,
then invoke the play() method on the media
element.
Otherwise, the media element has no current media controller,
and the media element's paused attribute is
false; invoke the pause() method on the media
element.
For the purposes of listing chapters in the media resource, only text tracks in the media element's list of text tracks
that are showing and whose text track kind is
chapters should be used. Such tracks must be
interpreted according to the rules for constructing the chapter tree from a text
track. When seeking in response to a user maniplating a chapter selection interface, user
agents should not use the approximate-for-speed flag.
The controls IDL attribute must
reflect the content attribute of the same name.
volume [ = value ]0.0ãã1.0ãŸã§ã®ç¯å²ã®æ°åãšããŠãçŸåšã®åçé³éãè¿ããããã§0.0ã¯æå°é³éã§1.0ã¯æå€§é³éã§ããã
é³éã倿Žããèšå®ãå¯èœã§ããã
æ°ããå€ãç¯å²0.0ãã1.0ã«å«ãŸããªãå ŽåãIndexSizeErrorãæããã
muted [ = value ]volume屿§ãäžæžãããé³å£°ããã¥ãŒãã§ããå Žåtrueãè¿ããvolume屿§ãç¡èŠãããå Žåãfalseãè¿ãã
ãªãŒãã£ãªããã¥ãŒãã§ãããã©ããã倿Žããèšå®ãå¯èœã§ããã
The volume attribute must return the playback
volume of any audio portions of the media element, in the range 0.0 (silent) to 1.0
(loudest). Initially, the volume should be 1.0, but user agents may remember the last set value
across sessions, on a per-site basis or otherwise, so the volume may start at other values. On
setting, if the new value is in the range 0.0 to 1.0 inclusive, the playback volume of any audio
portions of the media element must be set to the new value. If the new value is
outside the range 0.0 to 1.0 inclusive, then, on setting, an IndexSizeError exception
must be thrown instead.
The muted attribute must return true if the
audio output is muted and false otherwise. Initially, the audio output should not be muted
(false), but user agents may remember the last set value across sessions, on a per-site basis or
otherwise, so the muted state may start as muted (true). On setting, if the new value is true then
the audio output should be muted and if the new value is false it should be unmuted.
Whenever either of the values that would be returned by the volume and muted attributes
change, the user agent must queue a task to fire a simple event named
volumechange at the media element.
An element's effective media volume is determined as follows:
If the user has indicated that the user agent is to override the volume of the element, then the element's effective media volume is the volume desired by the user. Abort these steps.
If the element's audio output is muted, the element's effective media volume is zero. Abort these steps.
If the element has a current media controller and that
MediaController object's media controller mute override is true, the
element's effective media volume is zero. Abort these steps.
Let volume be the playback volume of the audio portions of the media element, in range 0.0 (silent) to 1.0 (loudest).
If the element has a current media controller, multiply volume by that MediaController object's media controller volume
multiplier.
The element's effective media volume is volume, interpreted relative to the range 0.0 to 1.0, with 0.0 being silent, and 1.0 being the loudest setting, values in between increasing in loudness. The range need not be linear. The loudest setting may be lower than the system's loudest possible setting; for example the user could have set a maximum volume.
ã¡ãã£ã¢èŠçŽ ã®muted屿§ã¯ãæœåšçã«ãŠãŒã¶ãŒèšå®ãäžæžãããã¡ãã£ã¢ãªãœãŒã¹ã«å±ãããªãŒãã£ãªåºåã®ããã©ã«ãã®ç¶æ
ãå¶åŸ¡ããçåœå±æ§ã§ããã
When a media element is created, if it has a muted attribute specified, the user agent must mute the
media element's audio output, overriding any user preference.
The defaultMuted IDL attribute must
reflect the muted content attribute.
ãã®å±æ§ã¯åç广ïŒèŠçŽ ã®ããã©ã«ãã®ç¶æ ã®ã¿ãå¶åŸ¡ããïŒãæããªãã
ãã®ãããªïŒåºåïŒã¯èªååçãããããŠãŒã¶ãŒãæ©ãŸãã®ãé¿ããããã«é³ãªãã§åçããŠããŠãŒã¶ãŒãé³å£°ããªã³ã«ã§ããããã«ããã
<video src="adverts.cgi?kind=video" controls autoplay loop muted></video>
TimeRangesã€ã³ã¿ãŒãã§ãŒã¹ãå®è£
ãããªããžã§ã¯ãã¯ãæéã®ç¯å²ïŒæéïŒã®ãªã¹ãã衚ãã
interface TimeRanges {
readonly attribute unsigned long length;
double start(unsigned long index);
double end(unsigned long index);
};
lengthãªããžã§ã¯ãå ã®ç¯å²ã®æ°ãè¿ãã
start(index)æå®ãããã€ã³ããã¯ã¹ããã€ç¯å²ã®éå§æå»ãè¿ãã
ã€ã³ããã¯ã¹ãç¯å²å€ã®å ŽåIndexSizeErrorãæããã
end(index)æå®ãããã€ã³ããã¯ã¹ããã€ç¯å²ã®çµäºæå»ãè¿ãã
ã€ã³ããã¯ã¹ãç¯å²å€ã®å ŽåIndexSizeErrorãæããã
The length IDL attribute must return the
number of ranges represented by the object.
The start(index)
method must return the position of the start of the indexth range represented
by the object, in seconds measured from the start of the timeline that the object covers.
The end(index) method
must return the position of the end of the indexth range represented by the
object, in seconds measured from the start of the timeline that the object covers.
These methods must throw IndexSizeError exceptions if called with an index argument greater than or equal to the number of ranges represented by the
object.
When a TimeRanges object is said to be a normalized TimeRanges
object, the ranges it represents must obey the following criteria:
In other words, the ranges in such an object are ordered, don't overlap, aren't empty, and don't touch (adjacent ranges are folded into one bigger range).
Ranges in a TimeRanges object must be inclusive.
Thus, the end of a range would be equal to the start of a following adjacent (touching but not overlapping) range. Similarly, a range covering a whole timeline anchored at zero would have a start equal to zero and an end equal to the duration of the timeline.
The timelines used by the objects returned by the buffered, seekable and
played IDL attributes of media
elements must be that element's media timeline.
[Constructor(DOMString type, optional TrackEventInit eventInitDict)]
interface TrackEvent : Event {
readonly attribute (VideoTrack or AudioTrack or TextTrack) track;
};
dictionary TrackEventInit : EventInit {
(VideoTrack or AudioTrack or TextTrack) track;
};
trackã€ãã³ããé¢é£ãããã©ãã¯ãªããžã§ã¯ãïŒTextTrackãAudioTrackããŸãã¯VideoTrackïŒãè¿ãã
The track attribute must return the value it was initialized to. ãªããžã§ã¯ããäœæãããéããã®å±æ§ã¯nullã«åæåããªããã°ãªããªããIt represents the context information for the event.
ãã®ç¯ã¯éèŠç¯çã§ããã
äžèšã®åŠçã¢ãã«ã®äžéšãšããŠãã¡ãã£ã¢èŠçŽ ã§ä»¥äžã®ã€ãã³ããçºç«ããïŒ
| ã€ãã³ãå | ã€ã³ã¿ãŒãã§ãŒã¹ | çºç«æ¡ä»¶ | Preconditions |
|---|---|---|---|
loadstart
| Event
| ãŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ããªãœãŒã¹éžæã¢ã«ãŽãªãºã ã®äžéšãšããŠãã¡ãã£ã¢ããŒã¿ãæ¢ãå§ããã | networkStateãNETWORK_LOADINGãšçãã
|
progress
| Event
| ãŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãã¡ãã£ã¢ããŒã¿ããã§ããããŠããã | networkStateãNETWORK_LOADINGãšçãã
|
suspend
| Event
| ãŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãæå³çã«çŸåšã®ã¡ãã£ã¢ããŒã¿ããã§ããããŠããªãã | networkStateã¯NETWORK_IDLEãšçãã
|
abort
| Event
| ãŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãå®å šã«ããŠã³ããŒããããåã«ã¡ãã£ã¢ããŒã¿ã®ãã§ããã忢ãããããšã©ãŒã«ãããã®ã§ã¯ãªãã | errorã¯ãã³ãŒãMEDIA_ERR_ABORTEDããã€ãªããžã§ã¯ãã§ããã networkStateã¯ãããŠã³ããŒããäžæ¢ãããææã«å¿ããŠãNETWORK_EMPTYãŸãã¯NETWORK_IDLEã®ããããã«çããã
|
error
| Event
| ã¡ãã£ã¢ããŒã¿ã®ãã§ããäžã«ãšã©ãŒãçºçããã | errorã¯ãã³ãŒãMEDIA_ERR_NETWORK以äžããã€ãªããžã§ã¯ãã§ããã networkStateã¯ãããŠã³ããŒããäžæ¢ãããææã«å¿ããŠãNETWORK_EMPTYãŸãã¯NETWORK_IDLEã®ããããã«çããã
|
emptied
| Event
| 以åNETWORK_EMPTYç¶æ
ã§ãªãã£ãnetworkStateã§ããã¡ãã£ã¢èŠçŽ ãããã®ç¶æ
ã«ã¡ããã©åãæ¿ãã£ãïŒããŒãäžã«èŽåœçãªãšã©ãŒãçºçããããããªãœãŒã¹éžæã¢ã«ãŽãªãºã ããã§ã«å®è¡ããŠããéã«load()ã¡ãœãããåŒã³åºãããããã®ããããïŒã
| networkStateã¯NETWORK_EMPTYã§ããããã¹ãŠã®IDL屿§ã¯ãåæç¶æ
ã§ããã
|
stalled
| Event
| ãŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãã¡ãã£ã¢ããŒã¿ããã§ããããããšããŠããããããŒã¿ãçªçºçã«çšæãããªãã | networkStateã¯NETWORK_LOADINGã§ããã
|
loadedmetadata
| Event
| ãŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãã¡ããã©ã¡ãã£ã¢ãªãœãŒã¹ãšããã¹ããã©ãã¯ã®æºåã®æéãšå¯žæ³ã決å®ããã | readyStateã¯åææéã«å¯ŸããŠæ°ãã«HAVE_METADATAã«çããããã以äžã§ããã
|
loadeddata
| Event
| ãŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãåææéã«å¯ŸããŠçŸåšã®åçäœçœ®ã§ã¡ãã£ã¢ããŒã¿ãã¬ã³ããªã³ã°ã§ããã | readyStateã¯ãåææéã«å¯ŸããŠæ°ãã«HAVE_CURRENT_DATA以äžã«å¢å ããã
|
canplay
| Event
| ãŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãã¡ãã£ã¢ããŒã¿ã®åçãåéã§ããããåçãä»ããéå§ãããããšã«ãªã£ããã©ãããæšå®ããã¡ãã£ã¢ãªãœãŒã¹ã¯ãã³ã³ãã³ãã®è¿œå ã®ãããã¡ãªã³ã°ã«å¯ŸããŠåæ¢ãããããšãªããçµããã«çŸåšã®åçã¬ãŒãã§ã¬ã³ããªã³ã°ã§ããªãã£ãã | readyStateã¯ãæ°ãã«HAVE_FUTURE_DATA以äžã«å¢å ããã
|
canplaythrough
| Event
| ãŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ãåçãä»ããéå§ãããããšã«ãªã£ããã©ãããæšå®ããã¡ãã£ã¢ãªãœãŒã¹ã¯è¿œå ã®ãããã¡ãªã³ã°ã«å¯ŸããŠåæ¢ããããšãªããçŸåšã®åçã¬ãŒãã®æåŸãŸã§ã®ãã¹ãŠã®æ¹æ³ã§ã¬ã³ããªã³ã°ã§ããã | readyStateã¯æè¿ã®HAVE_ENOUGH_DATAã«çããã
|
playing
| Event
| åçã¯ãã¡ãã£ã¢ããŒã¿ã®äžè¶³ã®ããã«ãäžæåæ¢ãŸãã¯é å»¶ãããåŸã«éå§ããæºåãã§ããŠããã | readyStateãæ°ãã«çãããŸãã¯HAVE_FUTURE_DATAãè¶
ããŠãããpausedã¯falseã§ããããŸãã¯pausedãæ°ãã«falseã§ãããreadyStateãçãããããŸãã¯HAVE_FUTURE_DATAãã倧ãããããšããã®ã€ãã³ããçºç«ããŠãã èŠçŽ ã¯äŸç¶ãšããŠæœåšçã«åçãããŠããªããããããªããããšãã°ãèŠçŽ ãã¡ãã£ã¢ã³ã³ãããŒã©äžã§ãããã¯ãããå ŽåïŒããšãã°ãçŸåšã®ã¡ãã£ã¢ã³ã³ãããŒã©ãäžæåæ¢ãããããŸãã¯å¥ã®åŸå±ã¡ãã£ã¢èŠçŽ ãäœããã®åœ¢ã§ã¹ããŒã«ããŠããããããŸãã¯ã¡ãã£ã¢ãªãœãŒã¹ãã¡ãã£ã¢ã³ã³ãããŒã©ã®äœçœ®ã«å¯Ÿå¿ããããŒã¿ããªãããïŒããŸãã¯èŠçŽ ããŠãŒã¶ãŒãšã®å¯Ÿè©±ã®ããã«äžæåæ¢ãŸãã¯åž¯åå
ã³ã³ãã³ãã®ããã«äžæåæ¢ã§ããã
|
waiting
| Event
| 次ã®ãã¬ãŒã ãå©çšã§ããªããããåçã忢ãããããŠãŒã¶ãŒãšãŒãžã§ã³ãã¯ããã®ãã¬ãŒã ããããŠå©çšã§ããããã«ãªããšäºæ³ããã | readyStateãçãããããŸãã¯HAVE_CURRENT_DATAæªæºã§ãããpausedã¯falseã§ãããseekingã¯trueã§ããããŸãã¯çŸåšã®åçäœçœ®ã¯bufferedå
ã®é åã®ããããã«å«ãŸããŠããªããã®ãããããåçãpausedãfalseã§ãªãã«ãã®ä»ã®çç±ã§åæ¢ããããšã¯å¯èœã§ãããããããã®çç±ã¯ãã®ã€ãã³ãã¯çºç«ããªãïŒãããŠãã®ãããªç¶æ³ã解決ãããšãã«ãå¥ã
ã®playingã€ãã³ããã©ã¡ããçºç«ããªãïŒïŒããšãã°ãèŠçŽ ãæ°ãã«ãã®ã¡ãã£ã¢ã³ã³ãããŒã©äžã§ãããã¯ããããåçãçµäºããããŸãã¯åçããšã©ãŒã«ãã忢ããããŸãã¯èŠçŽ ããŠãŒã¶ãŒãšã®å¯Ÿè©±ã®ããã«äžæåæ¢ãŸãã¯åž¯åå
ã³ã³ãã³ãã®ããã«äžæåæ¢ããŠããã
|
seeking
| Event
| seekingIDL屿§ãtrueã«å€æŽããããã€ãŠãŒã¶ãŒãšãŒãžã§ã³ããæ°ããäœçœ®ãæ¢ãå§ããŠããã
| |
seeked
| Event
| current playback positionã倿ŽãããåŸã«ãseekingIDL屿§ãfalseã«å€æŽãããã
| |
ended
| Event
| ã¡ãã£ã¢ãªãœãŒã¹ã®çµããã«éãããããåçã忢ããã | currentTimeã¯ãã¡ãã£ã¢ãªãœãŒã¹ã®æåŸã«çãããendedã¯trueã§ããã
|
durationchange
| Event
| duration屿§ã¯ã¡ããã©æŽæ°ãããã
| |
timeupdate
| Event
| çŸåšã®åçäœçœ®ããéåžžã®åçã®äžéšãšããŠããŸãã¯ãããšãã°äžé£ç¶çã«ãç¹ã«è峿·±ãæ¹æ³ã§å€æŽãããã | |
play
| Event
| èŠçŽ ã¯ãã¯ãäžæåæ¢ã§ãªããplay()ã¡ãœãããè¿ãããåŸããŸãã¯autoplay屿§ãéå§ããåçãèµ·ããéã«çºç«ããã
| pausedã¯ãæ°ãã«falseã§ããã
|
pause
| Event
| èŠçŽ ãäžæåæ¢ããããpause()ã¡ãœãããè¿ãããåŸã«çºç«ããã
| pausedã¯ãæ°ãã«trueã§ããã
|
ratechange
| Event
| defaultPlaybackRateãŸã㯠playbackRate屿§ãæŽæ°ãããã°ããã®ããããã
| |
resize
| Event
| videoWidthãšvideoWidth屿§ã®ãããããŸãã¯äž¡æ¹ãã¡ããã©æŽæ°ãããŠããã
| ã¡ãã£ã¢èŠçŽ ã¯videoèŠçŽ ã§ãããreadyStateã¯HAVE_NOTHINGã§ãªãã
|
volumechange
| Event
| volume屿§ãŸãã¯muted屿§ã®ããããã倿Žããããé¢é£ãã屿§ã®ã»ãã¿ãŒãè¿ãããåŸã«çºç«ããã
|
MediaControllerãªããžã§ã¯ãã§æ¬¡ã®ã€ãã³ããçºç«ããïŒ
| ã€ãã³ãå | ã€ã³ã¿ãŒãã§ãŒã¹ | çºç«æ¡ä»¶ |
|---|---|---|
emptied
| Event
| ãã¹ãŠã®åŸå±ã¡ãã£ã¢èŠçŽ ã¯ãæ°ãã«HAVE_NOTHING以äžã«èšå®ããreadyStateããã€ãããŸãã¯åŸå±ã¡ãã£ã¢èŠçŽ ããã¯ãååšããªãã
|
loadedmetadata
| Event
| ãã¹ãŠã®åŸå±ã¡ãã£ã¢èŠçŽ ã®readyStateãæ°ãHAVE_METADATA以äžã«èšå®ãããã
|
loadeddata
| Event
| ãã¹ãŠã®åŸå±ã¡ãã£ã¢èŠçŽ ã®readyStateãæ°ãHAVE_CURRENT_DATA以äžã«èšå®ãããã
|
canplay
| Event
| ãã¹ãŠã®åŸå±ã¡ãã£ã¢èŠçŽ ã®readyStateãæ°ãHAVE_FUTURE_DATA以äžã«èšå®ãããã
|
canplaythrough
| Event
| ãã¹ãŠã®åŸå±ã¡ãã£ã¢èŠçŽ ã®readyStateãæ°ãHAVE_ENOUGH_DATA以äžã«èšå®ãããã
|
playing
| Event
| MediaControllerã¯ããã¯ããããã¯ã¡ãã£ã¢ã³ã³ãããŒã©ã§ã¯ãªãã
|
ended
| Event
| MediaControllerã¯ããã¹ãŠã®åŸå±ã¡ãã£ã¢èŠçŽ ã®çµããã«éããã
|
waiting
| Event
| MediaControllerã¯çŸåšããããã¯ãããã¡ãã£ã¢ã³ã³ãããŒã©ã§ããã
|
ended
| Event
| ãã¹ãŠã®åŸå±ã¡ãã£ã¢èŠçŽ ãæ°ãã«åçãçµäºããŠããã |
durationchange
| Event
| duration屿§ã¯ã¡ããã©æŽæ°ãããã
|
timeupdate
| Event
| ã¡ãã£ã¢ã³ã³ãããŒã©ã®äœçœ®ã倿Žãããã |
play
| Event
| paused屿§ãæ°ãã«falseã§ããã
|
pause
| Event
| paused屿§ãæ°ãã«trueã§ããã
|
ratechange
| Event
| defaultPlaybackRate屿§ãŸãã¯playbackRate屿§ãã¡ããã©æŽæ°ããããã®ããããã
|
volumechange
| Event
| volume屿§ãŸãã¯muted屿§ãã¡ããã©æŽæ°ããããã®ããããã
|
AudioTrackListãVideoTrackListãããã³TextTrackList ãªããžã§ã¯ãã§æ¬¡ã®ã€ãã³ããçºç«ããïŒ
| ã€ãã³ãå | ã€ã³ã¿ãŒãã§ãŒã¹ | çºç«æ¡ä»¶ |
|---|---|---|
change
| Event
| ãã©ãã¯ãªã¹ãã®1ã€ä»¥äžã®ãã©ãã¯ãæå¹ãç¡å¹ãæã£ãŠããã |
addtrack
| TrackEvent
| ãã©ãã¯ã¯ãã©ãã¯ãªã¹ãã«å ããããŠããã |
removetrack
| TrackEvent
| ãã©ãã¯ã¯ãã©ãã¯ãªã¹ãããåé€ãããŠããã |
The main security and privacy implications of the video and audio
elements come from the ability to embed media cross-origin. There are two directions that threats
can flow: from hostile content to a victim page, and from a hostile page to victim content.
If a victim page embeds hostile content, the threat is that the content might contain scripted
code that attempts to interact with the Document that embeds the content. To avoid
this, user agents must ensure that there is no access from the content to the embedding page. In
the case of media content that uses DOM concepts, the embedded content must be treated as if it
was in its own unrelated top-level browsing context.
For instance, if an SVG animation was embedded in a video element,
the user agent would not give it access to the DOM of the outer page. From the perspective of
scripts in the SVG resource, the SVG file would appear to be in a lone top-level browsing context
with no parent.
If a hostile page embeds victim content, the threat is that the embedding page could obtain
information from the content that it would not otherwise have access to. The API does expose some
information: the existence of the media, its type, its duration, its size, and the performance
characteristics of its host. Such information is already potentially problematic, but in practice
the same information can more or less be obtained using the img element, and so it
has been deemed acceptable.
However, significantly more sensitive information could be obtained if the user agent further
exposes metadata within the content such as subtitles or chapter titles. Such information is
therefore only exposed if the video resource passes a CORS resource sharing check.
The crossorigin attribute allows authors to control
how this check is performed. [CORS]
Without this restriction, an attacker could trick a user running within a corporate network into visiting a site that attempts to load a video from a previously leaked location on the corporation's intranet. If such a video included confidential plans for a new product, then being able to read the subtitles would present a serious confidentiality breach.
ãã®ç¯ã¯éèŠç¯çã§ããã
ã»ãããããããã¯ã¹ãæºåž¯é»è©±ãªã©ã®å°åæ©åšäžã§ãªãŒãã£ãªããã³ãããªãåçãããªãœãŒã¹ã¯å€ãã®å Žåãéãããããã€ã¹ã®ããŒããŠã§ã¢ãªãœãŒã¹ã«ãã£ãŠå¶éããããããšãã°ãããã€ã¹ã¯3ã€ã®äžæãããªã®ã¿ããµããŒããããããããªãããã®ãããªçç±ãããèŠçŽ ãžã®åç
§ããã¹ãŠåé€ããããšã«é¢ããŠéåžžã«æ
éã§ããããã€ã¬ãŒããžã³ã¬ã¯ã·ã§ã³ããããšã«ãã£ãŠããŸãã¯èŠçŽ ã®src屿§ãšä»»æã®sourceèŠçŽ ã®åå«ãåé€ããŠãããèŠçŽ ã®load()ã¡ãœãããåŒã³åºããšã«ãã£ãŠã®ããããã§ãããããåçãçµãã£ãéãã¡ãã£ã¢èŠçŽ ãä¿æãããªãœãŒã¹ãè§£æŸããããšãæšå¥šããã
åæ§ã«ãåçéåºŠãæ£ç¢ºã«1.0ã§ãªãå ŽåãããŒããŠã§ã¢ããœãããŠã§ã¢ããŸãã¯ãã©ãŒãããã®å¶éã¯ãããªãã¬ãŒã ã«æ¬ èœãããªãŒãã£ãªã«é³éåããç¡é³ããããããããããªãã
ãã®ç¯ã¯éèŠç¯çã§ããã
How accurately various aspects of the media element API are implemented is considered a quality-of-implementation issue.
For example, when implementing the buffered attribute,
how precise an implementation reports the ranges that have been buffered depends on how carefully
the user agent inspects the data. Since the API reports ranges as times, but the data is obtained
in byte streams, a user agent receiving a variable-bit-rate stream might only be able to determine
precise times by actually decoding all of the data. User agents aren't required to do this,
however; they can instead return estimates (e.g. based on the average bit rate seen so far) which
get revised as more information becomes available.
As a general rule, user agents are urged to be conservative rather than optimistic. For example, it would be bad to report that everything had been buffered when it had not.
Another quality-of-implementation issue would be playing a video backwards when the codec is designed only for forward playback (e.g. there aren't many key frames, and they are far apart, and the intervening frames only have deltas from the previous frame). User agents could do a poor job, e.g. only showing key frames; however, better implementations would do more work and thus do a better job, e.g. actually decoding parts of the video forwards, storing the complete frames, and then playing the frames backwards.
Similarly, while implementations are allowed to drop buffered data at any time (there is no requirement that a user agent keep all the media data obtained for the lifetime of the media element), it is again a quality of implementation issue: user agents with sufficient resources to keep all the data around are encouraged to do so, as this allows for a better user experience. For example, if the user is watching a live stream, a user agent could allow the user only to view the live video; however, a better user agent would buffer everything and allow the user to seek through the earlier material, pause it, play it forwards and backwards, etc.
When multiple tracks are synchronised with a MediaController, it is possible for
scripts to add and remove media elements from the MediaController's list of
slaved media elements, even while these tracks are playing. How smoothly the media
plays back in such situations is another quality-of-implementation issue.
When a media element that is paused is removed from a document and not reinserted before the next time the event loop spins, implementations that are resource constrained are encouraged to take that opportunity to release all hardware resources (like video planes, networking resources, and data buffers) used by the media element. (User agents still have to keep track of the playback position and so forth, though, in case playback is later restarted.)
mapèŠçŽ name - usemap屿§ããåç
§ããã€ã¡ãŒãžãããå interface HTMLMapElement : HTMLElement {
attribute DOMString name;
readonly attribute HTMLCollection areas;
readonly attribute HTMLCollection images;
};
mapèŠçŽ ã¯ãimgèŠçŽ ããã³ä»»æã®areaèŠçŽ ã®åå«ãšé£åããŠãã€ã¡ãŒãžããããå®çŸ©ãããèŠçŽ ã¯ããã®åã衚ãã
name屿§ã¯ãããããåç
§ã§ãããããããã«ååãäžããã屿§ã¯ååšããªããã°ãªãããç©ºçœæåãªãã§é空çœã®å€ãæããªããã°ãªããªããname屿§ã®å€ã¯ãåãææžã§å¥ã®mapèŠçŽ ã®name屿§å€ãšãããããäºææ§å€§æåã»å°æåäžåºå¥ã§ãã£ãŠã¯ãªããªããid屿§ããŸãæå®ãããå Žåãäž¡æ¹ã®å±æ§ãåãå€ãæããªããã°ãªããªãã
areasmapã®areaèŠçŽ ã®HTMLCollectionãè¿ãã
imagesmapã䜿çšããimgããã³objectèŠçŽ ã®HTMLCollectionãè¿ãã
The areas attribute must return an
HTMLCollection rooted at the map element, whose filter matches only
area elements.
The images attribute must return an
HTMLCollection rooted at the Document node, whose filter matches only
img and object elements that are associated with this map
element according to the image map processing model.
The IDL attribute name must reflect
the content attribute of the same name.
ã€ã¡ãŒãžãããã¯ãã¡ã³ããã³ã¹ã容æã«ããããã«ãããŒãžäžã®ä»ã®ã³ã³ãã³ããšçµã¿åãããŠå®çŸ©ã§ããããã®äŸã¯ãããŒãžã®äžéšã«ãã€ã¡ãŒãžããããšäžéšã®ããã¹ããªã³ã¯ã®å¯Ÿå¿ããã»ããã䜿çšããããŒãžã§ããã
<!DOCTYPE HTML>
<TITLE>Babiesâ¢: Toys</TITLE>
<HEADER>
<H1>Toys</H1>
<IMG SRC="/images/menu.gif"
ALT="Babies⢠navigation menu. Select a department to go to its page."
USEMAP="#NAV">
</HEADER>
...
<FOOTER>
<MAP NAME="NAV">
<P>
<A HREF="/clothes/">Clothes</A>
<AREA ALT="Clothes" COORDS="0,0,100,50" HREF="/clothes/"> |
<A HREF="/toys/">Toys</A>
<AREA ALT="Toys" COORDS="0,0,100,50" HREF="/toys/"> |
<A HREF="/food/">Food</A>
<AREA ALT="Food" COORDS="0,0,100,50" HREF="/food/"> |
<A HREF="/books/">Books</A>
<AREA ALT="Books" COORDS="0,0,100,50" HREF="/books/">
</MAP>
</FOOTER>
areaèŠçŽ mapèŠçŽ ãŸãã¯å
ç¥templateèŠçŽ ãååšããå Žåã®ã¿ãé€ããalt - ç»åãå©çšäžå¯ã®é䜿çšãã眮æããã¹ãcoords - ã€ã¡ãŒãžãããå
ã«äœæããå³åœ¢ã®åº§æšdownload - ãªãœãŒã¹ãããã²ãŒããã代ããã«ããŠã³ããŒããããã®å ŽåãªãœãŒã¹ã®ãã¡ã€ã«åã«ãããã©ããhref â ãã€ããŒãªã³ã¯ã®ã¢ãã¬ã¹hreflang â ãªã³ã¯ããããªãœãŒã¹ã®èšèªrel â ãã€ããŒãªã³ã¯ãšå®å
ã®ãªãœãŒã¹ãå«ãææžã®é¢ä¿shape - ã€ã¡ãŒãžãããå
ã«äœæããå³åœ¢ã®çš®é¡target -ãã€ããŒãªã³ã¯ããã²ãŒã·ã§ã³ã«å¯Ÿãããã©ãŠãžã³ã°ã³ã³ããã¹ãtype â åç
§ããããªãœãŒã¹ã¿ã€ãã®ãã³ãlink ïŒããã©ã«ã - èšå®ããªãïŒãaria-*屿§ãinterface HTMLAreaElement : HTMLElement {
attribute DOMString alt;
attribute DOMString coords;
attribute DOMString shape;
attribute DOMString target;
attribute DOMString download;
attribute DOMString rel;
readonly attribute DOMTokenList relList;
attribute DOMString hreflang;
attribute DOMString type;
};
HTMLAreaElement implements URLUtils;
areaèŠçŽ ã¯ãããã¹ããšã€ã¡ãŒãžãããã§é åã«å¯Ÿå¿ããã€ãã€ããŒãªã³ã¯ããŸãã¯ã€ã¡ãŒãžãããäžã®äžæé åã®ããããã衚ãã
芪ããŒããšãšãã«areaèŠçŽ ã¯ãmapèŠçŽ ã®ç¥å
ãŸãã¯templateèŠçŽ ã®ç¥å
ãæããªããã°ãªããªãã
areaèŠçŽ ãhref屿§ãæã€å ŽåãareaèŠçŽ ã¯ãã€ããŒãªã³ã¯ã衚ãããã®å Žåãalt屿§ãååšããªããã°ãªããªãããã®å±æ§ã¯ããã€ããŒãªã³ã¯ã®ããã¹ããæå®ããã屿§å€ã¯ãã€ã¡ãŒãžãããã®ä»ã®ãã€ããŒãªã³ã¯ã«æå®ãããããã¹ãã䌎ãããã€ç»åã®ä»£æ¿ããã¹ãã䌎ãããç»åãªãã§æç€ºãããå Žåãããã¹ãã§ãªããã°ãªãããããã¹ããªãã ãç»åã«é©çšããã圢ç¶ã䌎ããããªå Žåããã€ããŒãªã³ã¯ãšããŠåãéžæã®çš®é¡ããŠãŒã¶ãŒã«æäŸããªããã°ãªããªããåããªãœãŒã¹ãæãã€ã¡ãŒãžããããšé空çœã®alt屿§ãæã€å¥ã®areaèŠçŽ ãååšããå Žåãalt屿§ã¯ç©ºçœã®ãŸãŸã§ãã£ãŠãããã
areaèŠçŽ ãhref屿§ãæããªãå Žåããã®èŠçŽ ã«ãã£ãŠè¡šãããé åãéžæã§ãããalt屿§ãçç¥ããªããã°ãªããªãã
ã©ã¡ãã®å Žåããshapeãšcoords屿§ã¯é åãæå®ããã
shape屿§ã¯ãåæå±æ§ã§ããã以äžã®è¡šã¯ããã®å±æ§ã«å¯ŸããŠå®çŸ©ãããããŒã¯ãŒããåæãããããŒã¯ãŒããšãšãã«ãã®è¡ã®æåã®ã»ã«ã«äžããããç¶æ
ã¯ããããããŒã¯ãŒãã察å¿ããç¶æ
ãäžãããSome of the keywords are non-conforming, as noted in the last column.
| ç¶æ | ããŒã¯ãŒã | 泚 |
|---|---|---|
| Circle state | circle
| |
circ
| Non-conforming | |
| Default state | default
| |
| Polygon state | poly
| |
polygon
| Non-conforming | |
| Rectangle state | rect
| |
rectangle
| Non-conforming |
屿§ã¯çç¥ããŠããããæ¬ æå€ã®ããã©ã«ãã¯ãrectangleç¶æ ã§ããã
coords屿§ãæå®ãããå ŽåãæŽæ°ã®åŠ¥åœãªãªã¹ããå«ãŸãªããã°ãªããªãããã®å±æ§ã¯ãshape屿§ã«ãã£ãŠèšè¿°ãããå³åœ¢ã®åº§æšãäžãããThe processing for this attribute is described as part of the image map processing model.
circle stateã«ãããŠãareaèŠçŽ ã¯ãæåŸã®æŽæ°ã¯éè² ã§ãªããã°ãªããªãã3ã€ã®æŽæ°ãšãšãã«ãååšããcoords屿§ãæããªããã°ãªããªããæåã®æŽæ°ã¯ç»åã®å·Šç«¯ããåã®äžå¿ãŸã§ã®CSSãã¯ã»ã«åäœè·é¢ã§ãªããã°ãªããã2çªç®ã®æŽæ°ã¯ç»åã®äžç«¯ããåã®äžå¿ãŸã§ã®CSSãã¯ã»ã«åäœè·é¢ã§ãªããã°ãªããã3çªç®ã®æŽæ°ã¯CSSãã¯ã»ã«åäœè·é¢ã§åã®ååŸã§ãªããã°ãªããªãã
default stateç¶æ
ã«ãããŠãareaèŠçŽ ã¯coords屿§ãæã£ãŠã¯ãªããªããïŒé åã¯å
šäœã®ç»åã§ãããïŒ
polygon stateã«ãããŠãareaèŠçŽ ã¯å°ãªããšã6ã€ã®æŽæ°ããã€coords屿§ãæããªããã°ãªããããã®æŽæ°ã¯å¶æ°åã§ãªããã°ãªããªããæŽæ°ã®åãã¢ã¯ãCSSãã¯ã»ã«ã§ããããç»åã®å·Šããããã³äžããã®è·é¢ãšããŠæå®ããã座æšã衚ããªããã°ãªãããé ã«ããã¹ãŠã®åº§æšã¯ããªãŽã³ã®ç¹ã衚ããªããã°ãªããªãã
rectangle stateã«ãããŠãareaèŠçŽ ã¯æ£ç¢ºã«4ã€ã®æŽæ°ããã€coords屿§ãæããªããã°ãªããªãã1çªç®ã®æŽæ°ã¯3çªç®ã®æŽæ°æªæºã§ãªããã°ãªããã2çªç®ã®æŽæ°ã¯4çªç®ã®æŽæ°æªæºã§ãªããã°ãªããªãã4ç¹ã¯ããããããã¹ãŠCSSãã¯ã»ã«ã§ãç©åœ¢ã®å·ŠåŽããç»åã®å·ŠèŸºãŸã§ã®è·é¢ãäžåŽããäžèŸºãŸã§ã®è·é¢ãå·ŠåŽãã巊蟺ãŸã§ã®è·é¢ãäžåŽããäžèŸºãŸã§ã®è·é¢ã衚ããªããã°ãªããªãã
When user agents allow users to follow hyperlinks or
download hyperlinks created using the
area element, as described in the next section, the href, target,
download, and
attributes decide how the link is followed. The rel, hreflang, and type
attributes may be used to indicate to the user the likely nature of the target resource before the
user follows the link.
href屿§ãååšããªãå Žåãtargetãhreflangãããã³type屿§ã¯çç¥ããªããã°ãªããªãã
The activation behavior of area elements is to run the following
steps:
If the area element's Document is not fully active,
then abort these steps.
If the area element has a download
attribute and the algorithm is not allowed to show a popup, or the element's target attribute is present and applying the rules
for choosing a browsing context given a browsing context name, using the value of the
target attribute as the browsing context name, would
result in there not being a chosen browsing context, then run these substeps:
If there is an entry settings object, throw an InvalidAccessError
exception.
Abort these steps without following the hyperlink.
Otherwise, the user agent must follow the
hyperlink or download the hyperlink created by
the area element, if any, and as determined by the download attribute and any expressed user
preference.
The IDL attributes alt, coords, target, download,
rel,
hreflang, and type, each must reflect the respective
content attributes of the same name.
The IDL attribute shape must
reflect the shape content attribute.
The IDL attribute relList must
reflect the rel content attribute.
The area element also supports the URLUtils interface. [URL]
When the element is created, and whenever the element's href content attribute is set, changed, or removed, the user
agent must invoke the element's URLUtils interface's set the input algorithm with the value of the href content attribute, if any, or the empty string otherwise,
as the given value.
The element's URLUtils interface's get the
base algorithm must simply return the element's base URL.
The element's URLUtils interface's query
encoding is the document's character encoding.
When the element's URLUtils interface invokes its update steps with a string value, the user
agent must set the element's href content attribute to
the string value.
ã€ã¡ãŒãžãããã¯ããã€ããŒãªã³ã¯ã«é¢é£ä»ãããããããªç»åã§å¹ŸäœåŠçãªé åãå¯èœã«ããã
imgèŠçŽ ãç»åã衚ãobjectèŠçŽ ã®åœ¢åŒã«ãããŠãç»åã¯ãimgãobjectèŠçŽ äžã§usemap屿§ãæå®ããããšã«ããïŒmapèŠçŽ ã®åœ¢åŒã§ïŒã€ã¡ãŒãžãããã«é¢é£ä»ããŠããããusemap屿§ãæå®ãããå ŽåãmapèŠçŽ ã«åŠ¥åœãªããã·ã¥åã®åç
§ã§ãªããã°ãªããªãã
次ã®ãããªç»åãèããŠã¿ããïŒ

è²ä»ãã®é åã®ã¿ãã¯ãªãã¯å¯èœã«ãããå Žåãæ¬¡ã®ããã«ããã ããïŒ
<p>
Please select a shape:
<img src="shapes.png" usemap="#shapes"
alt="Four shapes are available: a red hollow box, a green circle, a blue triangle, and a yellow four-pointed star.">
<map name="shapes">
<area shape=rect coords="50,50,100,100"> <!-- the hole in the red box -->
<area shape=rect coords="25,25,125,125" href="red.html" alt="Red box.">
<area shape=circle coords="200,75,50" href="green.html" alt="Green circle.">
<area shape=poly coords="325,25,262,125,388,125" href="blue.html" alt="Blue triangle.">
<area shape=poly coords="450,25,435,60,400,75,435,90,450,125,465,90,500,75,465,60"
href="yellow.html" alt="Yellow star.">
</map>
</p>
If an img element or an object element representing an image has a
usemap attribute specified, user agents must process it
as follows:
First, rules for parsing a hash-name reference to a map element
must be followed. This will return either an element (the map) or
null.
If that returned null, then abort these steps. The image is not associated with an image map after all.
Otherwise, the user agent must collect all the area elements that are
descendants of the map. Let those be the areas.
Having obtained the list of area elements that form the image map (the areas), interactive user agents must process the list in one of two ways.
If the user agent intends to show the text that the img element represents, then
it must use the following steps.
In user agents that do not support images, or that have images disabled,
object elements cannot represent images, and thus this section never applies (the
fallback content is shown instead). The following steps therefore only apply to
img elements.
Remove all the area elements in areas that have no href attribute.
Remove all the area elements in areas that have no alt attribute, or whose alt
attribute's value is the empty string, if there is another area element in
areas with the same value in the href attribute and with a non-empty alt attribute.
Each remaining area element in areas represents a
hyperlink. Those hyperlinks should all be made available to the user in a manner
associated with the text of the img.
In this context, user agents may represent area and img elements
with no specified alt attributes, or whose alt
attributes are the empty string or some other non-visible text, in a user-agent-defined fashion
intended to indicate the lack of suitable author-provided text.
If the user agent intends to show the image and allow interaction with the image to select
hyperlinks, then the image must be associated with a set of layered shapes, taken from the
area elements in areas, in reverse tree order (so the last
specified area element in the map is the bottom-most shape, and
the first element in the map, in tree order, is the top-most shape).
Each area element in areas must be processed as follows to
obtain a shape to layer onto the image:
Find the state that the element's shape attribute
represents.
Use the rules for parsing a list of integers to parse the element's coords attribute, if it is present, and let the result be the
coords list. If the attribute is absent, let the coords
list be the empty list.
If the number of items in the coords list is less than the minimum number
given for the area element's current state, as per the following table, then the
shape is empty; abort these steps.
| ç¶æ | Minimum number of items |
|---|---|
| Circle state | 3 |
| Default state | 0 |
| Polygon state | 6 |
| Rectangle state | 4 |
Check for excess items in the coords list as per the entry in the
following list corresponding to the shape attribute's
state:
If the shape attribute represents the rectangle state, and the first number in the list is
numerically less than the third number in the list, then swap those two numbers around.
If the shape attribute represents the rectangle state, and the second number in the list is
numerically less than the fourth number in the list, then swap those two numbers around.
If the shape attribute represents the circle state, and the third number in the list is less than
or equal to zero, then the shape is empty; abort these steps.
Now, the shape represented by the element is the one described for the entry in the list
below corresponding to the state of the shape attribute:
Let x be the first number in coords, y be the second number, and r be the third number.
The shape is a circle whose center is x CSS pixels from the left edge of the image and y CSS pixels from the top edge of the image, and whose radius is r pixels.
The shape is a rectangle that exactly covers the entire image.
Let xi be the (2i)th entry in coords, and yi be the (2i+1)th entry in coords (the first entry in coords being the one with index 0).
Let the coordinates be (xi, yi), interpreted in CSS pixels measured from the top left of the image, for all integer values of i from 0 to (N/2)-1, where N is the number of items in coords.
The shape is a polygon whose vertices are given by the coordinates, and whose interior is established using the even-odd rule. [GRAPHICS]
Let x1 be the first number in coords, y1 be the second number, x2 be the third number, and y2 be the fourth number.
The shape is a rectangle whose top-left corner is given by the coordinate (x1, y1) and whose bottom right corner is given by the coordinate (x2, y2), those coordinates being interpreted as CSS pixels from the top left corner of the image.
For historical reasons, the coordinates must be interpreted relative to the
displayed image after any stretching caused by the CSS 'width' and 'height' properties
(or, for non-CSS browsers, the image element's width and height attributes â CSS browsers map those attributes to the
aforementioned CSS properties).
Browser zoom features and transforms applied using CSS or SVG do not affect the coordinates.
Pointing device interaction with an image associated with a set of layered shapes per the above
algorithm must result in the relevant user interaction events being first fired to the top-most
shape covering the point that the pointing device indicated, if any, or to the image element
itself, if there is no shape covering that point. User agents may also allow individual
area elements representing hyperlinks to be selected
and activated (e.g. using a keyboard).
Because a map element (and its area elements) can be
associated with multiple img and object elements, it is possible for an
area element to correspond to multiple focusable areas of the document.
Image maps are live; if the DOM is mutated, then the user agent must act as if it had rerun the algorithms for image maps.
MathMLåå空éç±æ¥ã®mathèŠçŽ ã¯ããã®ä»æ§ã«ãããã³ã³ãã³ãã¢ãã«ã®æå³ã«å¯ŸããŠãšã³ããã£ããã³ã³ãã³ãããã¬ãŒãžã³ã°ã³ã³ãã³ããããã³ãããŒã³ã³ãã³ãã®ã«ããŽãªã«åé¡ãããã
User agents must handle text other than inter-element whitespace found in MathML
elements whose content models do not allow straight text by pretending for the purposes of MathML
content models, layout, and rendering that that text is actually wrapped in an mtext element in the MathML namespace. (Such text is not, however,
conforming.)
User agents must act as if any MathML element whose contents does not match the element's
content model was replaced, for the purposes of MathML layout and rendering, by an merror element in the MathML namespace containing some appropriate
error message.
To enable authors to use MathML tools that only accept MathML in its XML form, interactive HTML user agents are encouraged to provide a way to export any MathML fragment as an XML namespace-well-formed XML fragment.
MathMLã®èŠçŽ ã®ã»ãã³ãã£ãã¯ã¯ãMathML仿§ããã®ä»ã®é©çšå¯èœãªä»æ§ã§å®çŸ©ãããã[MATHML]
HTMLææžã§ã®MathMLã®äœ¿çšäŸã¯ã次ã®ãšããïŒ
<!DOCTYPE html>
<html>
<head>
<title>The quadratic formula</title>
</head>
<body>
<h1>The quadratic formula</h1>
<p>
<math>
<mi>x</mi>
<mo>=</mo>
<mfrac>
<mrow>
<mo form="prefix">â</mo> <mi>b</mi>
<mo>±</mo>
<msqrt>
<msup> <mi>b</mi> <mn>2</mn> </msup>
<mo>â</mo>
<mn>4</mn> <mo>â¢</mo> <mi>a</mi> <mo>â¢</mo> <mi>c</mi>
</msqrt>
</mrow>
<mrow>
<mn>2</mn> <mo>â¢</mo> <mi>a</mi>
</mrow>
</mfrac>
</math>
</p>
</body>
</html>
SVGåå空éç±æ¥ã®svgèŠçŽ ã¯ããã®ä»æ§ã«ãããã³ã³ãã³ãã¢ãã«ã®æå³ã«å¯ŸããŠãšã³ããã£ããã³ã³ãã³ãããã¬ãŒãžã³ã°ã³ã³ãã³ããããã³ãããŒã³ã³ãã³ãã®ã«ããŽãªã«åé¡ãããã
To enable authors to use SVG tools that only accept SVG in its XML form, interactive HTML user agents are encouraged to provide a way to export any SVG fragment as an XML namespace-well-formed XML fragment.
SVGã®foreignObjectèŠçŽ ãHTMLåå空éã®èŠçŽ ãå«ãå Žåããã®ãããªèŠçŽ ã¯ããã¹ãŠãããŒã³ã³ãã³ãã§ãªããã°ãªããªãã[SVG]
HTMLææžå
éšã®SVGåå空éã§titleèŠçŽ ã®ã³ã³ãã³ãã¢ãã«ã¯ãã¬ãŒãžã³ã°ã³ã³ãã³ãã§ãããïŒããã¯SVG仿§ã§æå®ãããèŠä»¶ãããã«å¶çŽãããïŒ
SVGã®èŠçŽ ã®ã»ãã³ãã£ãã¯ã¯ãSVG仿§ããã®ä»ã®é©çšå¯èœãªä»æ§ã§å®çŸ©ãããã[SVG]
SVG仿§ã¯ãSVGåå空éã«ãªããSVGã®æçã§ãããforeignObjectèŠçŽ ã«å«ãŸããªãDOMå
ã®èŠçŽ ã®åãæ±ãã«é¢ããèŠä»¶ãå«ãããã®ä»æ§ã¯ãHTMLåå空éã§ãªãSVGæçã§ã®èŠçŽ ã«å¯Ÿããä»»æã®åŠçãå®çŸ©ããªãããããã¯ããã®ä»æ§ã®èгç¹ããé©åã§ãäžé©åã§ããªããšèããããã
Author requirements: The width and height attributes on img,
iframe, embed, object, video, and, when their
type attribute is in the Image Button state, input elements may be
specified to give the dimensions of the visual content of the element (the width and height
respectively, relative to the nominal direction of the output medium), in CSS pixels. The
attributes, if specified, must have values that are valid
non-negative integers.
ãªãœãŒã¹ã¯CSSãã¯ã»ã«ã®è§£å床ãšã¯ç°ãªãè§£å床ãæã€ãããããªãã®ã§ãäžããããæå®æ¬¡å ã¯ããªãœãŒã¹èªäœã§æå®ãããæ¬¡å ãšç°ãªããããããªããïŒç»é¢ã§ã¯ãCSSã®ãã¯ã»ã«ã96ppiã®è§£å床ãæã€ããäžè¬ã«CSSãã¯ã»ã«è§£å床ãèªã¿åãè·é¢ã«äŸåãããïŒäž¡æ¹ã®å±æ§ãæå®ãããå Žåãæ¬¡ã®ããããã®åœé¡ãçã§ãªããã°ãªããªãïŒ
target ratioã¯ããªãœãŒã¹ã®åºæé«ããšåºæå¹
ã®æ¯çã§ãããspecified widthãšspecified heightã¯ãããããwidthãšheight屿§ã®å€ã§ããã
åé¡ã®ãªãœãŒã¹ãåºæå¹ ãšåºæé«ãã®äž¡æ¹ãæããªãå Žåã2ã€ã®å±æ§ã¯çç¥ããªããã°ãªããªãã
2ã€ã®å±æ§ããšãã«0ã§ããå ŽåãèŠçŽ ããŠãŒã¶ãŒã«æå³ãããªãïŒããšãã°ãããŒãžãã¥ãŒãã«ãŠã³ããããµãŒãã¹ã®äžéšã§ãããããããªãïŒããšã瀺ãã
次å 屿§ã¯ãç»åã䌞ã°ãããã«äœ¿çšããããšãæå³ããªãã
User agent requirements: User agents are expected to use these attributes as hints for the rendering.
The width and height IDL attributes on the iframe,
embed, object, and video elements must reflect
the respective content attributes of the same name.
For iframe, embed, and object the IDL
attributes are DOMString; for video the IDL attributes are
unsigned long.
The corresponding IDL attributes for img and
input elements are defined in those respective elements'
sections, as they are slightly more specific to those elements' other behaviors.