yanchengPowerSupply/node_modules/videojs-contrib-media-sources/docs/api/global.html

2671 lines
28 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Global</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Global</h1>
<section>
<header>
<h2></h2>
</header>
<article>
<div class="container-overview">
<dl class="details">
</dl>
</div>
<h3 class="subsection-title">Members</h3>
<h4 class="name" id="gopsSafeToAlignWith"><span class="type-signature">(constant) </span>gopsSafeToAlignWith<span class="type-signature"></span></h4>
<div class="description">
Returns a list of gops in the buffer that have a pts value of 3 seconds or more in
front of current time.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="virtual-source-buffer.js.html">virtual-source-buffer.js</a>, <a href="virtual-source-buffer.js.html#line50">line 50</a>
</li></ul></dd>
</dl>
<h4 class="name" id="MediaSource"><span class="type-signature">(constant) </span>MediaSource<span class="type-signature"></span></h4>
<div class="description">
An emulation of the MediaSource API so that we can support
native and non-native functionality such as flash and
video/mp2t videos. returns an instance of HtmlMediaSource or
FlashMediaSource depending on what is supported and what options
are passed in.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="videojs-contrib-media-sources.js.html">videojs-contrib-media-sources.js</a>, <a href="videojs-contrib-media-sources.js.html#line67">line 67</a>
</li></ul></dd>
</dl>
<h4 class="name" id="removeGopBuffer"><span class="type-signature">(constant) </span>removeGopBuffer<span class="type-signature"></span></h4>
<div class="description">
Removes gop information in buffer that overlaps with provided start and end
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="virtual-source-buffer.js.html">virtual-source-buffer.js</a>, <a href="virtual-source-buffer.js.html#line121">line 121</a>
</li></ul></dd>
</dl>
<h4 class="name" id="updateGopBuffer"><span class="type-signature">(constant) </span>updateGopBuffer<span class="type-signature"></span></h4>
<div class="description">
Appends gop information (timing and byteLength) received by the transmuxer for the
gops appended in the last call to appendBuffer
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="virtual-source-buffer.js.html">virtual-source-buffer.js</a>, <a href="virtual-source-buffer.js.html#line83">line 83</a>
</li></ul></dd>
</dl>
<h4 class="name" id="URL"><span class="type-signature">(constant) </span>URL<span class="type-signature"></span></h4>
<div class="description">
A wrapper around the native URL for our MSE object
implementation, this object is exposed under videojs.URL
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="videojs-contrib-media-sources.js.html">videojs-contrib-media-sources.js</a>, <a href="videojs-contrib-media-sources.js.html#line95">line 95</a>
</li></ul></dd>
</dl>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="abort"><span class="type-signature"></span>abort<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Reset the parser and remove any data queued to be sent to the SWF.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="flash-source-buffer.js.html">flash-source-buffer.js</a>, <a href="flash-source-buffer.js.html#line236">line 236</a>
</li></ul></dd>
</dl>
<h4 class="name" id="abort"><span class="type-signature"></span>abort<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Emulate the native mediasource function. abort any soureBuffer
actions and throw out any un-appended data.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="virtual-source-buffer.js.html">virtual-source-buffer.js</a>, <a href="virtual-source-buffer.js.html#line742">line 742</a>
</li></ul></dd>
</dl>
<h4 class="name" id="addSourceBuffer"><span class="type-signature"></span>addSourceBuffer<span class="signature">(type)</span><span class="type-signature"> &rarr; {Object}</span></h4>
<div class="description">
Add a source buffer to the media source.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">the content-type of the content</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="html-media-source.js.html">html-media-source.js</a>, <a href="html-media-source.js.html#line287">line 287</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
the created source buffer
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id="addSourceBuffer"><span class="type-signature"></span>addSourceBuffer<span class="signature">(type)</span><span class="type-signature"> &rarr; {Object}</span></h4>
<div class="description">
Create a new flash source buffer and add it to our flash media source.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">the content-type of the source</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="flash-media-source.js.html">flash-media-source.js</a>, <a href="flash-media-source.js.html#line63">line 63</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
the flash source buffer
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Object</span>
</dd>
</dl>
<h4 class="name" id="appendBuffer"><span class="type-signature"></span>appendBuffer<span class="signature">(bytes)</span><span class="type-signature"></span></h4>
<div class="description">
Append bytes to the sourcebuffers buffer, in this case we
have to append it to swf object.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>bytes</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="description last"></td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="flash-source-buffer.js.html">flash-source-buffer.js</a>, <a href="flash-source-buffer.js.html#line208">line 208</a>
</li></ul></dd>
</dl>
<h4 class="name" id="appendBuffer"><span class="type-signature"></span>appendBuffer<span class="signature">(segment)</span><span class="type-signature"></span></h4>
<div class="description">
Emulate the native mediasource function, but our function will
send all of the proposed segments to the transmuxer so that we
can transmux them before we append them to our internal
native source buffers in the correct format.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>segment</code></td>
<td class="type">
<span class="param-type">Uint8Array</span>
</td>
<td class="description last">the segment to append to the buffer</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="virtual-source-buffer.js.html">virtual-source-buffer.js</a>, <a href="virtual-source-buffer.js.html#line503">line 503</a>
</li></ul></dd>
</dl>
<h4 class="name" id="appendGopInfo_"><span class="type-signature"></span>appendGopInfo_<span class="signature">(event)</span><span class="type-signature"></span></h4>
<div class="description">
Appends gop information (timing and byteLength) received by the transmuxer for the
gops appended in the last call to appendBuffer
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>event</code></td>
<td class="type">
<span class="param-type">Event</span>
</td>
<td class="description last">The gopInfo event from the transmuxer
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>data.gopInfo</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="description last">List of gop info to append</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="virtual-source-buffer.js.html">virtual-source-buffer.js</a>, <a href="virtual-source-buffer.js.html#line550">line 550</a>
</li></ul></dd>
</dl>
<h4 class="name" id="endOfStream"><span class="type-signature"></span>endOfStream<span class="signature">(error<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
Signals the end of the stream.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>error</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">Signals that a playback error
has occurred. If specified, it must be either "network" or
"decode".</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="flash-media-source.js.html">flash-media-source.js</a>, <a href="flash-media-source.js.html#line87">line 87</a>
</li></ul></dd>
</dl>
<h4 class="name" id="FlashTransmuxerWorker"><span class="type-signature"></span>FlashTransmuxerWorker<span class="signature">(self)</span><span class="type-signature"></span></h4>
<div class="description">
Our web wroker interface so that things can talk to mux.js
that will be running in a web worker. The scope is passed to this by
webworkify.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>self</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">the scope for the web worker</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="flash-transmuxer-worker.js.html">flash-transmuxer-worker.js</a>, <a href="flash-transmuxer-worker.js.html#line93">line 93</a>
</li></ul></dd>
</dl>
<h4 class="name" id="get"><span class="type-signature"></span>get<span class="signature">()</span><span class="type-signature"> &rarr; {Double}</span></h4>
<div class="description">
Return the presentation duration.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="flash-media-source.js.html">flash-media-source.js</a>, <a href="flash-media-source.js.html#line118">line 118</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
the duration of the media in seconds
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Double</span>
</dd>
</dl>
<h4 class="name" id="open"><span class="type-signature"></span>open<span class="signature">(msObjectURL, swfId)</span><span class="type-signature"></span></h4>
<div class="description">
Provide a method for a swf object to notify JS that a
media source is now open.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>msObjectURL</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">string referencing the MSE Object URL</td>
</tr>
<tr>
<td class="name"><code>swfId</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">the swf id</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="videojs-contrib-media-sources.js.html">videojs-contrib-media-sources.js</a>, <a href="videojs-contrib-media-sources.js.html#line36">line 36</a>
</li></ul></dd>
</dl>
<h4 class="name" id="remove"><span class="type-signature"></span>remove<span class="signature">(start, end)</span><span class="type-signature"></span></h4>
<div class="description">
Emulate the native mediasource function and remove parts
of the buffer from any of our internal buffers that exist
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>start</code></td>
<td class="type">
<span class="param-type">Double</span>
</td>
<td class="description last">position to start the remove at</td>
</tr>
<tr>
<td class="name"><code>end</code></td>
<td class="type">
<span class="param-type">Double</span>
</td>
<td class="description last">position to end the remove at</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="virtual-source-buffer.js.html">virtual-source-buffer.js</a>, <a href="virtual-source-buffer.js.html#line564">line 564</a>
</li></ul></dd>
</dl>
<h4 class="name" id="remove"><span class="type-signature"></span>remove<span class="signature">(start, end)</span><span class="type-signature"></span></h4>
<div class="description">
Flash cannot remove ranges already buffered in the NetStream
but seeking clears the buffer entirely. For most purposes,
having this operation act as a no-op is acceptable.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>start</code></td>
<td class="type">
<span class="param-type">Double</span>
</td>
<td class="description last">start of the section to remove</td>
</tr>
<tr>
<td class="name"><code>end</code></td>
<td class="type">
<span class="param-type">Double</span>
</td>
<td class="description last">end of the section to remove</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="flash-source-buffer.js.html">flash-source-buffer.js</a>, <a href="flash-source-buffer.js.html#line257">line 257</a>
</li></ul></dd>
</dl>
<h4 class="name" id="set"><span class="type-signature"></span>set<span class="signature">(value)</span><span class="type-signature"> &rarr; {Double}</span></h4>
<div class="description">
Set the presentation duration.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>value</code></td>
<td class="type">
<span class="param-type">Double</span>
</td>
<td class="description last">the duration of the media in seconds</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="flash-media-source.js.html">flash-media-source.js</a>, <a href="flash-media-source.js.html#line132">line 132</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
the duration of the media in seconds
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Double</span>
</dd>
</dl>
<h4 class="name" id="supportsNativeMediaSources"><span class="type-signature"></span>supportsNativeMediaSources<span class="signature">()</span><span class="type-signature"> &rarr; {Boolean}</span></h4>
<div class="description">
Check to see if the native MediaSource object exists and supports
an MP4 container with both H.264 video and AAC-LC audio.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="videojs-contrib-media-sources.js.html">videojs-contrib-media-sources.js</a>, <a href="videojs-contrib-media-sources.js.html#line52">line 52</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
if native media sources are supported
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
<h4 class="name" id="TransmuxerWorker"><span class="type-signature"></span>TransmuxerWorker<span class="signature">(self)</span><span class="type-signature"></span></h4>
<div class="description">
Our web wroker interface so that things can talk to mux.js
that will be running in a web worker. the scope is passed to this by
webworkify.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>self</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">the scope for the web worker</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="transmuxer-worker.js.html">transmuxer-worker.js</a>, <a href="transmuxer-worker.js.html#line159">line 159</a>
</li></ul></dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="FlashMediaSource.html">FlashMediaSource</a></li><li><a href="FlashSourceBuffer.html">FlashSourceBuffer</a></li><li><a href="HtmlMediaSource.html">HtmlMediaSource</a></li><li><a href="MessageHandlers.html">MessageHandlers</a></li><li><a href="VirtualSourceBuffer.html">VirtualSourceBuffer</a></li></ul><h3>Global</h3><ul><li><a href="global.html#abort">abort</a></li><li><a href="global.html#addSourceBuffer">addSourceBuffer</a></li><li><a href="global.html#appendBuffer">appendBuffer</a></li><li><a href="global.html#appendGopInfo_">appendGopInfo_</a></li><li><a href="global.html#endOfStream">endOfStream</a></li><li><a href="global.html#FlashTransmuxerWorker">FlashTransmuxerWorker</a></li><li><a href="global.html#get">get</a></li><li><a href="global.html#gopsSafeToAlignWith">gopsSafeToAlignWith</a></li><li><a href="global.html#MediaSource">MediaSource</a></li><li><a href="global.html#open">open</a></li><li><a href="global.html#remove">remove</a></li><li><a href="global.html#removeGopBuffer">removeGopBuffer</a></li><li><a href="global.html#set">set</a></li><li><a href="global.html#supportsNativeMediaSources">supportsNativeMediaSources</a></li><li><a href="global.html#TransmuxerWorker">TransmuxerWorker</a></li><li><a href="global.html#updateGopBuffer">updateGopBuffer</a></li><li><a href="global.html#URL">URL</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.4</a> on Thu Nov 02 2017 12:03:25 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>