MebiusPlayer class
Plays a live stream from the Mebius gateway.
Obtain a player from MebiusClient.createPlayer. Render its video by
passing this instance to a MebiusView.
final player = client.createPlayer(); // mode defaults to auto
player.events.listen((event) {
if (event.type == MebiusPlayerEventType.playing) {
// Video is rendering.
}
});
await player.play('my-stream', viewTarget);
Constructors
-
MebiusPlayer.internal({required GatewaySignaling signaling, required MebiusPlayerMode mode, List<
MebiusDelivery> deliveries = const <MebiusDelivery>[], @visibleForTesting PlaybackEngine? engine}) -
Internal: constructed by
MebiusClient.createPlayer.
Properties
- engine → PlaybackEngine
-
Internal: the live playback engine, used by
MebiusView.no setter -
events
→ Stream<
MebiusPlayerEvent> -
The stream of lifecycle events
(
playing,buffering,ended,stats).no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- isPlaying → bool
-
Whether this player is currently playing.
no setter
- mode → MebiusPlayerMode
-
The playback mode this player was created with.
final
-
qualities
→ List<
MebiusQuality> -
The quality ladder this stream offers, e.g. 1080p/720p/540p/480p,
limited to setAllowedQualities.
no setter
-
qualitiesChanged
→ Stream<
List< MebiusQuality> > -
qualities once per play, and whenever setAllowedQualities changes it.
no setter
-
qualityChanged
→ Stream<
MebiusQualityChange> -
The quality now playing, after every open that lands. Only fires when
qualities is non-empty.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → Future< void> - Stops playback (if active) and permanently releases this player.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
play(
String streamId, [Object? viewTarget]) → Future< void> -
Plays the stream identified by
streamId. -
setAllowedQualities(
List< String> ? ids) → Future<void> -
Limits the rungs this viewer may use, e.g.
['1080p', '720p']on mobile. -
setMaxQuality(
int height) → Future< void> -
Caps auto mode at
heightpixels (e.g. 720); 0 or less removes the cap. -
setQuality(
String idOrAuto) → Future< void> -
Plays
idOrAuto: an id from qualities, or"auto"(the default). -
setVolume(
double volume) → Future< void> -
Sets the playback volume.
volumeis clamped to the range 0..1. -
stop(
) → Future< void> - Stops playback and releases resources.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited