Conversation
VideoScreenObject in HaishinKit.kt already exposes imageOrientation, deviceOrientation and rotatesWithContent, but the Dart object serialises only `track` and the native `elements` setter reads only `track`, so none of them are reachable from Dart. The effect is that a capture keeps whatever rotation it had when the video source was attached. A device held in landscape then renders rotated by 90 degrees, both in the preview texture and in the published stream, with no way to correct it from the Dart side. Re-attaching the source does not help, and neither does rotating the display. Serialise the three properties on the Dart VideoScreenObject and apply them to the native object in ScreenHandler. Verified on a Galaxy S22 Ultra held in landscape, using printed text in frame as the reference: the label reads vertically before the change and horizontally after.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
VideoScreenObjectalready supportsimageOrientation,deviceOrientationand
rotatesWithContentin HaishinKit.kt, but none of them are reachable fromDart: the Dart object serialises only
track, and the nativeelementssetterreads only
track(VideoScreenObject$Keyscontains nothing else).The consequence is that a capture keeps whatever rotation it had when the video
source was attached. A device held in landscape renders rotated by 90 degrees —
in the preview texture and in the published stream — and there is no way to
correct it from Dart. Re-attaching the video source does not help, and neither
does rotating the display.
Change
VideoScreenObjectgainsimageOrientation,deviceOrientationandrotatesWithContent, and serialises them intoelements.ScreenHandlerapplies those elements to the native object.Two files, no API removed, no behaviour change for callers that don't set the
new properties (
deviceOrientationdefaults to 0,rotatesWithContentto true).Verification
Galaxy S22 Ultra held in landscape, printed text in frame as the reference
(furniture edges are ambiguous under a 90° rotation): the label reads
vertically before the change and horizontally after.
Note for maintainers
Consumers currently need an explicit
VideoScreenObject(track: 0)for this toapply, since track 0 renders through the
Screenitself where there's no handleto reach. If you'd prefer to plumb orientation at that level instead, that would
be the better fix and I'm happy to drop this.