Skip to content

🐛 Android screen share is captured in portrait (natural) orientation while the device is in landscape - remote receives a letterboxed 864×1920 track #1857

Description

@vparashchak

Description

On Android, when the app is in landscape orientation and startScreenShare() is
called, the published screen-share track is encoded in the device's natural
(portrait) orientation. The actual landscape screen content is scaled to fit the
portrait surface, producing black bars on the top and bottom. Remote peers (verified
on the Web SDK) receive a portrait-shaped track with the landscape content letterboxed.

The captured/encoded orientation does not follow the current display rotation - it
appears to be derived from the device's natural-orientation metrics rather than the
current rotated display size.

iOS is not affected — the same scenario produces a correctly oriented landscape track.

100ms Flutter Version

1.11.1

Steps to reproduce

  1. Join a room on Android with a role that is allowed to publish screen.
  2. Put the app into landscape orientation (e.g. via
    SystemChrome.setPreferredOrientations([landscapeLeft, landscapeRight])).
    Confirm the OS display is really landscape (see diagnostic below).
  3. Call hmsSDK.startScreenShare().
  4. Observe the screen-share track on any remote peer (we used the 100ms Web SDK).

Expected results

The screen-share track should be published in landscape, matching the current
display (≈ 2400 × 1080 / 16:9-wide), so the remote peer sees the full landscape screen
with no letterboxing.

Code example, screenshot, or link to a repository

Sample Project

Github Repo

Image

Logs

Logs
<!-- Paste your logs here -->

Flutter Doctor output

Doctor output
flutter doctor -v
[✓] Flutter (Channel stable, 3.44.2, on macOS 15.6 24G84 darwin-arm64, locale en-US) [996ms]
    • Flutter version 3.44.2 on channel stable at /Users/wussupenko/fvm/versions/3.44.2
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c9a6c48423 (3 weeks ago), 2026-06-10 15:52:41 -0700
    • Engine revision 77e2e94772
    • Dart version 3.12.2
    • DevTools version 2.57.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging,
      enable-uiscene-migration

[✓] Android toolchain - develop for Android devices (Android SDK version 37.0.0) [6.2s]
    • Android SDK at /Users/wussupenko/Library/Android/sdk
    • Emulator version 36.6.11.0 (build_id 15507667) (CL:N/A)
    • Platform android-37.0, build-tools 37.0.0
    • ANDROID_HOME = /Users/wussupenko/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.9+-14649483-b1163.86)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 26.3) [2.5s]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 17C529
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [6ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Connected device (3 available) [10.7s]
    • SM G991B (mobile)                   • RFCR20PE6AD               • android-arm64  • Android 15 (API 35)
    • macOS (desktop)                     • macos                     • darwin-arm64   • macOS 15.6 24G84 darwin-arm64
    • Chrome (web)                        • chrome                    • web-javascript • Google Chrome 149.0.7827.201

[✓] Network resources [605ms]
    • All expected network resources are available.

• No issues found!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions