Skip to content

Commit

Permalink
simulcast: Adjust resolution defaults to fit FVTT's default sizing
Browse files Browse the repository at this point in the history
Newer versions of FVTT have a default video resolution of 234x175.5.
This means that second simulcast layer was always the smallest resolution
being selected.

Increase the smallest simulcast resolution to fit these
new defaults so it is the only resolution that needs to be enabled
unless video windows are popped out for larger viewing. This also lets
us pick a video resolution a little bit higher for the second layer to
cover some more use cases.
  • Loading branch information
bekriebel committed Aug 7, 2023
1 parent 288d447 commit 2bcac44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/LiveKitClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ export default class LiveKitClient {
);

// Set resolution higher if simulcast is enabled
let videoResolution = VideoPresets43.h240.resolution;
let videoResolution = VideoPresets43.h180.resolution;
if (this.trackPublishOptions.simulcast) {
videoResolution = VideoPresets43.h720.resolution;
}
Expand Down Expand Up @@ -1473,7 +1473,7 @@ export default class LiveKitClient {
const trackPublishOptions: TrackPublishOptions = {
audioBitrate: AudioPresets.music.maxBitrate,
simulcast: true,
videoSimulcastLayers: [VideoPresets43.h120, VideoPresets43.h240],
videoSimulcastLayers: [VideoPresets43.h180, VideoPresets43.h360],
};

if (getGame().settings.get(MODULE_NAME, "audioMusicMode")) {
Expand Down
2 changes: 1 addition & 1 deletion src/livekit-web-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const appActions = {
dynacast,
publishDefaults: {
simulcast,
videoSimulcastLayers: [VideoPresets43.h120, VideoPresets43.h240],
videoSimulcastLayers: [VideoPresets43.h180, VideoPresets43.h360],
videoCodec: preferredCodec || "vp8",
},
videoCaptureDefaults: {
Expand Down

0 comments on commit 2bcac44

Please sign in to comment.