0 Replies Latest reply on Nov 17, 2010 6:13 AM by Yogev S. & Gadi S.

    "NetStream not found" when compiling with AIR (e.g - facebook movies)

    Yogev S. & Gadi S.

      this url for example would fail: “http://video.ak.fbcdn.net/cfs-ak-snc6/78746/156/463801063878_52985.mp4″

      this url for would work:"http://adobe.edgeboss.net/download/adobe/adobetv/platform_evangelism/believe.mp4"

      Any ideas?

       

      • if compiling for FlashPlayer (any version) it will work perfectly.

       

      Here is a simple video player script with a facebookVideoURL (fails in AIR) and notFacebookVideoURL(Works)

       

      import flash.net.NetConnection;
      import flash.media.Video;
      import flash.net.NetStream;
      
      
      var facebookVideoURL:String = "http://video.ak.fbcdn.net/cfs-ak-snc6/78746/156/463801063878_52985.mp4"
      var notFacebookVideoURL:String = "http://adobe.edgeboss.net/download/adobe/adobetv/platform_evangelism/believe.mp4"
      var videoURL:String = facebookVideoURL;
      
      
      var connection:NetConnection = new NetConnection();
      connection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
      connection.connect(null);
      
      
      function netStatusHandler(event:NetStatusEvent):void
      {
          switch (event.info.code)
          {
              case "NetConnection.Connect.Success":
                  connectStream();
                  break;
      
      
          case "NetStream.Play.StreamNotFound":
              trace("Stream not found: " + videoURL);
              break;
      }
      
      
      
      
      }
      
      
      
      function connectStream():void
      {
          var stream:NetStream = new NetStream(connection);
          stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
      
      
      
      var video:Video = new Video();
      video.attachNetStream(stream);
      addChild(video);
      
      stream.play(videoURL);
      
      
      
      
      }