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

avoid lossy conversion from float to int in radius calculation #1

Closed
wants to merge 1 commit into from
Closed

Conversation

brad
Copy link

@brad brad commented May 7, 2018

Hi Jochum,
I ran into these errors when pulling the latest code from your branch. I think this PR should fix it.

Contributing checklist

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

Solves issue(s)

/home/circleci/repo/platforms/android/src/com/tokbox/cordova/OpenTokAndroidPlugin.java:108: error: incompatible types: possible lossy conversion from float to int
[16:07:21]: ▸ this.x = xPos;
[16:07:21]: ▸ ^
[16:07:21]: ▸ /home/circleci/repo/platforms/android/src/com/tokbox/cordova/OpenTokAndroidPlugin.java:109: error: incompatible types: possible lossy conversion from float to int
[16:07:21]: ▸ this.y = yPos;
[16:07:21]: ▸ ^
[16:07:21]: ▸ /home/circleci/repo/platforms/android/src/com/tokbox/cordova/OpenTokAndroidPlugin.java:110: error: incompatible types: possible lossy conversion from float to int
[16:07:21]: ▸ this.width = width;
[16:07:21]: ▸ ^
[16:07:21]: ▸ /home/circleci/repo/platforms/android/src/com/tokbox/cordova/OpenTokAndroidPlugin.java:111: error: incompatible types: possible lossy conversion from float to int
[16:07:21]: ▸ this.height = height;

@wolfenrain
Copy link

Hey Brad, I just noticed this PR. I already did the changes myself, thanks for pointing them out! I just did a build for android and its working smoothly. Will close the PR because there no need for it anymore but still thanks for your work!

If you see any other issues, or have some ideas you can always ping me up!

@wolfenrain wolfenrain closed this May 8, 2018
@brad
Copy link
Author

brad commented May 8, 2018

Thanks @wolfenrain Do you think you could quickly explain how to set a border radius on a stream? I don't think I totally understand how parameters are passed from Javascript to native code.

@brad brad deleted the float-init branch May 8, 2018 17:44
@wolfenrain
Copy link

Current implementation works by searching for border-radius properties on its OT_root element and its parents until it finds one. Then it gets each corner(border-top-left-radius, border-top-right-radius) values and gets then the X and Y values of that corner(CSS specs.

And then we do some clipping of the view natively. Android is as far as I know fully compatible with the border-radius specs of CSS, but iOS is still having some problems, it sorta works but not yet "usefull"

@brad
Copy link
Author

brad commented May 8, 2018

Thank you @wolfenrain the border radius looks great over here on Android, but now the z-index isn't working (my small publisher video is hidden behind the subscriber). The z-index is working for me when building from 265bd4f but not when I use f127abd
Here's the compare: 265bd4f...f127abd
Any idea what could be happening here?

@mark-veenstra
Copy link

@brad We reported an issues on the main plugin here: opentok#86. @wolfenrain has been working on a solution on this in our feature/fix branch here: https://github.com/Mediapioniers/cordova-plugin-opentok/tree/issue-86. So you should also include this code of the feature/fix branch. Also upvote the issue on the main plugin issue tracker.

Also @wolfenrain mentioned in the main issue tracker opentok#86 that this solution relies on opentok#49 and opentok#59, so please upvote them to.

So most of the code is not merged yet in any release branch in the main plugin. But we do have a few branches in our fork which has all the solutions together. But DO NOT use them in production, since they will get removed once all is merged. And they can change overtime during our development process.

Best is to create an own fork and merge all into a branch which you can use and upvote everything you need on the main issue tracker so it will get merged in the original plugin for eveyone to use.

Thanks in advance and any help!

@brad
Copy link
Author

brad commented May 9, 2018

@mark-veenstra Thank you for the reminder to use my own fork, I was being lazy. I'll upvote the issues and let you know how my testing goes

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.

3 participants