Skip to content

Commit e845c4a

Browse files
committed
Fix debug option to force requsted resolution size
1 parent bd186d9 commit e845c4a

File tree

1 file changed

+7
-9
lines changed
  • Assets/Samples/Stream Video & Audio Chat SDK/0.8.11/Video & Audio Chat Example Project/Scripts/UI

1 file changed

+7
-9
lines changed

Assets/Samples/Stream Video & Audio Chat SDK/0.8.11/Video & Audio Chat Example Project/Scripts/UI/ParticipantView.cs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,13 @@ protected void Update()
6464
{
6565
var rect = _videoRectTransform.rect;
6666
var videoRenderedSize = new Vector2(rect.width, rect.height);
67-
if (videoRenderedSize != _lastVideoRenderedSize)
67+
var forcedRequestedSize = new Vector2(_forceRequestedResolutionWidth, _forceRequestedResolutionHeight);
68+
var finalRequestedSize = _forceRequestedResolution ? forcedRequestedSize : videoRenderedSize;
69+
70+
if (_lastRequestedResolution != finalRequestedSize)
6871
{
69-
_lastVideoRenderedSize = videoRenderedSize;
70-
var videoResolution = new VideoResolution((int)videoRenderedSize.x, (int)videoRenderedSize.y);
71-
72-
if(_forceRequestedResolution)
73-
{
74-
videoResolution = new VideoResolution(_forceRequestedResolutionWidth, _forceRequestedResolutionHeight);
75-
}
72+
_lastRequestedResolution = finalRequestedSize;
73+
var videoResolution = new VideoResolution((int)finalRequestedSize.x, (int)finalRequestedSize.y);
7674

7775
// To optimize bandwidth we always request the video resolution that matches what we're actually rendering
7876
Participant.UpdateRequestedVideoResolution(videoResolution);
@@ -135,7 +133,7 @@ protected void OnDestroy()
135133

136134
private AudioSource _audioSource;
137135
private RectTransform _videoRectTransform;
138-
private Vector2 _lastVideoRenderedSize;
136+
private Vector2 _lastRequestedResolution;
139137
private Quaternion _baseVideoRotation;
140138

141139
private void OnParticipantTrackAdded(IStreamVideoCallParticipant participant, IStreamTrack track)

0 commit comments

Comments
 (0)