Posts in Category "Mobile"

How to provide video rotation information to ActionScript as metadata

fp_air

By Jason Lee

Prior to Flash Player and AIR version 20, the Flash runtime does not correctly process the matrix field values in the Track Header Box and the Movie Header Box, as defined in the ISO specification ISO/IEC 14496-12:2008. As a result, in some instances, the user experiences an incorrectly resized and rotated video when the video is played back with Flash. The problem is particularly pronounced when playing videos that are recorded in portrait mode with old Android or iOS devices. This happens because these devices save video in landscape mode along with a matrix representing rotation transformation, when the users record the video in portrait mode.

Flash Player and AIR version 20 introduce a feature whereby video rotation meta-data is provided through ActionScript. This feature mitigates the problem discussed above by providing the video matrix information to ActionScript as a part of the meta-data object of the onMetaData event, an event handler of the NetStream object. This allows the ActionScript developers to render the video in the intended rotation matrix. It should be noted that the Flash Player engine does not automatically apply the video matrix information to the rendered video output, so as to avoid any resizing or rotation that is not intended by the ActionScript developer.

video-rotation-problem

The ActionScript code example below shows how to apply the rotation matrix to the Video object.

Note: The example assumes that the video is recorded along a matrix representing 90° clockwise rotation.

var video:Video = new Video();
 addChild(video);
 var nc:NetConnection = new NetConnection();
 nc.connect(null);
 var ns:NetStream = new NetStream(nc);
 ns.client = {};
 ns.client.onMetaData = ns_onMetaData;
 ns.client.onCuePoint = ns_onCuePoint;
 video.attachNetStream(ns);
 ns.play("Demo.mp4");
 
function ns_onMetaData(info:Object):void {
 trace("metaData");
 video.x = 0,
 video.y = 0;
 video.width = info.width;
 video.height = info.height;
 varmatrix:Matrix = video.transform.matrix; // Read old transform matrix of video object.
 varoldSize:Point = new Point(video.width, video.height);
 varnewSize:Point = new Point(Math.abs(info.matrix.transformPoint(oldSize).x), Math.abs(info.matrix.transformPoint(oldSize).y));
 matrix.translate(-(oldSize.x / 2), -(oldSize.y / 2));
 if (info.hasOwnProperty("trackHeaderBoxMatrix"))
 matrix.concat(info.trackHeaderBoxMatrix[0]); // Apply the matrix of the Track Header Box of Video Track provided by this feature to video object.
 // trackHeaderBoxMatrix is an array of MatrixObject because there can be one or more video tracks.
 if (info.hasOwnProperty("movieHeaderBoxMatrix"))
 matrix.concat(info.movieHeaderBoxMatrix); // Apply the matrix of the Movie Header Box provided by this feature to video object.
 matrix.translate((newSize.x / 2), (newSize.y / 2));
 video.transform.matrix = matrix; // Set new matrix to transform matrix of Video object.
 }
 function ns_onCuePoint(item:Object):void {
 trace("cuePoint");
 }

The feature works for NetStream objects using progressive download, which allows Flash runtime to download and directly parse a video file. However, this feature does not handle NetStream using RTMP or appendBytes, in which case, the matrix properties provided by this feature are not available. This feature provides the matrices for all file formats — MP4, M4V, F4V, and 3GPP in accordance with ISO specification ISO/IEC 14496-12:2008, when using progressive download. For all other file formats, such as FLV, the matrix properties provided by this feature are not available.

The matrix information provided by this feature can only be applied to an instance of the Video class. Therefore, with StageVideo, which uses GPU acceleration, for example, the matrix information is not applicable.

This feature introduces the following new properties of the object representing video meta-data, a parameter of onMetaData event handler:

  • Object.movieHeaderBoxMatrix: flash.geom.Matrix
  • Object.trackHeaderBoxMatrix: An array of flash.geom.MatrixtrackHeaderBoxMatrix is an array of MatrixObject because there can be one or more video tracks in a single video file.

If you are a Flash content developer and are having trouble getting a video to display in correct orientation, please try this new ActionScript functionality for handling video rotation meta-data.

Troubleshooting common Adobe AIR installation errors with iOS applications

air_3_icon_rgb

By Piyush Bagri

In this post, we will explain the possible causes and solutions for some general errors that may occur when installing an AIR application on iOS devices using Flash Builder, Flash Professional, or command-line. This will help you to narrow down the installation error to a specific cause so that it can be resolved easily.

Installation error: “Application verification failed.”

