0 Replies Latest reply on Nov 18, 2009 10:40 AM by avphillips

    Change in Behavior of NetStream in AIR 2 (GET to POST)

    avphillips

      I was all excited about the release of AIR 2 beta yesterday, with  the new socket support and improved h.264 encoding I was looking forward  to upgrading some applications . So I went and upgraded one of my  larger applications to AIR 2 to start the porting process since it would  benefit the most. Everything went well till I tried to play video from a  UPNP source, I was getting StreamNotFound errors. After a few hours of  debugging and reading the Beta documentation I tracked down the issue,  there was a change in behavior in how a request for videos over HTTP  occurs from a GET to a POST.

      I wasn't sure what this came from (AIR 2b or Flash 10.1b) but  wondered if anyone else noticed this small but significant change. I  guess my next step will be creating a bug in JIRA, just wanted to put it  out on the list.

      Here's the rundown:
      - Flex 3.4.1.10084 for both
      - Air  Versions: 1.5.2 vs 2.0B
      -
      X-Flash-Versions: 10,0,32,18  vs 10,1,50,334


      Smallest Reproducible Code:

      protected function runTest() : void{
           var metaListener : Object = new Object();
          var netConn :  NetConnection = new NetConnection();
          netConn.connect(null);
          
          // init the stream
           var stream : NetStream = new NetStream(netConn);
           stream.addEventListener(NetStatusEvent.NET_STATUS,  netStatusHandler);
          metaListener.onMetaData = theMeta;
           stream.client = metaListener;
          stream.play( <PUT SOME VIDEO  URL HERE> );
      }

      protected function netStatusHandler( event : NetStatusEvent) :  void{
          trace("netStatusHandler: " + event.type + " " +  event.info.code);
      }

      protected function  theMeta(data:Object):void {
           trace("Duration: " + data.duration + " Position: " +  data.moovposition);
      }

      Example request from Apache Log:

      -------   FROM 1.5.2
      <ipremoved> - - [18/Nov/2009:10:36:27 -0500]  "GET /mp4/shaun.mp4 HTTP/1.1" 200 46272134
      -------  FROM 2.0B
      <ipremoved>  - - [18/Nov/2009:10:35:10 -0500] "POST /mp4/shaun.mp4 HTTP/1.1" 200  46272134

      Example request from Twonky Media Server Log:

      -------    FROM 1.5.2
      11:12:46:043 LOG_HTTP:HTTP_send_receive GET  /disk/video/O0$3$24I49/Robots.m4v HTTP/1.1
      Host: 127.0.0.1:9000
      User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en)  AppleWebKit/526.9+ (KHTML, like Gecko) AdobeAIR/1.5.2
      Referer: app:/VideoBreakAIR.swf
      X-Flash-Version: 10,0,32,18
      Accept: */*
      Accept-Language: en-us
      Accept-Encoding: gzip, deflate
      Connection: keep-alive

      -------  FROM 2.0B
      11:14:24:458 LOG_HTTP:HTTP_send_receive POST  /disk/video/O0$3$24I49/Robots.m4v HTTP/1.1
      Host: 127.0.0.1:9000
      User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en)  AppleWebKit/531.9 (KHTML, like Gecko) AdobeAIR/2.0
      Referer: app:/VideoBreakAIR2.swf
      X-Flash-Version: 10,1,50,334
      Accept: */*
      Accept-Language: en-us
      Accept-Encoding: gzip, deflate
      Content-Type: application/x-www-form-urlencoded
      Content-Length: 0
      Connection: keep-alive