# `Membrane.File.Source`
[🔗](https://github.com/membraneframework/membrane_file_plugin/blob/v0.17.5/lib/membrane_file/source.ex#L1)

Element that reads chunks of data from given file and sends them as buffers
through the output pad.
May also read from standard input by setting location to :stdin.

Can work in two modes, determined by the `seekable?` option.
Seekable mode is not supported when reading from standard input.

## Element options

Passed via struct `t:Membrane.File.Source.t/0`

- `location`  

  ```
  Path.t() | :stdin
  ```
  
  ***Required***  
  Path to the file or :stdin

- `chunk_size`  

  ```
  pos_integer()
  ```
  
  Default value: `2048`  
  Size of chunks being read

- `seekable?`  

  ```
  boolean()
  ```
  
  Default value: `false`  
  With `seekable?: false`, the source will start reading data from the file exactly the moment it starts
  playing and will read it till the end of file, setting the `end_of_stream` action on the `:output` pad
  when the reading is done.
  With `seekable?: true`, the process of reading is driven by receiving `Membrane.File.SeekSourceEvent` events.
  The source working in `seekable?: true` mode won't send any data before that event is received.
  For more information about how to steer reading in `seekable?: true` mode, see: `Membrane.File.SeekSourceEvent`.

- `content_format`  

  ```
  module() | nil
  ```
  
  Default value: `nil`  
  Value from this option will be inserted into the `:content_format` field of emitted `Membrane.RemoteStream` 
  stream format.

## Pads

### `:output`

Accepted formats:
```
%RemoteStream{type: :bytestream}
```

Direction: | `:output`
Availability: | `:always`
Flow control: | `:manual`
Demand unit: | `nil`

# `t`

```elixir
@type t() :: %Membrane.File.Source{
  chunk_size: pos_integer(),
  content_format: module() | nil,
  location: Path.t() | :stdin,
  seekable?: boolean()
}
```

Struct containing options for `Membrane.File.Source`

# `options`

```elixir
@spec options() :: keyword()
```

Returns description of options available for this module

---

*Consult [api-reference.md](api-reference.md) for complete listing*