The possible causes for this installation error along with the solutions to rectify it in each case are specified here.

Wildcard characters used in application id

If you are using any wildcard characters in the application id in your project, for example ‘calculator.debug.*‘, you will get ‘application verification failed‘ error.

Solution: The error will be resolved as soon as you remove the wildcard characters from the application id.

Feature listed in application.xml file is not added in the provisioning profile

If you are trying to compile your IPA with aps-environment key in entitlement.plist tags in application.xml file as shown in the example below and push notification service is not enabled in provisioning profile, then also you will get ‘application verification failed‘ error.

Example: Entitlements tag has been added in application.xml file but the push notification service is not enabled in provisioning profile.

...
<Entitlements><![CDATA[
            <key>aps-environment</key>
            <string>development</string>
             ]]>
</Entitlements>
...

Solution: Simply comment the above section of the code in application.xml or else add the feature in the provisioning profile. You will be able to rectify this error and compile your project. For more details, see Using push notifications in AIR iOS apps.

Wrong certificate used for packaging

You can also get ‘application verification failed‘ error if there is something wrong with the developer certificate that you are packaging your AIR application with. Another reason for the error could be that your device UUID is not listed in the provisioning profile.

Solution: You will be able to install your app on the device when you connect the right certificate with your provisioning profile. To know more about applying for an iPhone developer certificate and creating a provisioning profile, see Obtaining and working with iPhone developer files.


Installation error: “iTunes mobile device library not found. Please check your iTunes installation.”

This installation error is mainly related to the version of Adobe Flash Professional CC and/or AIR SDK that you are using to connect with Apple iTunes while installing the AIR application on your device. You may get this error in the following cases:

Using Flash Professional CC 2014 with iTunes 12.1.2

If you are using Adobe Flash CC 2014 and AIR SDK (any version) with iTunes 12.1.2, you may get this installation error when in your Flash Professional CC project you select:

File > Publish >Install application on the connected iOS device

Solution: This issue has been fixed in the latest Adobe Flash Professional CC 2015 version. With this fix, it can now be used with Adobe AIR SDK (any version) and Apple iTunes version 12.1.2 in Windows environment.

Using ADT version 16 or older with iTunes 12.1.2

If you are trying to install your application on the iOS device by command-line using ADT version (same as AIR SDK version) 16 or older, you can encounter this error. ADT is not able to detect iTunes 12.1.2 library in this case.

<AIRSDK Location>/bin/adt –installApp –platform ios –package <package name>

Solution: It is recommended to use Adobe AIR SDK version 16 or newer to resolve this error. iTunes 12.1.2 library is detected by Adobe AIR SDK 16 or newer versions.

Using ADT version 20.0.0.177 or older with iTunes 12.3

If you are trying to install your application on the iOS device by command-line using ADT version (same as AIR SDK version) 20.0.0.177 or older, you can encounter this error. ADT is not able to detect iTunes 12.3 library in this case.

Solution: With AIR SDK 20.0.0.178 build this issue has been resolved.


Installation error: “PackageInspectionFailed”

This installation error is mainly related to the version of Adobe Flash Professional CC and/or AIR SDK that you are using to connect with Apple iTunes while installing the AIR application on your device.

Solution: With Flash Builder 4.7, cleaning your project solves this error.

To clean you project, choose Project> Clean > Clean All Projects. See Build projects in Adobe Flash Builder 4.7 documentation for more details.

***

Typically, you want to have the latest version of Adobe AIR. To get it, follow the instructions at Download and install Adobe AIR. However, you can get an older version of Adobe AIR here.

Do you still have problem with the installation of Adobe AIR application? Post your question in the Adobe AIR Installation Issues forum.

Adobe AIR to support upcoming iOS x64 requirement

Starting February 1st 2015, Apple will be requiring all new iOS applications submitted to the App Store to include support for 64-bit.  The Flash Runtime team is committed to supporting our AIR developers and end users.  Our team recognizes that platform compatibility is crucial to our customers, and supporting new OS versions and requirements are a top priority.

We’re hard at work adding iOS 64-bit compatibility to AIR in an upcoming beta which we look forward to making available in December 2014.

Both AIR and Flash Player have very active public beta programs, with updates made on almost a weekly basis.  We encourage all developers to participate and provide feedback to Adobe.  Updates, release notes and additional information can be found on Adobe Labs.

Adobe AIR Labs Homepage

Adobe Flash Player Labs Homepage

ActionScript rises to #14 on the Tiobe Index

 

ActionScript History on the Tiobe Index

 

