roguish

Category: Flash

Revelens Video Player Platform for Product Placement Purchasing

I built the video player for the Revelens Product Placement and Purchasing video platform.

The Revelens player allows the viewer to access more content associated with different parts of videos. The video owner connects specific parts of the video with weblinks, allowing product placement in the video to be tied directly to product purchase pages for the products in the video. Video owners may also make links to any kind of additional content their users may want to see that are related to the user’s favorite parts of the video timeline.

Revelens Platform Promo Video

Read the full article »

[Solved] SecurityError #2122 Redirected CDN Video File

We recently encountered SecurityError #2122 when trying to capture BitmapData from a video file. Crossdomain.xml files were being requested as required for using BitmapData.draw on content loaded into a SWF. Everything had been working well until we tried using a video hosted by Vimeo using their Pro service that allows you to use them as a CDN — they deliver video files and you play them in your own player.

[For an excellent background description about this redirect problem, read the posts linked below]

We determined that the media file returned to FlashPlayer was coming from a different domain than the domain we were requesting the video from. We considered detecting the domain of the redirected media file and following up our media file request with a Security.loadPolicyFile call using the new domain. Read the full article »

Debugging Server-hosted SWF with Flash Builder Debug Tools

Over-The-Shoulder Quick Tip

You have a Debug SWF uploaded to your server and want to use Flash Builder’s debugger features on it. You need to debug it from within its server environment for whatever reason. How do you initiate a debugger session in Flash Builder that connects with the debug-enabled SWF running from your server in the browser?

Answer: in Flash Builder’s Debug Configurations panel, set the *URL or path to launch* to “about:Blank”. Launch that debug configuration. Flash Builder begins listening for a debug SWF to be launched. Now launch the html page on the web that is hosting the debug-enabled SWF (in a browser with the debug version of the Flash Player installed). Flash Builder detects the SWF and begins debugging.

Source: http://stackoverflow.com/questions/1710219/make-flex-builder-debugger-start-listening-for-incoming-debug-session-connection

Referencing the Video Instance in OSMF (for BitmapData.draw)

Over-The-Shoulder Quick Tip

Accessing VideoSurface in OSMF is useful if you want to capture a snapshot of the playing video, but it can be difficult to locate the video display object. I found a tip in the comments section of a post by Nils Thingvall that helped:

1
2
3
var tVideoSurface : VideoSurface = ( view.mediaPlayerCore.media.getTrait( MediaTraitType.DISPLAY_OBJECT ) as DisplayObjectTrait ).displayObject as VideoSurface;
var tBitmapData : BitmapData = new BitmapData( tVideoSurface.width, tVideoSurface.height, true, 0 );
tBitmapData.draw( tVideoSurface );

Resource http://nils.realeyesmedia.com/?p=94&cpage=1#comment-875

[UPDATE 03/09/2015] Several readers have reported difficulty capturing BitmapData using this technique despite being able to see the video. If you can play a video but not capture BitmapData from it, chances are you have a problem with security permissions. Check out another post regarding security limitations for help solving that issue: http://www.roguish.com/blog/?p=667.

[Solved] ADT Error: Unexpected Argument –migrate

Over-The-Shoulder Quick Tip

The solution to this error was simple but didn’t reveal itself easily.

The Error:
unexpected argument –migrate

The hyphen/dash is the wrong character! I must have copied/pasted it from somewhere.

The solution was found here: http://forums.adobe.com/message/2404728

Accessing Application Descriptor XML on a Mobile Device


When publishing a mobile application with Adobe AIR, it’s possible to access the information in your application’s application descriptor xml file at runtime on a mobile device. Below is an example of accessing the versionNumber and renderMode from the application descriptor.
Read the full article »

flash.data Package Cannot Be Imported

Using Flash Builder 4.6, Flex 4.6.0, AIR 3.5. If you get errors where the flash.data package cannot be imported, it suggests you have not included the AIR files in your project. In Flash Builder, when configuring your project when you create it, you must check the extra checkbox in the area near your Flex API selection for *Include Adobe AIR libraries*, or alternatively, after setting up your project, you can edit the project > Flex Library Compiler pane, at the top in the Flex SDK version configuration area you can check the *Include Adobe AIR libraries*.

Also, you may need to include the defaults.css file in the library manually:
Properties >> Flex Library Build Path >> Assets tab >> unfurl the src folder and check the box next to defaults.css.

ASC 2.0 Font SWF Embedding (MinimalComps Use Case)

ActionScriptCompiler 2.0 (ASC 2.0) from Adobe no longer allows font embedding. Instead you must embed font SWFs.

From the release notes: “Font transcoding has been removed from [Embed] syntax. Fonts should be pre-transcoded and embedded as a SWF, which can be performed using a tool like fontswf or Flash Professional CS6.”

This change caused problems with a project that uses MinimalComps from Keith Peters (www.minimalcomps.com) because the package uses an embedded pixel font. Solution below. Read the full article »

Mixing Stage3D with Display List — Performance Test

A demo was recently released by Adobe (Thibault Imbert, Blog Post). It features an optimized use of Stage3D. By grouping assets that use the same texture, the number of drawTriangles calls is minimized. Adobe wrapped up this principle in a little framework (called GPUSprite) based on a metaphor of a stage with layers of content containing sprites.

The framework is clever and is a great starting point for understanding Stage3D optimization. I was surprised to see that a framerate measurement layer was placed over the top of the Stage3D content in a traditional Display List layer. It was my understanding that any Display List content over Stage3D would have a significant performance impact. To test this, I modified the sample to display the framerate in a new Stage3D layer and ditched the Display List (actually, you can toggle between the 2 views). Read the full article »

AGALMiniAssembler and PerspectiveMatrix3D Classes

Looking for the AGALMiniAssembler from Adobe so you can explore Molehill? Perhaps you’re getting a compile-time error when trying to import com.adobe.utils.PerspectiveMatrix3D.

Thibault Imbert from Adobe posted the com.adobe.utils package in this blog post: http://www.bytearray.org/?p=2555

It contains these 3 classes:

  • PerspectiveMatrix3D.as
  • FractalGeometryGenerator.as
  • AGALMiniAssembler.as

Here’s the direct link:
http://www.bytearray.org/wp-content/projects/agalassembler/com.zip