Skip to main content
Participant
November 26, 2013
Question

NetStream.Play.StreamNotFound when connecting to my AMS

  • November 26, 2013
  • 1 reply
  • 2340 views

When I try and connect to the video on my AMS using Flash and AS3 I keep getting NetStream.PLay.StreamNotFound

The exact same video streams on the AMS home page.

I can stream from http://www.helpexamples.com/flash/video/cuepoints.flv but nothing from own server in flash.

Here is my code with the IP Address removed

import flash.media.Video;
var video:Video = new Video();
this.addChild(video);

var mNetConnection:NetConnection=new NetConnection();
mNetConnection.connect(null);

var mNetStream:NetStream=new NetStream(mNetConnection);       
video.attachNetStream(mNetStream);
mNetStream.play("rtmp://000.000.000.000/vod/mp4:sample1_1500kbps.f4v");       
mNetStream.client=this;
mNetStream.addEventListener(NetStatusEvent.NET_STATUS, onNetStreamStatusEvent);
mNetStream.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);

function onNetStreamStatusEvent(event:NetStatusEvent):void
{
     if (event.info.code == "NetStream.Play.Start")
     {
          trace("NetStream.Play.Start");       
     }
     if (event.info.code == "NetStream.Play.StreamNotFound")
     {
          trace("Video Not Found");       
     }   
     if (event.info.code == "NetStream.Buffer.Full")
     {           
     }
}

function onMetaData(metadata:Object):void
{
}

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

    This topic has been closed for replies.

    1 reply

    Participant
    November 26, 2013

    Ok founbd a way to adjust the code to work with a f4v file over rtmp.

    However I am still not able to stream from an f4m. Can someone help?

    import flash.media.Video;
    var nc:NetConnection = null;
    var video:Video = null;
    var mNetStream:NetStream = null;
    
    video = new Video();
    this.addChild(video);
    
    nc=new NetConnection();
    nc.addEventListener(NetStatusEvent.NET_STATUS, onNetStatus);
    nc.connect("rtmp://000.000.000.000/vod");
    nc.client = this;
    
    
    function onNetStatus(event:NetStatusEvent):void
    {
         //Trace the value of event.info.code
         trace( event.info.code );
         /*Check for a successful NetConnection, and if successful
         call publishCamera(), displayPublishingVideo(), and displayPlaybackVideo()*/
         if( event.info.code == "NetConnection.Connect.Success" )
         { 
              mNetStream=new NetStream(nc);       
              video.attachNetStream(mNetStream);
              mNetStream.play("mp4:sample1_1500kbps.f4v");       
              mNetStream.client=this;
              mNetStream.addEventListener(NetStatusEvent.NET_STATUS, onNetStreamStatusEvent);
              mNetStream.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
         }
    }
    
    function onNetStreamStatusEvent(event:NetStatusEvent):void
    {
         if (event.info.code == "NetStream.Play.Start")
         {
              trace("NetStream.Play.Start");       
         }
         if (event.info.code == "NetStream.Play.StreamNotFound")
         {
              trace("Video Not Found");       
         }   
         if (event.info.code == "NetStream.Buffer.Full")
         {           
         }
    }
    
    function onMetaData(metadata:Object):void
    {
    }
    
    function securityErrorHandler(event:SecurityErrorEvent):void {
         trace("securityErrorHandler: " + event);
    }