<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:ns1="com.mh.components.*" horizontalAlign="center" verticalAlign="top" backgroundGradientColors="[#666666, #3f3f3f]">
    

    
    <mx:Panel layout="absolute" title="Buffered Video">
        
        <!--
        * Buffering video display
        * testFile - the file to download in order to sample the users bandwidth
        -->
        <ns1:BufferingVideoDisplay id="bvd" 
            source="http://www.munkiihouse.com/wp-content/uploads/fotc.flv" 
            testFile="http://www.munkiihouse.com/wp-content/uploads/codemonkey.bmp"  
            width="320" height="240"/>
        
        
        <mx:ControlBar>            
            <mx:VBox width="100%">
            
                <mx:Canvas width="100%" >
                    <mx:ProgressBar labelPlacement="center" width="100%" mode="event" source="bvd"  label=" "/>            
                    <mx:HSlider minimum="0" maximum="{bvd.totalTime}" value="{bvd.playheadTime}" enabled="false" allowTrackClick="false" invertThumbDirection="true" left="-4" right="-4"/>        
                </mx:Canvas>                
                        
                <mx:HBox width="100%" horizontalAlign="center">
                    <mx:Button label="Play" click="{bvd.play()}"/>
                    <mx:Button label="Pause" click="{bvd.pause()}"/>
                    <mx:Button label="Stop" click="{bvd.stop()}"/>
                </mx:HBox>                
            </mx:VBox>
        </mx:ControlBar>
    </mx:Panel>
    
    
    <!--
    * Information Panel
    -->
    <mx:Panel width="340" layout="vertical" title="Details" paddingBottom="10" paddingLeft="10" paddingRight="10" paddingTop="10">
        <mx:FormItem label="Speed Test" width="100%" labelWidth="100">
            <mx:ProgressBar label="TESTING %3%%" labelPlacement="center" width="100%" mode="event" source="{bvd.bandwidthTester}"/>            
        </mx:FormItem>
        <mx:FormItem label="Bandwidth" width="100%" labelWidth="100">
            <mx:TextInput width="100%" editable="false" text="{bvd.bandwidth}"/>
        </mx:FormItem>
        <mx:FormItem label="Bitrate" width="100%" labelWidth="100">
            <mx:TextInput width="100%" editable="false" text="{bvd.bitrate}"/>
        </mx:FormItem>
        <mx:FormItem label="Required buffer" width="100%" labelWidth="100">
            <mx:TextInput width="100%" editable="false" text="{bvd.bufferTime}"/>
        </mx:FormItem>
    </mx:Panel>
    
    
    
    
</mx:Application>