[TIMOB-25670] Android: scalingMode - VIDEO_SCALING_RESIZE_ASPECT_FILL not working since upgrading to Ti SDK 7.0.x
GitHub Issue | n/a |
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Won't Fix |
Resolution Date | 2019-07-08T17:53:20.000+0000 |
Affected Version/s | Release 7.0.1 |
Fix Version/s | n/a |
Components | n/a |
Labels | android, sdk-7, videoplayer |
Reporter | Raef Akehurst |
Assignee | Unknown |
Created | 2018-01-12T06:09:12.000+0000 |
Updated | 2019-07-08T19:26:25.000+0000 |
Description
Since upgrading to Ti SDK 7.x and finding that Ti.Media.VIDEO_SCALING_ASPECT_FILL
has been removed I changed to Ti.Media.VIDEO_SCALING_RESIZE_ASPECT_FILL
. This works on iOS but on Android, it acts like Ti.Media.VIDEO_SCALING_RESIZE_ASPECT
which resizes to fit the available area. Here is my embed code:
<VideoPlayer id="videoPlayer" ns="Ti.Media" url="/video/intro.mp4" sourceType="Ti.Media.VIDEO_SOURCE_TYPE_FILE" scalingMode= "Ti.Media.VIDEO_SCALING_RESIZE_ASPECT_FILL" backgroundColor="#D0EAED" onComplete="complete" autoplay="false" />
Attached is a screenshot. You can see the bar down the left side where the video has not stretched to fill.
Attachments
Hello [~raefa], Thanks for sharing with us. Can you please test the sample code using the latest SDK 7.0.1.GA and let us know if the issue occurs. Best
Hey there! Besides the fact that some demo-code would help, you can still use the old constant for iOS, as it has only been removed for iOS due to updating the underlaying API to the recommended one by Apple. Let us know if that helps! But still, we should improve the parity here.
Hi @Mostafizur Rahman and @Hans Knöchel. Tested on SDK 7.0.1.GA. Same deal. I did not even think to check if the removed Ti.Media.VIDEO_SCALING_ASPECT_FILL would still work on Android! It does. For those that run into this issue and come across this post, here is what I have done for now. This workaround works:
As for some demo code, here are the contents of my index.xml in a brand new project.
The only other thing I added was the intro.mp4 in the assets directory. I can create and share a repo if with this if you like ... or will this do? Keep up the good work!
Hello, Tested the sample code and the issue was reproduced. Environment-Ti SDK-7.0.1 GA Google nexus 6p-7.0.0-android 24(emulator) * Test steps:* 1.Copy the following code in index.xml- {{
$.container.open()
3.Run *Test result-* See the attached file !videoplayer demo.PNG|thumbnail!Hi All, I was using video in another place today and noticed that
Ti.Media.VIDEO_SCALING_RESIZE_ASPECT
also does not work as expected. It stretches the video to fit the available space (like you would expect forTi.Media.VIDEO_SCALING_RESIZE
). I would assume that this is related toVIDEO_SCALING_RESIZE_ASPECT_FILL
not working too so I thought I would mention it here.This is not a bug, but I can understand why this might be confusing. The following constants were added to Titanium 7.0.0 and are only supported by iOS. Our website correctly documents them as iOS-only constants. * [VIDEO_SCALING_RESIZE](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media-property-VIDEO_SCALING_RESIZE) * [VIDEO_SCALING_RESIZE_ASPECT](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media-property-VIDEO_SCALING_RESIZE_ASPECT) * [VIDEO_SCALING_RESIZE_ASPECT_FILL](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media-property-VIDEO_SCALING_RESIZE_ASPECT_FILL) Android only supports the old video scaling constants below. And these constants have been removed from iOS. Unfortunately, our docs flag them as fully removed when they are only removed on iOS. * [VIDEO_SCALING_ASPECT_FILL](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media-property-VIDEO_SCALING_ASPECT_FILL) * [VIDEO_SCALING_ASPECT_FIT](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media-property-VIDEO_SCALING_ASPECT_FIT) * [VIDEO_SCALING_MODE_FILL](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media-property-VIDEO_SCALING_MODE_FILL) * [VIDEO_SCALING_NONE](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media-property-VIDEO_SCALING_NONE) So, the solution for now is to use the old scale modes on Android and the new scale modes on iOS. On the Titanium side, we need to look into adding these new constants to Android for parity with iOS. *_Edit:_* _Windows only supports the old video scaling constants as well._
Closing per developer comments.
I've written up enhancement request tickets to add the iOS video scaling constants to Android and Windows. To be done in the future. Please see [TIMOB-27184] and [TIMOB-27185].