Fun with code (since 2006)

Introducing Flash Player 10.2 Beta!


12.01.10 Posted in Actionscript 3, Books & Articles, Flash Player, Inside the Flash Player by

A spicy Flash Player 10.2 BetaI told you, a lot of stuff is happening lately for Flash developers. I am happy to announce that we just posted a new Flash Player 10.2 Beta on labs. I will not cover here all the questions that are covered already in the FAQ and release notes but I would like to focus on the new features introduced in this new beta:

  • Internet Explorer 9 hardware accelerated rendering support – Flash Player takes advantage of hardware accelerated graphics in Internet Explorer 9, utilizing hardware rendering surfaces to improve graphics performance and enable seamless composition.
  • Stage Video hardware acceleration – A new method for video playback in Flash Player allows developers to leverage complete hardware acceleration of the video rendering pipeline, enabling best-in-class playback performance. Stage Video can decrease processor usage by up to 85% and enables higher frame rates, reduced memory usage, and greater pixel fidelity and quality.
  • Native custom mouse cursors – Developers can define custom native mouse cursors, enabling user experience enhancements and improving performance.
  • Support for full screen mode with multiple monitors – Full screen content will remain in full-screen on secondary monitors, allowing users to watch full-screen content while working on another display.

Obviously, there is no much code I can show you regarding IE9 GPU compositing, the Flash Player does this automatically by leveraging the new GPU compositing APIs on IE9 to actually render the Flash Player frames as surfaces and push them on screen through Direct3D9 whatever wmode value you use. Note that graphics computing is still done by the CPU but we use GPU APIs to composite and blit the Flash Player frames on screen. It is similar to what we did in the past with CoreAnimation on MacOS with Safari. This will improve rendering performance on existent content without any modifications.

Concerning Stage Video, this feature has been sneaked at FOTB earlier this year and at Max last month by Tinic. We are very happy to announce that YouTube is already leveraging Stage Video. This will dramatically change the way video performs in Flash and bring native video performance on MacOS, Windows and Linux. For more infos about the YouTube work, check the Flash Player team's blog post.

To get an idea of how StageVideo performs, you can try the StageVideo enabled players here.
Make sure you are running it with Flash Player 10.2 beta.

I wrote a complete article on Devnet which goes into the details of StageVideo and wrote a very simple video player to illustrate how the StageVideo APIs work. Check also Lee Brimelow's great video tutorial about it.

Here is a snaphost of the demo using Stage Video, playing the Big Buck Bunny movie in 1080p on my MacBook Pro :

Big Buck Bunny with Stage Video

For comparaison, here is a 720p video playing on YouTube, using about 40% of my MacBook Pro CPUs with Flash Player 10.1 :

YouTube without Stage Video

Now, let's browse to same video with Flash Player 10.2 with Stage Video, CPUs usage drops to 9% :

YouTube with Stage Video

Pretty cool, hu ? If you make the test on YouTube, make sure you wait a few seconds, some ActionScript logic in the YouTube player makes the CPU usage go wild for a few seconds before reaching its normal state.

For info, the performance improvements are way bigger if you overlay content on top of video. In some cases, CPU usage can drop from 200% to 10% using Stage Video, check my first post about Stage Video for more infos.

While listening to my track and browsing the web through another tab, the pause and resume feature introduced in Flash Player 10.1 stops rendering the frames and only decodes sound. Flash Player CPU usage then drops to 5% :

Pause and Resume with browser tab

But that is not all, we added another nice feature related to cursors. A highly requested feature. The idea is simple, no more Mouse.hide() or onMouseMove handler or startDrag to have a custom cursor. You can now directly work at the OS level and assign your own custom native bitmap-based cursors. Here is a little code sample which illustrates the idea:

// we create a MouseCursorData object
var cursorData:MouseCursorData = new MouseCursorData();
// we specify the hotspot
cursorData.hotSpot = new Point(15,15);
// we pass the cursor bitmap to a BitmapData Vector
var bitmapDatas:Vector.<BitmapData> = new Vector.<BitmapData>(1, true);
// we create the bitmap cursor (bitmaps should not be bigger than 32x32 pixels, this is an OS limitation)
var bitmap:Bitmap = new zoomCursor();
// we pass it to the bitmapDatas vector
bitmapDatas[0] = bitmap.bitmapData;
// we assign the bitmap to the MouseCursor object
cursorData.data = bitmapDatas;
// we register the MouseCursorData to the Mouse with an alias
Mouse.registerCursor("myCursor", cursorData);
// whenever we neeed to show it, we pass the alias to the existing cursor property
Mouse.cursor = "myCursor";

