Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add scaleBehavior for subscriber and publisher view #474

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

deermichel
Copy link
Contributor

Contributing checklist

  • Code must follow existing styling conventions
  • Added a descriptive commit message

Solves issue(s)

Closes #327.

This PR introduces a new property scaleBehavior: "fill" | "fit" for OTSubscriber and OTPublisher which translates to the OTVideoViewScaleBehavior on iOS, respectively BaseVideoRenderer.STYLE_VIDEO_* on Android.

By default, the value is "fill" which will scale the video to fill the entire view, with cropping as needed. This was the only behavior available so far, thus, no code changes in present apps are required. The new value "fit" will shrink the video (pillarboxing), so that the entire video is contained in the view.

@mheap mheap changed the base branch from master to main March 22, 2021 09:49
const sanitizeProperties = (properties) => {
if (typeof properties !== 'object') {
return {
scaleBehavior: 'fill',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having this as the default breaks it. I couldn't get it to work unless I changed this value here. I assume this is because the subscriber loads in a bit after the view is rendered?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On which platform / or how does it break for you? 😯

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both. The subscriber scaleBehavior is always fill

Copy link
Contributor

@abdulajet abdulajet May 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The subscriber views, bottom one, should be fit

Screenshot 2021-05-27 at 11 54 07
Screenshot 2021-05-27 at 11 56 58

@JB-CHAUVIN
Copy link

LGTM

@pietgk
Copy link
Contributor

pietgk commented Jan 2, 2023

@abdulajet what do you think should be done with this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Any equivalent of OTPublisher.viewScaleBehavior
5 participants