aboutsummaryrefslogtreecommitdiff
path: root/files/ja/nsidomhtmlmediaelement/index.html
blob: 34450a8b9bd2e8339fb79bcb8afba1468cf3c475 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
---
title: nsIDOMHTMLMediaElement
slug: NsIDOMHTMLMediaElement
---
<p></p>

<p><code>nsIDOMHTMLMediaElement</code> インターフェースは HTML 5 における <a class="internal" href="/Ja/HTML/Element/Audio" title="Ja/HTML/Element/Audio"><code>audio</code></a> および <a class="internal" href="/Ja/HTML/Element/Video" title="Ja/HTML/Element/Video"><code>video</code></a> 要素の実装に用いられています。</p>

<div class="note"><strong>注意:</strong> <code> cue ranges</code> 機能の仕様は現在流動的な状況にあり、 HTML 5 標準においては大幅に改訂が加えられるか、置き換えられてしまう可能性があります。そのため、現時点では Firefox ではこの機能に対応していません。</div>

<p></p><div style="border: solid #ddd 2px; margin-bottom: 12px;">
<div style="background: #eee; padding: 2px;"><code><a href="https://dxr.mozilla.org/mozilla-central/source/dom/public/idl/html/nsIDOMHTMLMediaElement.idl" rel="custom">dom/public/idl/html/nsIDOMHTMLMediaElement.idl</a></code><span style="text-align: right; float: right;"><a href="/ja/docs/Interfaces/About_Scriptable_Interfaces" style="color: #00cc00; font-weight: 700;">Scriptable</a></span></div>
<span style="padding: 4px 2px;">

<i>Please add a summary to this article.</i>
</span>

<div style="background: #eee; padding: 2px;">
<span> </span>
<span style="text-align: right; float: right;">最終更新: Gecko 1.9.1 (Firefox 3.5 / Thunderbird 3.0 / SeaMonkey 2.0)</span></div>
</div><p></p>

<p>Inherits from: <code><a href="/ja/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMHTMLElement" title="">nsIDOMHTMLElement</a></code></p>

<h2 id="Method_overview" name="Method_overview">メソッド概要 (Method Overview)</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <td><code>void <a class="internal" href="/Ja/NsIDOMHTMLMediaElement#addCueRange()" title="Ja/NsIDOMHTMLMediaElement#addCueRange()">addCueRange</a>(in DOMString className, in float start, in float end, in boolean pauseOnExit, in nsIDOMHTMLVoidCallback enterCallback, in nsIDOMHTMLVoidCallback exitCallback);</code></td>
  </tr>
  <tr>
   <td><code>DOMString <a class="internal" href="/Ja/NsIDOMHTMLMediaElement#canPlayType()" title="Ja/NsIDOMHTMLMediaElement#canPlayType()">canPlayType</a>(in DOMString type);</code></td>
  </tr>
  <tr>
   <td><code>void <a class="internal" href="/Ja/NsIDOMHTMLMediaElement#load()" title="Ja/NsIDOMHTMLMediaElement#load()">load</a>();</code></td>
  </tr>
  <tr>
   <td><code>void <a class="internal" href="/Ja/NsIDOMHTMLMediaElement#pause()" title="Ja/NsIDOMHTMLMediaElement#pause()">pause</a>();</code></td>
  </tr>
  <tr>
   <td><code>void <a class="internal" href="/Ja/NsIDOMHTMLMediaElement#play()" title="Ja/NsIDOMHTMLMediaElement#play()">play</a>();</code></td>
  </tr>
  <tr>
   <td><code>void <a class="internal" href="/Ja/NsIDOMHTMLMediaElement#removeCueRanges()" title="Ja/NsIDOMHTMLMediaElement#removeCueRanges()">removeCueRanges</a>(in DOMString className);</code></td>
  </tr>
 </tbody>
</table>