Pretty cool? But wait, there is even better, you can also pass a series of BitmapData objects, then pass a specific frame rate and get automatic native animated cursor:

// we create a MouseCursorData object
var cursorData:MouseCursorData = new MouseCursorData();
// we specify the hotspot
cursorData.hotSpot = new Point(15,15);
// we pass the cursors bitmap to a BitmapData Vector
var bitmapDatas:Vector.<BitmapData> = new Vector.<BitmapData>(3, true);
// we create the bitmap cursor frames (bitmaps should not be bigger than 32x32 pixels, this is an OS limitation)
var frame1Bitmap:Bitmap = new frame1();
var frame2Bitmap:Bitmap = new frame2();
var frame3Bitmap:Bitmap = new frame3();
// we pass it to the bitmapDatas vector
bitmapDatas[0] = frame1Bitmap.bitmapData;
bitmapDatas[1] = frame2Bitmap.bitmapData;
bitmapDatas[2] = frame3Bitmap.bitmapData;
// we assign the bitmap to the MouseCursor object
cursorData.data = bitmapDatas;
// we register the MouseCursorData to the Mouse
Mouse.registerCursor("myAnimatedCursor", cursorData);
// we just pas a frame rate
cursorData.frameRate = 1;
// whenever we neeed to show it, we pass the alias to the existing cursor property
Mouse.cursor = "myAnimatedCursor";

Very simple, but so cool. Game and RIA developers will love this feature.

Another addition, we enhanced the full screen behavior by allowing one screen to stay full screen while working on the other screen. This feature was also highly requested by the community and video industry. Very nice feature for Hulu, YouTube and other video websites. ;)

A lot of people expressed the need to actually detect if the current context allowed the SWF to go full screen. This would allow you to detect this at runtime and react appropriately. Departing from Flash Player 10.2, you will be able to use the allowFullscreen property on stage:

if ( !stage.allowFullScreen )
throw new Error ("Please use the allowFullScreen HTML tag.");

Finally, a little improvement regarding Flash Player version info in the context menu, Here is what you have today when right click, no way to know which exact version you have running :

Flash Player version info before 10.2

Here is what you will get starting from 10.2 :

Flash Player version info starting from 10.2

I agree, it was about time. But yes, way easier now ;)

To use those new APIs you need to use the special build 18623 of the Flex SDK 4.5, from the Hero Stable Builds table here.
You also need to use a specific compiler argument –swf-version=11 to target SWF11.

I hope you guys will enjoy those features. Give it a try and let us know about bugs or any feedback you may have, thanks!



