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(android): add new constants for video scaling #11148
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ypbnv, can you also update the "Media.yml" documentation please? We need to indicate that Android now supports these constants. Thanks!
warningMessage.append(" instead."); | ||
Log.w("VideoPlayerProxy", warningMessage.toString()); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constantDeprecationWarning()
method will end up appending strings every time the video view gets resized or a request-layout occurs. Even if you are using a non-deprecated constant. I'd prefer to avoid this. How about rewriting it to something like the below?
String message = null;
final String MESSAGE_FORMAT = "%s has been deprecated. Use %s instead.";
switch (constant) {
case MediaModule.VIDEO_SCALING_ASPECT_FILL:
message = String.format(MESSAGE_FORMAT, "Ti.Media.VIDEO_SCALING_ASPECT_FILL", "Ti.Media.VIDEO_SCALING_RESIZE_ASPECT_FILL");
break;
case MediaModule.VIDEO_SCALING_ASPECT_FIT:
message = String.format(MESSAGE_FORMAT, "Ti.Media.VIDEO_SCALING_ASPECT_FIT", "Ti.Media.VIDEO_SCALING_RESIZE_ASPECT_FIT");
break;
case MediaModule.VIDEO_SCALING_MODE_FILL:
message = String.format(MESSAGE_FORMAT, "Ti.Media.VIDEO_SCALING_MODE_FILL", "Ti.Media.VIDEO_SCALING_RESIZE");
break;
}
if (message != null) {
Log.w("VideoPlayerProxy", message);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's way better, yes. I also changed the default value of mScalingType
to use the new constant counter part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also changed the default value of mScalingType
I didn't even notice that. It's looking good now. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CR: Pass
FR Passed. New constants for video scaling behaves as same as old constants. |
android unit test is failing .not able to merge PR. @ypbnv can you please resolve Jenkins failure and merge PR |
JIRA: https://jira.appcelerator.org/browse/TIMOB-27184
Description:
Add
constants in Android. Added a deprecation message for using the old ones. I suppose we are removing them in one of the next major releases for keeping parity? Also I have not made any changes for in the docs, since now the old constants are marked as removed in all platforms, but are actually working fine on Android. Should we change that to list them as only deprecated on Android?
Note: New constants are related with visual changes, so no unit tests.
Test case:
Note that in order to check all the constants you need to comment the line for any of the "modes" and uncomment another. The modes are matched by the corresponding number - having two players with the different constants should not show any difference.
Link for a sample video to download: https://download.blender.org/peach/bigbuckbunny_movies/