Option to unpublish without stopping track (#45)
* implement * rename * only for local * keep option * no per unpublish option to stop track * format * format
This commit is contained in:
@@ -20,11 +20,16 @@ class ConnectOptions {
|
||||
/// defaults to true.
|
||||
final bool optimizeVideo;
|
||||
|
||||
/// Set this to false in case you would like to stop the track yourself.
|
||||
/// defaults to true.
|
||||
final bool stopLocalTrackOnUnpublish;
|
||||
|
||||
const ConnectOptions({
|
||||
this.autoSubscribe = true,
|
||||
this.defaultVideoPublishOptions = const VideoPublishOptions(),
|
||||
this.defaultAudioPublishOptions = const AudioPublishOptions(),
|
||||
this.optimizeVideo = true,
|
||||
this.stopLocalTrackOnUnpublish = true,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -188,7 +188,9 @@ class LocalParticipant extends Participant<LocalTrackPublication> {
|
||||
|
||||
final track = pub.track;
|
||||
if (track != null) {
|
||||
await track.stop();
|
||||
if (engine.connectOptions.stopLocalTrackOnUnpublish) {
|
||||
await track.stop();
|
||||
}
|
||||
|
||||
final sender = track.transceiver?.sender;
|
||||
if (sender != null) {
|
||||
|
||||
Reference in New Issue
Block a user