0

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

Abhishek
  • 157
  • 1
  • 4
  • 13

1 Answers1

1

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>
Serge Him
  • 936
  • 6
  • 8
  • I tried this but it didn't worked for me. What worked was this vid_player.videoDisplay.parent.getChildAt(1).visible = true. Yes but i checked it in a new project and your solution works there , so some issue with my code. – Abhishek Jan 17 '13 at 16:31
  • I have experienced another issue on this . have edited the question – Abhishek Jan 17 '13 at 16:40