play_restart

The play_restart directive allows the restarting of video playback from the beginning for viewers when certain conditions are met during a stream.

Syntaxplay_restart on | off;
Defaultoff
Context
Arguments1

Description

The 'play_restart' directive in the NGINX RTMP module is an essential feature designed to enhance user experience during live streaming sessions. It governs whether a stream will automatically restart from the beginning when playback is interrupted, such as when a viewer's connection drops or the stream encounters errors. When enabled, this directive provides a seamless experience by resuming playback from the start rather than forcing users to manually recommence watching, which is particularly valuable during live events or broadcasts.

This directive can be particularly beneficial in situations where consistency and user retention are critical. For instance, during a live sporting event, if a user's connection drops and the stream has the play_restart functionality enabled, they will rejoin the stream without missing the initial action. However, it is also essential for administrators to consider that this directive could lead to unwanted behavior if users inadvertently restart streams during critical moments, which may frustrate viewers wishing to resume from their last point of view.

In terms of configuration, the play_restart directive primarily takes a boolean argument, allowing administrators to toggle its functionality. The implementation of play_restart might vary depending on other directives or the particular context of the stream being served. Therefore, understanding how play_restart interacts with other configurations in the RTMP module is crucial for optimal setup and user experience.

Config Example

application myapp {
    live on;
    play_restart on;
}

Ensure the directive is used in conjunction with the correct application context.

Enabling play_restart may inadvertently frustrate users during critical streaming events.

Not all streaming clients may support automatic playback restart, leading to inconsistent user experiences.

← Back to all directives