Link Search Menu Expand Document

danog\MadelineProto\MultiCall

Back to index

Author: Daniil Gentili daniil@daniil.it

Common interface for the multi-party call types — {@see GroupCall} (video chats, livestreams) and

{@see \danog\MadelineProto\Tgcalls\E2E\ConferenceCall} (end-to-end encrypted conference calls) — on top of the media surface every call shares ({@see Call}).

It covers what a call with more than two participants adds over a one-to-one {@see VoIP} call: leaving without ending it for everyone else, and enumerating who is in it. Type-specific operations (a group call’s {@see GroupCall::invite()} / per-participant recording, a conference’s verification emojis / encrypted messages / participant removal) live on the concrete classes.

Method list:

Methods:

leave(): static

Leave the call, keeping it running for the other participants (unlike {@see Call::discard()}, which ends it).

getParticipants(): array<int, mixed>

The participants currently known to be in the call, keyed by their id. The element type is call-type specific (a {@see GroupCall\Participant} for a group call, chain state for a
conference), so the concrete class documents it.

play(\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream $file, \danog\MadelineProto\MediaDestination $dest = \danog\MadelineProto\MediaDestination::Camera): static

Play a file, transmitting its audio and, if it carries a transmittable one, its video.

A WebM/Matroska file with VP8, VP9, H.264 or AV1 video has its video transmitted too; any other
file (or a raw audio stream) is played as audio only. Frames are demuxed in pure PHP and sent
as-is where possible, so no transcoding (and thus no FFI extension) is required for pre-encoded
WebM/OGG-OPUS input. $dest selects the camera or the presentation (screencast) stream.

Parameters:

  • $file: \danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream
  • $dest: \danog\MadelineProto\MediaDestination

See also:

then(\danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream $file, \danog\MadelineProto\MediaDestination $dest = \danog\MadelineProto\MediaDestination::Camera): static

Add a file to the playlist, to be played once the current one finishes.

Parameters:

  • $file: \danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream
  • $dest: \danog\MadelineProto\MediaDestination

See also:

playOnHold(\danog\MadelineProto\MediaDestination $dest = \danog\MadelineProto\MediaDestination::Camera, \danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream ...$files): static

Set the files to play, on loop, while the given stream’s main playlist is empty.

Parameters:

  • $dest: \danog\MadelineProto\MediaDestination
  • ...$files: \danog\MadelineProto\LocalFile|\danog\MadelineProto\RemoteUrl|\Amp\ByteStream\ReadableStream

See also:

skip(\danog\MadelineProto\MediaDestination $dest = \danog\MadelineProto\MediaDestination::Camera): static

Skip to the next file in the playlist.

Parameters:

  • $dest: \danog\MadelineProto\MediaDestination

See also:

stop(\danog\MadelineProto\MediaDestination $dest = \danog\MadelineProto\MediaDestination::Camera): static

Stop playing all files, clearing the main and the hold playlist.

Parameters:

  • $dest: \danog\MadelineProto\MediaDestination

See also:

pause(\danog\MadelineProto\MediaDestination $dest = \danog\MadelineProto\MediaDestination::Camera): static

Pause playback of the current file.

Parameters:

  • $dest: \danog\MadelineProto\MediaDestination

See also:

isPaused(\danog\MadelineProto\MediaDestination $dest = \danog\MadelineProto\MediaDestination::Camera): bool

Whether playback of the current file is paused.

Parameters:

  • $dest: \danog\MadelineProto\MediaDestination

See also:

resume(\danog\MadelineProto\MediaDestination $dest = \danog\MadelineProto\MediaDestination::Camera): static

Resume playback of the current file.

Parameters:

  • $dest: \danog\MadelineProto\MediaDestination

See also:

getCurrent(\danog\MadelineProto\MediaDestination $dest = \danog\MadelineProto\MediaDestination::Camera): \danog\MadelineProto\RemoteUrl|\danog\MadelineProto\LocalFile|string|null

The file or stream currently being played, if any.

Parameters:

  • $dest: \danog\MadelineProto\MediaDestination

See also:

setMuted(bool $muted = true): static

Mute or unmute our own outgoing audio.

Parameters:

  • $muted: bool

isMuted(): bool

Whether our own outgoing audio is muted.

discard(): static

Discard (hang up / leave) the call.


Generated by danog/phpdoc