Elliptical Video Display

There are cases where one might require the video to be, say elliptical, instead of the usual rectangular appearance, as below…

This is how to do it. A very easy trick, using the basic drawing APIs of Flash. We just create a mask and then ask the VideoDisplay to wear it. Follow the steps below…

  1. Create a Sprite instance (say myMask)
  2. Use the graphics APIs to draw the required mask – I have used beginFill() and drawRoundRect() functions on the myMask.graphics Object
  3. Set the x & y properties of the mask
  4. Add it to the VideoDisplay instance
  5. Set the mask property on the VideoDisplay instance to myMask

In my app, I have done the Sprite object generation and addition to the component, on creationComplete itself, as I am providing a way of dynamically changing the mask. Because of this, one will find a myMask.graphics.clear(), each time the applyMask() method runs… I have also added code to add drop-shadow to the Video, using the filters property, to increase the “Flex Appeal” 🙂

View the Application | Download Source

Advertisements

4 Responses to Elliptical Video Display

  1. abhishek says:

    its really good , its working

  2. Neeta says:

    really nice…..cool stuff 🙂

  3. prasanth says:

    Hey Rqaghu
    I am trying to build a player in Flex which streams video from an Akamai server.I tried to work with netConnection and net Stream but i am getting a connection refused error. Can u help me regarding this

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s