Max sessions

Max sessions limits the maximum number of playback sessions an account can stream at the same time. For example, the number of max sessions for the account is three, a user can play content on three devices at the same time. The user cannot start a session on a fourth device while the three sessions are active.

Max sessions does not apply to radio content.

Information

Max sessions is only supported by Flussonic and has not been tested in cluster mode.

To prevent unexpected behaviour, we recommend disabling any streaming limitations enabled on Flussonic, for example, Flussonic Soft Limitation.

Playback status

To check if a user can start a new playback session, the device requests a link from the MinistraPRO backend. The system then checks the playback status of each device associated with the account.

The status of a device can be one of the following:

  • Active: A session is active on the device.

  • Ended: The session was ended by the customer, for example, the user closes the player or turns off the device.

  • Killed: The session was stopped by the backend because the maximum number of sessions for the account was reached.

The following table explains the backend actions when a user requests a new playback session.

Active session on device

Max sessions reached

Backend actions

No

No

The request is approved and the link is supplied.

No

Yes

The request is denied and the link is not supplied.

Yes

Not applicable

The request is always approved while the session is active.

Playback sessions

A playback session is active when a stream from the Flussonic server is read by the system and the content is playing on a device.

When an active playback session ends, another device can begin a new session. The new playback session is allocated to the next user that requests content.

If a user tries to start a new playback session after the maximum number of sessions is reached, the session is killed and the user sees a You have reached the maximum number of playback sessions message. If the streaming ends for another reason, the user sees the general playback error message.

For more information about streaming requests to the Flussonic server, refer to https://flussonic.com/doc/authorize-with-securelink/

Playback session commands

The backend runs a command to sync existing playback sessions between the backend and the streaming server. The command usually runs every minute and updates the status, duration, and update date of the playback sessions.

You can manage playback sessions using the following commands:

  • php admin/bin/console mtv:playback-session:sync [--batch-size=100] [--streamer-ids=1--streamer-ids=2]: Syncs the status of the playback session with the streaming server. We recommend you run this command every minute.

    Information

    Do not use this command if you are using Flussonic webhooks

    Learn more: Webhooks

  • php admin/bin/console mtv:playback-session:kill [--streamer-ids=1 --streamer-ids=2]: Kills playback sessions on the streaming server. We recommend you run this command every five minutes.

  • php admin/bin/console mtv:playback-session:clear [--timeout=120]: Clears old playback sessions from the database. We recommend you run this command every day.

Information

To keep the MySQL table healthy, we recommend removing playback sessions that are inactive for more than two minutes.

Playback session limits

Playback session limits are configured in the playback_session.ini configuration file.

To enable max sessions, you must set playback_session_enabled to true.

Learn more: Enabling max sessions

Learn more: playback_session.ini

Webhooks

You can update playback status using a Flussonic webhook.

  • For example, {backend host}/webhook/playback-session/flussonic/{streamer host}

    • where {streamer host} is a host from the admin panel, for example, streamer.example.com or 10.110.51.31:8080.

      The minimal configuration on Flussonic is event types play_closed and play_update.