Membrane Core v0.1.0 Membrane.Mixins.Playback behaviour View Source

Behaviour for modules that have playback state, i.e. elements and pipelines

There are three playback states: :stopped, :prepared and :playing. Playback state always changes only one step at once in this order, and can be handled by handle_prepare/2, handle_play/1 and handle_stop/1 callbacks

Link to this section Summary

Link to this section Types

Link to this type state_t() View Source
state_t() :: :stopped | :prepared | :playing
Link to this type t() View Source
t() :: %Membrane.Mixins.Playback{
  async_state_change: boolean(),
  pending_state: state_t() | nil,
  state: state_t(),
  target_locked?: boolean(),
  target_state: state_t()
}

Link to this section Functions

Link to this function next_state(current, target) View Source

Link to this section Callbacks

Link to this callback change_playback_state(pid, atom) View Source
change_playback_state(pid(), atom()) :: :ok | {:error, any()}
Link to this callback handle_playback_state(atom, atom, any) View Source
handle_playback_state(atom(), atom(), any()) ::
  {:ok, any()} | {:error, any()}
Link to this callback handle_playback_state_changed(atom, atom, any) View Source (optional)
handle_playback_state_changed(atom(), atom(), any()) ::
  {:ok, any()} | {:error, any()}
Link to this callback playback_warn_error(arg0, any, any) View Source (optional)
playback_warn_error(String.t(), any(), any()) :: {:error, any()}