Playback control

Updated: May 06, 2022

After you've defined the input and outputs for a context, you can send it playback commands.

The mmr_play() and mmr_stop() functions start and stop playback. These functions bascially start and stop the media flow from the context's input to its outputs. You can adjust the playback speed, including setting a speed of 0 to pause playback, with mmr_speed_set().

You change the playback position with mmr_seek(). With playlists, you can call mmr_list_change() to switch to another playlist while continuing to play the current track.

For some stream inputs, certain operations may not be available or may behave differently than when playing a media file. For HLS realtime broadcasts, the seek operation is disabled; any seek command fails. The pause operation (i.e., a play speed of 0) is supported but the playback may jump forward when resumed because the current stream may have become unavailable. For HLS Video on Demand, the seek operation places the play position at the start of the video chunk that is closest to the requested time.