Thank you to Jonathan Hart (@jonathanhartsf) and others for the heads up on the recent resurgence of ActionScript on the Tiobe Index.  Last month ActionScript broke into the top 20.  The June numbers are now out and it’s moved up to the 14th spot!  None of this would be possible without the awesome support of our AS developer community, creating and inspiring us with their applications and games for both mobile and desktop platforms!  Thank you!

Source: www.tiobe.com

Latest Updates on the Flash Runtime

There’s been talk recently on different forums regarding Adobe’s position on the Flash Runtime.  Hopefully some of the work we’re doing and items outlined below will help answer these questions.

First, let me introduce myself.  My name is Chris Campbell and I’m the product manager and customer advocate for the Flash Runtime product team.  I’ve been part of the Flash and AIR teams for the last 4 years and prior to that I worked for 14 years as a developer in our digital imaging group.  Some of you might know me from the forums, where I’ve spent a lot of time working with customers to bring issues to the engineering team.  I’m on Twitter @liquidate but you can also reach me via email at ccampbel@adobe.com.

What have we been up to lately?

Improved Packaging Engine – We’ve made massive improvements to our iOS packaging engine (Halfmoon AOT), with reduced packaging times up to 10x.  This work lays the foundation for future features like iOS workers.  This has been in our beta builds for a while (we try to make these publicly available on a regular basis) and was out in our public AIR 4.0 release.

ActionScript concurrency for Android – We knew this would be a hit with the feedback we received with ActionScript Workers on the desktop so getting this over to mobile was a priority for us.  We had an extended beta for this feature and it made its public appearance in AIR 3.9 with additional fixes based on feedback received in our 4.0 release.

Support for new versions of OSX, Windows, iOS and Android – We know that our developers and users want to use the latest OS’s and browsers.  We have made sure that the Runtime supports these targets and we’re committed to making sure that continues in the future.

Here are just a few of the new features that we’re working on this year –

ActionScript concurrency for iOS – Now that we’re finishing up with the Halfmoon packaging work, the next step is to add support for ActionScript Workers on iOS.  We know this is an important feature and we’re looking forward to starting an extended beta for this later this year.

Improvements to Stage3D – Stage3D was a massive game changer for Flash.  We want to add to this with significant efficiency improvements by supporting multiple render targets.  If you’ve been around for a while, you might remember a previous beta for AGAL2.  We’re picking this up again now that we’ve got support for all supported platforms and we should have something to share later this summer.

PPAPI debugging – A long time request has been the ability to debug Flash content on Google Chrome.  We’ve been working to bring our debugger to the PPAPI platform and we’re almost ready for a beta release.  This required a lot of work under the hood and while we’re there we’re also tackling a nagging Stage3D performance problem.  Progress has been going well and we’re optimistic that we’ll have a solution for our customers.

Game discovery – We know that there are a huge number of games available on the market and it’s hard to get the user’s attention.  We believe we can help.  One of our greatest strengths is the reach of our platform.  Flash Player is installed on over a billion computers!  The AIR shared runtime is installed on 50+ million Android devices!  We’re working to figure out how we can leverage these strengths to improve your app’s success.  Look for details on Adobe GameSpace, Playpanel, GamePreviews, and more in the very near future.

It’s certainly true that we have increased our investments on HTML technologies, but Adobe and the Flash product team are dedicated to pushing the Flash runtime platform forward.  We believe that AIR and Flash Player are excellent solutions for both the video and gaming markets.

While most of Adobe’s marketing and PR activities are focused on the Creative Cloud and Marketing Cloud initiatives, we are working on the following items to help improve our messaging around the Flash Runtime.

  • Redesign, refresh and make regular content updates to our game development web site.  We’ll be retiring the gaming.adobe.com microsite and instead updates will be made to our Adobe Developer Connection page found here – http://www.adobe.com/devnet/games.html
  • Create a new Flash Runtime showcase website that allows for easy showcase project submissions by our development community.
  • Reach out to the community and promote their games and usage of Adobe tools through guest blog posts and case studies that we feature on adobe.com.   If you’re interested, please contact me via email.
  • Find additional and creative ways to allow our passionate development community to evangelize the use of Flash Runtime

Finally, in a recent Adobe post there was some confusion regarding PhoneGap and if this product was supplanting or replacing AIR.  This is not the case.  We believe both of these technologies have merit and we recommend developers pick a solution that best suits their project.  For gaming and video related applications, on either the desktop or mobile platforms, we believe the Flash Runtime continues to be a great choice.