76 Responses to “Introducing Flash Player 10.2 Beta!”

  1. three says:

    The wewaii game have kind of question run flash player10.2

  2. Flash you have a beautiful future boy….. Another thing Flash camp @ chennai(INDIA) … in my native town…… ooohhhh going enjoy Dec 11

  3. g says:

    I found that some pixel-perfect collision detection is bugged in this version of flash.

    Can we test these new features with Flash CS5?

  4. Thibault Imbert says:

    Hi g,

    Can you please describe the steps to reproduce, so that I can follow up on the bug. Thanks a lot!

    Thibault

  5. [...] has recently launched a new version of the Flash Player. 10.2 beta addressed some of the problems, including power consumption as well as hogging of system resources. Given the advances of HTML5, [...]

     
  6. dimpiax says:

    Hi Thibault!
    I have this error:
    TypeError: Error #1006: registerCursor is not a function.
    atCursorTest/createStaticView()
    atCursorTest()

    How to solve this trouble?
    Thanx!

  7. dimpiax says:

    Hm, when I “Debug” in FDT – it runs ok,
    but with “Run” – fail!
    Why? What is different??

  8. Thibault Imbert says:

    Hi Dimpiax,

    Make sure you use the –swf-version=11 compiler to target SWF11 APIs.

    Let me know,

    Thibault

  9. dimpiax says:

    Certainly, I compile with argument:
    -swf-version=11.
    Here is:
    -static-link-runtime-shared-libraries=true
    -target-player={playerVersion}
    -library-path+=”{flexSDK}/frameworks/locale/en_US”
    -default-size=550,400
    -swf-version=11

    Difference in run compiling, between “Debug” and “Run”.

  10. dimpiax says:

    Same with StageVideoAvailabilityEvent class.

    VerifyError: Error #1014: Class flash.events::StageVideoAvailabilityEvent could not be found. =/

  11. mac fan says:

    hi, thibault!
    i am transcribing your video @http://blog.theflashblog.com/?p=2468. but there are some parts i cannot understand. can you help me? here are some of’em:
    on 0:24 (and the guy [...] is a mole.)
    on 0:34 (it’s like what we call [...] direct path)
    on 0:42 (t actually composite that in the [...] )
    on 0:49 (sitting behind the [...] which is CPU-composited.)
    on 0:53 (we have the [...] on the GPU core)
    on [1:28] (and… you’ll be able to have content covering the 3-D, 2-D tandem covering the 3-D [...])
    on 4:19 (articles about like [...] or [...] shaders because is gonna give you a better idea of). and there are a couple of others.

  12. mac fan says:

    ( by the way, sorry for posting under wrong page :S )

  13. Thibault Imbert says:

    Hi mac fan,

    No worries!

    Details inline :

    on 0:24 (and the guy [...] is a mole.)
    and the guy, our lead engineer is a mole.

    on 0:34 (it’s like what we call [...] direct path)
    it’s like what we call internally, the direct path

    on 0:42 (t actually composite that in the [...] )
    to actually composite that in the display list

    on 0:49 (sitting behind the [...] which is CPU-composited.)
    sitting behind the display-list which is CPU-composited.)

    on 0:53 (we have the [...] on the GPU core)
    as soon as we have data on the gpu card memory

    on [1:28] (and… you’ll be able to have content covering the 3-D, 2-D tandem covering the 3-D [...])
    and… you’ll be able to have content covering the 3-D, 2-D tandem covering the 3-D content.

    on 4:19 (articles about like [...] or [...] shaders because is gonna give you a better idea of). and there are a couple of others.)
    articles about like GLSL or ARB shaders because is gonna give you a better idea of). and there are a couple of others.

    Hope it helps!

    Thibault

  14. mac fan says:

    thibault, sooo much thanks for your answer. and if i’m not too much, i finally request you help me with these parts:
    3:12 – some more [...] APIs
    4:38 – from the [...] triangle
    5:24 – and [...] that on the GPU
    5:58 – so [...] at 60 Hz
    6:21 – gonna be really [...] a lot of people
    6:50 – the 3D [...] as easy as [...] 2D
    7:09 – -hey, buddy! -hey! -[...] -no more milk.(i think the guy asks smt.)
    8:13 – when and what kind of APIs [...] for people
    8:18 – you know very simple flash [...] APIs.
    8:48 – yes, [...] this coming pretty soon.
    8:54 – yes, [...] bye.
    i’m looking forward for your answer…

  15. Andreas says:

    In combination with an Nvidia card and Ubuntu 10.04 Linux it doesn’t accelerate anything. Framerate is lousy regardless of activated StageVideo. Still some work to do for Adobe.

  16. [...] a month ago, Flash Player 10.2 was announced.  Lost in all the hoopla about the upcoming Flash Player 11 with low-level 3-D APIs [...]

     
  17. Andreas says:

    Yes, I use the VDPAU library in combination with XBMC and it works really well – but not for Flash, for whatever reason.

  18. [...] more about it: http://www.bytearray.org/?p=2373 No Comments by Elliot Mebane  /  December 28, 2010  /  Posted in: Adobe, [...]

     
  19. joe says:

    Yes cpu usage of flash is way down, but the kernel_task is still eating loads of cpu, at least on the latest MBP 13″ and MBAs.

    kernel_task using 20-25% cpu while playing back youtube stagevideo, even after having waited for the whole file to load, so its not due to the airport driver while downloading.

  20. [...] covered the list of features a few weeks ago, Flash Player 10.2 ships with Stage Video for high performance video playback and also the very [...]

     
  21. [...] covered the list of features a few weeks ago, Flash Player 10.2 ships with Stage Video for high performance video playback and also the very [...]

     
  22. Kolnedra says:

    Just like g, pete and Hector asked.
    How can I use these new 10.2 features when compiling in CS5?

  23. [...] подробно о нововведениях можно узнать здесь – http://www.bytearray.org/?p=2373 Share this:TwitterFacebookLike this:LikeBe the first to like [...]

     
  24. website says:

    website…

    Introducing Flash Player 10.2 Beta! – ByteArray.org…

     

Leave a Reply

Open Sort Options

Sort comments by:
  • * Applied after refresh

ByteArray.org
Fun with code since 2006.