Constructor
# new Source(uri, optsnullable)
`Source` class constructor
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
uri |
String | ||||||||||||||||||||||||||
opts |
Object |
<nullable> |
Properties
|
Extends
- nanoresource
Members
# pathname :String
The absolute path name of the source uri.
Type:
- String
Methods
# (static) from(uri, optsnullable) → {Source}
Creates a new `Source` instance from input where input
may be another source in which the state is copied into
a new instance. Input may be a `Track` instance in which
the same applies to the `Source` instance the track points
to.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
uri |
String | Source | Track | Object | ||
opts |
Object |
<nullable> |
Returns:
- Type
- Source
# (protected) _close(callback)
Implements the abstract `_close()` method for `nanoresource`
Closes the source stream and resets internal state.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
# (protected) _open(callback)
Implements the abstract `_open()` method for `nanoresource`
Opens the source stream and initializes internal state.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
# createReadStream(optsnullable) → {Stream}
Creates a read stream for the source URI.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
opts |
Object |
<nullable> |
Returns:
- Type
- Stream
# (async) faststart() → {Buffer}
Create a faststart buffer from the Source
Returns:
- Type
- Buffer
# (async) isFaststart() → {Boolean}
Answers the age-old question: is my MPEG-4 container faststarted?
Returns:
- Type
- Boolean
# probe(optsnullable, callback)
Queries for properties about the source stream.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
opts |
Object |
<nullable> |
|
callback |
function |
# ready(callback)
Wait for source to be ready (opened) calling `callback()`
when it is.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
# stat(callback)
An alias for `probe()`.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
# (async) toBuffer() → {Buffer}
Create a buffer from the Source
Returns:
- Type
- Buffer