Skip to main content
September 23, 2010
Answered

How to play live Video Stream with Flex?

  • September 23, 2010
  • 1 reply
  • 3291 views

I'm trying to get Flex Builder 3 to play a live video stream with Flash Media
Server and Flash Live Media Encoder.

I'm able to stream pre-recrorded (vod) flvs in flex from flash media server.

I'm able to stream live video using Flash/FMS/Flas Live Media Encoder, but not
with Flex.

This code streams pre-recorded Video on Demand flvs, but not live streams:

If I change source to "rtmp://localhost/live/livesream.flv, I get nothing.

What am I doing wrong?

<?xml version="1.0"?>
<!-- controls\videodisplay\VideoDisplayFMS.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

    <mx:HBox>
        <mx:Label text="RTMP FMS 2.0"/>
        <mx:VideoDisplay
            autoBandWidthDetection="false"
            source="rtmp://localhost/vod/Legend.flv"/>
    </mx:HBox>
</mx:Application>

Oh and sorry for the double post. I didn't know there was a seperate FMS forum.

    This topic has been closed for replies.
    Correct answer

    I don't use the video display component, but it does have a "live" property. Try setting that to true. if it still doesn't work, try removing the .flv extension from the stream name.

    1 reply

    Correct answer
    September 23, 2010

    I don't use the video display component, but it does have a "live" property. Try setting that to true. if it still doesn't work, try removing the .flv extension from the stream name.

    September 23, 2010

    That worked! Thanks  *very* much. Stupid of me to forget to set the live attribute to true. Also removed the .flv. BTW: what video component do you prefer?

    Here's the working code:


    <?xml version="1.0"?>
    <!-- controls\videodisplay\VideoDisplayFMS.mxml -->
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

        <mx:HBox>
            <mx:VideoDisplay
                live="true"
                autoBandWidthDetection="false"
                source="rtmp://localhost/live/livestream"/>
        </mx:HBox>
    </mx:Application>

    September 23, 2010

    I tend to roll my own components that extend UIComponent, and just use a video object for display. Saves me a lot of time as compared to beating the prefabricated components into submission