2 Replies Latest reply on Feb 20, 2009 1:16 PM by dersler

    builiding an flv player in Action script

    dnareshkumar Level 1
      Hello all,
      I have been trying to use fl.flvPlayer class in action script to create an flvplayer but could not find example scripts for the same anywhere. I am working on Flex Builder 3 and have tried to followed the examples given by Adobe for creating a simple player. No success. I figured out fl. extensions wont be loaded by default in Action Script. Can some one tell me the reason. (I have already got a work around for it but isnt the fl extension a default with the Action Script3??).
      Any help or direction required.
        • 1. Re: builiding an flv player in Action script
          Gregory Lafrance Level 6
          How about just using VideoDisplay component?
          • 2. Re: builiding an flv player in Action script
            dersler Level 1
            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
            layout="horizontal"
            verticalAlign="middle"
            backgroundColor="white" viewSourceURL="srcview/index.html">

            <mx:Script>
            <![CDATA[
            import mx.collections.ArrayCollection;
            import mx.events.VideoEvent;

            [Bindable]
            private var arrColl:ArrayCollection = new ArrayCollection();

            private const VIDEO_URL:String = "name.flv";

            private function videoDisplay_stateChange(evt:VideoEvent):void {
            /* videoDisplay.state == evt.state */
            arrColl.addItem({label:videoDisplay.state});
            progressBar.label = evt.state;
            }

            private function button_click(evt:MouseEvent):void {
            /* Reset ArrayCollection object. */
            arrColl = new ArrayCollection();
            /* Set the Canvas container to visible. */
            canvas.visible = true;
            /* If video is currently playing, stop playback. */
            if (videoDisplay.playing) {
            videoDisplay.stop();
            }
            /* Set VideoDisplay control's source property and start
            video playback. */
            videoDisplay.source = VIDEO_URL;
            videoDisplay.play();
            }

            private function videoDisplay_playheadUpdate(evt:VideoEvent):void {
            progressBar.setProgress(evt.playheadTime, videoDisplay.totalTime);
            }
            ]]>
            </mx:Script>

            <mx:ApplicationControlBar dock="true">
            <mx:Button id="button"
            label="load movie"
            click="button_click(event);" />
            </mx:ApplicationControlBar>

            <mx:Canvas id="canvas" visible="false">
            <mx:VideoDisplay id="videoDisplay"
            playheadUpdateInterval="50"
            stateChange="videoDisplay_stateChange(event);"
            playheadUpdate="videoDisplay_playheadUpdate(event);" />

            <mx:ProgressBar id="progressBar"
            label=""
            labelPlacement="center"
            mode="manual"
            bottom="0"
            horizontalCenter="0" />
            </mx:Canvas>

            <mx:List id="list"
            dataProvider="{arrColl}"
            width="100" />

            </mx:Application>

            copy this code, I did not write
            i'm web page
            paslanmaz boru