Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7092075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:16:04+00:00 2026-05-28T08:16:04+00:00

Below is a basic code bit in as3 flash.A simple video streaming example using

  • 0

Below is a basic code bit in as3 flash.A simple video streaming example using rtmp red5. But i seem to be having issues connecting to the stream.I am using the same video files as given with the red5 server demo installation.( i have verified the installed demo of ofla by running it properly)
my output trace traces out as a connection success and the play start of the video file. But i am unable to get its metadata or get it actually playing.

netStatusHandler NetConnection.Connect.Success

netStatusHandler NetStream.Play.Reset

netStatusHandler NetStream.Play.Start

what am i missing here in regards to giving the path to the video file ? they are located in the same demo example folder which come with the default red5 installation.

package 
{
    import flash.display.*;
    import flash.events.*;
    import flash.media.*;
    import flash.net.*



    public class NetConnectionExample extends MovieClip
    {
        private var videoURL:String = "rtmp://localhost/oflaDemo/streams";
        private var connection:NetConnection;
        private var stream:NetStream;
        public function NetConnectionExample()
        {
            // constructor code
            connection = new NetConnection();
            connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
            connection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
            connection.connect(videoURL, true);
        }
        private function netStatusHandler(event:NetStatusEvent):void
        {
            trace("netStatusHandler",event.info.code);
            switch (event.info.code)
            {
                case "NetConnection.Connect.Success":
                    connectStream();
                    break;
                case "NetStream.Play.StreamNotFound":
                    trace("Stream not found: " + videoURL);
                    break;
                case "NetStream.Play.Start":
                break;
            }
        }

        private function securityErrorHandler(event:SecurityErrorEvent):void
        {
            trace("securityErrorHandler: " + event);
        }

        private function connectStream():void
        {
            stream = new NetStream(this.connection);
            stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
            stream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler)
            stream.client = new CustomClient();
            var video:Video = new Video();
            video.attachNetStream(stream);
            stream.play(videoURL+"avatar.flv");
            addChild(video);
        }
        function asyncErrorHandler(event:AsyncErrorEvent):void {
            // ignore AsyncErrorEvent events.
        }

    }
}

class CustomClient {
public function onMetaData(info:Object):void
{
    trace("metadata: duration=" + info.duration + " width=" + info.width + " height=" + info.height + " framerate=" + info.framerate);
}
public function onCuePoint(info:Object):void
{
    trace("cuepoint: time=" + info.time + " name=" + info.name + " type=" + info.type);
}
}

Edit:
Related
Where do I place a FLV file to stream on a local Red5 server?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T08:16:05+00:00Added an answer on May 28, 2026 at 8:16 am

    It was a path issue. the rtmp video folder of the application called oflaDemo is named streams.
    giving the path like so

     private var videoURL:String = "rtmp://localhost/oflaDemo";
    

    and directly the file name after connecting the stream. works

     stream.play("avatar.flv");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a basic PHP question, take the code below for example, let's say
In below code i'm doing somthing wrong. Sorry if this is a bit basic.
Below I have a very simple example of what I'm trying to do. I
Below is the code of a simple html with a table layout. In FF
I have the below code but for some reason I cannot get the correct
The basic code that I have so far is below. How do I thread
I've placed some very basic code below of what I'm trying to do. I
I am new to Prolog. I wrote the basic code below. flight(acompany, paris, 7).
ok, this seems like it should be really simple but Im a bit confused:
Below is my way, albeit a basic way of creating a Decision Tree...The problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.