Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25670] Android: scalingMode - VIDEO_SCALING_RESIZE_ASPECT_FILL not working since upgrading to Ti SDK 7.0.x

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionWon't Fix
Resolution Date2019-07-08T17:53:20.000+0000
Affected Version/sRelease 7.0.1
Fix Version/sn/a
Componentsn/a
Labelsandroid, sdk-7, videoplayer
ReporterRaef Akehurst
AssigneeUnknown
Created2018-01-12T06:09:12.000+0000
Updated2019-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

FileDateSize
Screenshot_20180112-165135.png2018-01-12T06:06:10.000+0000109519
videoplayer demo.PNG2018-01-13T10:17:52.000+0000284264

Comments

  1. Mostafizur Rahman 2018-01-12

    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
  2. Hans Knöchel 2018-01-12

    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.
  3. Raef Akehurst 2018-01-12

    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:
       "#videoPlayer[platform=ios]": {
         scalingMode: Ti.Media.VIDEO_SCALING_RESIZE_ASPECT_FILL
       }
       "#videoPlayer[platform=android]": {
         scalingMode: Ti.Media.VIDEO_SCALING_ASPECT_FILL
       }
       
    As for some demo code, here are the contents of my index.xml in a brand new project.
       <Alloy>
       	<Window class="container">
       		<VideoPlayer id="videoPlayer" ns="Ti.Media" url="/intro.mp4" sourceType="Ti.Media.VIDEO_SOURCE_TYPE_FILE" scalingMode= "Ti.Media.VIDEO_SCALING_RESIZE_ASPECT_FILL" backgroundColor="red" autoplay="true" width="Ti.UI.FILL" height="Ti.UI.FILL" showsControls="false" />
       	</Window>
       </Alloy>
       
    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!
  4. Nazmus Salahin 2018-01-13

    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- {{ }} 2.For index.js- $.container.open() 3.Run *Test result-* See the attached file !videoplayer demo.PNG|thumbnail!
  5. Raef Akehurst 2018-01-17

    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 for Ti.Media.VIDEO_SCALING_RESIZE). I would assume that this is related to VIDEO_SCALING_RESIZE_ASPECT_FILL not working too so I thought I would mention it here.
  6. Joshua Quick 2019-06-26

    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._
  7. Alan Hutton 2019-07-08

    Closing per developer comments.
  8. Joshua Quick 2019-07-08

    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].

JSON Source