<h2 id="Attributes" name="Attributes">属性 (Attributes)</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <td class="header" style="text-align: center;">属性</td>
   <td class="header" style="text-align: center;"></td>
   <td class="header" style="text-align: center;">意味</td>
  </tr>
  <tr>
   <td><code>autoplay</code></td>
   <td><code>boolean</code></td>
   <td><code>true</code> if playback should automatically begin as soon as enough media is available to do so without interruption.</td>
  </tr>
  <tr>
   <td><code>buffered</code></td>
   <td><code>TimeRanges</code></td>
   <td>A static, normalized <code>TimeRanges</code> object describing the time ranges of the media that have been buffered.  <strong>Read only.</strong>  <span class="inlineIndicator unimplemented unimplementedInline">未実装</span></td>
  </tr>
  <tr>
   <td><code>bufferedBytes</code></td>
   <td><code>ByteRanges</code></td>
   <td>A static, normalized <code>ByteRanges</code> object describing the byte ranges of the media that have been buffered.  <strong>Read only.</strong>  <span class="inlineIndicator unimplemented unimplementedInline">未実装</span></td>
  </tr>
  <tr>
   <td><code>bufferingRate</code></td>
   <td><code>float</code></td>
   <td>The average number of bits per second for the current download over the past few seconds.  If there is no download in progress, this value is 0.0.  <strong>Read only.</strong>  <span class="inlineIndicator unimplemented unimplementedInline">未実装</span></td>
  </tr>
  <tr>
   <td><code>bufferingThrottled</code></td>
   <td><code>boolean</code></td>
   <td><code>true</code> if Firefox is intentionally throttling the bandwidth used by the download (such as when the download is paused), otherwise <code>false</code>. <strong>Read only.</strong>  <span class="inlineIndicator unimplemented unimplementedInline">未実装</span></td>
  </tr>
  <tr>
   <td><code>controls</code></td>
   <td><code>boolean</code></td>
   <td><code>true</code> if user interface for controlling the media should be presented.</td>
  </tr>
  <tr>
   <td><code>currentSrc</code></td>
   <td><code>DOMString</code></td>
   <td>The absolute URL of the chosen media resource (if, for example, the server selects a media file based on the resolution of the user's display), or an empty string if the <code>networkState</code> is <code>EMPTY</code>. <strong>Read only.</strong></td>
  </tr>
  <tr>
   <td><code>currentTime</code></td>
   <td><code>float</code></td>
   <td>The current playback time, in seconds.  Setting this value will seek the media to the new time.</td>
  </tr>
  <tr>
   <td><code>defaultPlaybackRate</code></td>
   <td><code>float</code></td>
   <td>The default playback rate for the media.  The Ogg backend does not support this.  1.0 is "normal speed," values lower than 1.0 make the media play slower than normal, higher values make it play faster.  The value 0.0 is invalid and throws a <code>NOT_SUPPORTED_ERR</code> exception.</td>
  </tr>
  <tr>
   <td><code>duration</code></td>
   <td><code>float</code></td>
   <td>The length of the media in seconds, or zero if no media data is available.  If the media data is available but the length is unknown, this value is <code>NaN</code>.  If the media is streamed and has no predefined length, the value is <code>Inf</code><strong>Read only.</strong></td>
  </tr>
  <tr>
   <td><code>ended</code></td>
   <td><code>boolean</code></td>
   <td><code>true</code> if playback has finished.  <strong>Read only.</strong></td>
  </tr>
  <tr>
   <td><code>error</code></td>
   <td><code><code><a href="/ja/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMHTMLMediaError" title="">nsIDOMHTMLMediaError</a></code></code></td>
   <td>The media's error status.  <strong>Read only.</strong></td>
  </tr>
  <tr>
   <td><code>muted</code></td>
   <td><code>boolean</code></td>
   <td><code>true</code> if the audio is muted, otherwise <code>false</code>.</td>
  </tr>
  <tr>
   <td><code>networkState</code></td>
   <td><code>unsigned short</code></td>
   <td>
    <p>The current state of the fetch of the media. <strong>Read only.</strong></p>

    <table class="standard-table">
     <tbody>
      <tr>
       <td class="header" style="text-align: center;">定数</td>
       <td class="header" style="text-align: center;"></td>
       <td class="header" style="text-align: center;">意味</td>
      </tr>
      <tr>
       <td><code>EMPTY</code></td>
       <td>0</td>
       <td>There is no data yet.  The <code>readyState</code> will also be <code>HAVE_NOTHING</code>.</td>
      </tr>
      <tr>
       <td><code>LOADING</code></td>
       <td>1</td>
       <td>The media is loading.</td>
      </tr>
      <tr>
       <td><code>LOADED_METADATA</code></td>
       <td>2</td>
       <td>The media's metadata has been loaded.</td>
      </tr>
      <tr>
       <td><code>LOADED_FIRST_FRAME</code></td>
       <td>3</td>
       <td>The media's first frame has been loaded.</td>
      </tr>
      <tr>
       <td><code>LOADED</code></td>
       <td>4</td>
       <td>The media has been fully loaded.</td>
      </tr>
     </tbody>
    </table>
   </td>
  </tr>
  <tr>
   <td><code>paused</code></td>
   <td><code>boolean</code></td>
   <td><code>true</code> if the media playback is currently paused.  <strong>Read only.</strong></td>
  </tr>
  <tr>
   <td><code>playbackRate</code></td>
   <td><code>float</code></td>
   <td>The current rate at which the media is being played back.  This is used to implement user controls for fast forward, slow motion, and so forth.  The normal playback rate is multiplied by this value to obtain the current rate, so a value of 1.0 indicates normal speed.  Not supported by the Ogg backend.</td>
  </tr>
  <tr>
   <td><code>readyState</code></td>
   <td><code>unsigned short</code></td>
   <td>
    <p>The media's current readiness state.  <strong>Read only.</strong></p>

    <table class="standard-table">
     <tbody>
      <tr>
       <td class="header" style="text-align: center;">定数</td>
       <td class="header" style="text-align: center;"></td>
       <td class="header" style="text-align: center;">意味</td>
      </tr>
      <tr>
       <td><code>HAVE_NOTHING</code></td>
       <td>0</td>
       <td>No information is available about the media resource.</td>
      </tr>
      <tr>
       <td><code>HAVE_METADATA</code></td>
       <td>1</td>
       <td>Enough of the media resource has been retrieved that the metadata attributes are initialized.  Seeking will no longer raise an exception.</td>
      </tr>
      <tr>
       <td><code>HAVE_SOME_DATA</code></td>
       <td>2</td>
       <td>Data for the current playback position is not available, but there is at least one playback position for which data is available.</td>
      </tr>
      <tr>
       <td><code>HAVE_CURRENT_DATA</code></td>
       <td>3</td>
       <td>Data is available for the current playback position, but not enough to actually play more than one frame.</td>
      </tr>
      <tr>
       <td><code>HAVE_FUTURE_DATA</code></td>
       <td>4</td>
       <td>Data for the current playback position as well as for at least a little bit of time into the future is available (in other words, at least two frames of video, for example).</td>
      </tr>
      <tr>
       <td><code>HAVE_ENOUGH_DATA</code></td>
       <td>5</td>
       <td>Enough data is available—and the download rate is high enough—that the media can be played through to the end without interruption.</td>
      </tr>
     </tbody>
    </table>
   </td>
  </tr>
  <tr>
   <td><code>seeking</code></td>
   <td><code>boolean</code></td>
   <td><code>true</code> if the media is in the process of seeking to a new position, otherwise <code>false</code>.<strong> Read only.</strong></td>
  </tr>
  <tr>
   <td><code>src</code></td>
   <td><code>DOMString</code></td>
   <td>The URL of the media to present.</td>
  </tr>
  <tr>
   <td><code>totalBytes</code></td>
   <td><code>unsigned long</code></td>
   <td>The length, in bytes, of the media resource.  If the length is unknown, or the content is streamed and therefore has no specified length, this value is 0.  <strong>Read only.</strong></td>
  </tr>
  <tr>
   <td><code>volume</code></td>
   <td><code>float</code></td>
   <td>The current audio volume, from 0.0 (silent) to 1.0 (maximum).</td>
  </tr>
 </tbody>
</table>

<h2 id="メソッド_(Methods)">メソッド (Methods)</h2>

<h3 id="addCueRange()">addCueRange()</h3>

<div class="note"><strong>Note:</strong> This method is not yet implemented, as its definition is in flux in the HTML 5 standard.</div>

<p>Adds a cue range to the media element.</p>

<pre>void addCueRange(
  in DOMString className,
  in float start,
  in float end,
  in boolean pauseOnExit,
  in nsIDOMHTMLVoidCallback enterCallback,
  in nsIDOMHTMLVoidCallback exitCallback
);
</pre>

<h6 id="Parameters">Parameters</h6>

<p>xxx</p>

<h3 id="eatCookie.28.29" name="eatCookie.28.29">canPlayType()</h3>

<p>Determines whether or not the specified media type can be played back.</p>

<pre class="eval">DOMString canPlayType(
  in DOMString type
);</pre>

<h6 id="Parameters_4">Parameters</h6>

<dl>
 <dt>type</dt>
 <dd>The media type to test for, such as "video/ogg".</dd>
</dl>

<h6 id="Return_value">Return value</h6>

<ul>
 <li>"" if the specified type definitely cannot be played. (was "no" until Gecko 1.9.1.1/ Firefox 3.5.1)</li>
 <li>"probably" if the specified type appears to be playable.</li>
 <li>"maybe" if it's impossible to be sure if the type can be played without actually attempting to do so.</li>
</ul>

<p>Because media formats are complicated, and it's impossible to judge every possible detail from the type string, there is no such thing as 100% certain that the specified type can be played; the best you can do is "probably".</p>

<h3 id="eatCookie.28.29" name="eatCookie.28.29">load()</h3>

<p>Begins loading the media content from the server.</p>

<pre class="eval"> void load();</pre>

<h6 id="Parameters_5">Parameters</h6>

<p>None.</p>

<h3 id="getFunnySaying.28.29" name="getFunnySaying.28.29">pause()</h3>

<p>Pauses the media playback.</p>

<pre class="eval"> void pause();
</pre>

<h6 id="Parameters_2" name="Parameters_2">Parameters</h6>

<p>None.</p>

<h3 id="sayYummy.28.29" name="sayYummy.28.29">play()</h3>

<p>Begins playback of the media.</p>

<pre class="eval"> void play();
</pre>

<h6 id="Parameters_3" name="Parameters_3">Parameters</h6>

<p>None.</p>

<h3 id="removeCueRanges()">removeCueRanges()</h3>

<div class="note"><strong>Note:</strong> This function is not yet implemented, as its definition in the HTML 5 standard is in flux.</div>

<pre>void removeCueRanges(
  in DOMString className
);
</pre>

<h6 id="Parameters_6">Parameters</h6>

<p>xxx</p>

<h2 id="See_also" name="See_also">参考資料</h2>

<ul>
 <li><code><a class="internal" href="/Ja/HTML/Element/Video" title="Ja/HTML/Element/Video">video</a></code></li>
 <li><a class="internal" href="/Ja/HTML/Element/Audio" title="Ja/HTML/Element/Audio"><code>audio</code></a></li>
 <li><a class="internal" href="/Ja/HTML/Element/Source" title="Ja/HTML/Element/Source"><code>source</code></a></li>
 <li><a class="internal" href="/Ja/Using_audio_and_video_in_Firefox" title="Ja/Using audio and video in Firefox">Using audio and video in Firefox</a></li>
</ul>