Send video layers (#55)
* signal method * videoLayers param on addTrack request * screen share presets * implemented * cleaner syntax
This commit is contained in:
@@ -119,29 +119,35 @@ class LocalParticipant extends Participant<LocalTrackPublication> {
|
||||
}
|
||||
}
|
||||
|
||||
logger.fine(
|
||||
'Compute encodings with resolution: ${dimensions}, options: ${publishOptions}');
|
||||
|
||||
// Video encodings and simulcasts
|
||||
final encodings = Utils.computeVideoEncodings(
|
||||
isScreenShare: track.source == TrackSource.screenShareVideo,
|
||||
dimensions: dimensions,
|
||||
options: publishOptions,
|
||||
);
|
||||
|
||||
logger.fine('Using encodings: ${encodings?.map((e) => e.toMap())}');
|
||||
|
||||
final layers = Utils.computeVideoLayers(dimensions, encodings);
|
||||
|
||||
logger.fine('Video layers: ${layers.map((e) => e)}');
|
||||
|
||||
final trackInfo = await room.engine.addTrack(
|
||||
cid: track.getCid(),
|
||||
name: track.name,
|
||||
kind: track.kind,
|
||||
source: track.source.toPBType(),
|
||||
dimensions: dimensions,
|
||||
videoLayers: layers,
|
||||
);
|
||||
|
||||
logger.fine('publishVideoTrack addTrack response: ${trackInfo}');
|
||||
|
||||
await track.start();
|
||||
|
||||
logger.fine(
|
||||
'Compute encodings with resolution: ${dimensions}, options: ${publishOptions}');
|
||||
|
||||
// Video encodings and simulcasts
|
||||
final encodings = Utils.computeVideoEncodings(
|
||||
dimensions: dimensions,
|
||||
options: publishOptions,
|
||||
);
|
||||
|
||||
logger.fine('Using encodings: ${encodings?.map((e) => e.toMap())}');
|
||||
|
||||
final transceiverInit = rtc.RTCRtpTransceiverInit(
|
||||
direction: rtc.TransceiverDirection.SendOnly,
|
||||
sendEncodings: encodings,
|
||||
|
||||
Reference in New Issue
Block a user