Question

I have skinned the controls of the video player through VidoePlayerSkin. I need to play the video always in full screen and show / hide the controls on tap.

i can't access the VideoPlayerSkin class's controls group element in action script. What is the solution for this?

Edited further query This issue is solved but now if I want to use any controls the controls bar dissapears. It shouldn't when I click on an element inside the controls bar.? Any suggestions

Was it helpful?

Solution

This demo code show/hide controls of VideoPlayer by click. Is that what you want?

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx"
               creationComplete="init()">

    <s:VideoPlayer id="video" source="rtmp://fmsexamples.adobe.com/vod/mp4:_cs4promo_1000.f4v"
                   width="100%" height="100%"
                   loop="true"
                   autoPlay="true" />
    <s:Button label="fullscreen" click="{stage.displayState = stage.displayState == StageDisplayState.FULL_SCREEN ? StageDisplayState.NORMAL : StageDisplayState.FULL_SCREEN}"/>
    <fx:Script>
        <![CDATA[
            private function init():void
            {
                video.videoDisplay.addEventListener(MouseEvent.CLICK, onVideoClick);
            }
            private function onVideoClick(e:MouseEvent):void
            {
                video.playerControls.visible = !video.playerControls.visible;
            }
        ]]>
    </fx:Script>
</s:Application>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top