简体   繁体   中英

Flex - spark.components.VideoPlayer - set alpha on source(?) or skin property

Long time consumer, first time poster. I posted this question in another forum but have had no luck in getting an answer, so I thought I'd turn to my "go-to-problem-solving" forum.

I'm having an issue but am not sure where the problem lies, as I'm newish to the spark video player. In Flex, I have a .flv that has been rendered with a transparent background. If I use the FLVPlayback component in Flash, the video plays as expected and the transparency in the video source displays fine. When I take the same video and set it as a source in the Spark video player, the background is black. I know that utilizing the FLVPlayback component would solve my issue, but this is out of the scope of my current project.

My question is: Does anyone know if this is the result of the Spark video player not rendering the alpha channel in the video, or is this part of the Video player skin that needs to be tweaked? or is this a combination of both notions. And how would I go about correcting the issue?

Thanks for any help, and much appreciation for reading,

~Chipleh

I haven't tested this, but couldn't you just set opaqueBackground=null on the VideoDisplay component inside the player? http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/DisplayObject.html#opaqueBackground

It is likely the skin for the VideoPlayer . Take a look at the VideoPlayerSkin class, it has defined this rectangle (among other things) that gives it a black background:

  <!-- background when the videoDisplay doesn't fill its whole spot -->
            <s:Rect bottom="1" left="1" right="1" top="1"
                    bottom.fullScreenStates="0" left.fullScreenStates="0" 
                    right.fullScreenStates="0" top.fullScreenStates="0">
                <s:fill>
                    <s:SolidColor color="0x000000" />
                </s:fill>
            </s:Rect>

You can create your own skin that is based off of VideoPlayerSkin and set the alpha to of that SolidColor to 0.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM