title: embed live RTMP stream in html with flowplayer(nginx-rtmp-module)
body: <p>I have an nginx server with the rtmp-module. I am using ffmpeg to transcode from rtsp to rtmp. I'm able to view the live stream with VLC but I am unable to embed the video in html. Here is my nginx.conf:</p>
  
  <pre><code>worker_processes  1;
   events {
      worker_connections  1024;
   }
   # HTTP server
   http {
      include       mime.types;
      default_type application/octet-stream;
      sendfile        on;
      keepalive_timeout  65;
      server {
          listen       80;
          server_name  localhost;
          location / {
              root   html;
              index  index.html index.htm;
          }
          # path to HLS application service
             location /media_server {
              types {
                  application/vnd.apple.mpegurl m3u8;
                  video/mp2t ts;
              }
              root /usr/local/nginx-streaming/html;
              add_header Cache-Control no-cache;
          }
          # redirect server error pages to the static page /50x.html
          error_page   500 502 503 504  /50x.html;
          location = /50x.html {
              root   html;
          }
      }
   }
   # RTMP media server
   rtmp {
      server {
          listen 1935;
          chunk_size 4000;
          # Transcoding (ffmpeg needed)
          application media_server {
              live on;
              hls on;
              hls_path /usr/local/nginx-streaming/html/media_server;
              hls_nested on;
              hls_variant _low  BANDWIDTH=640000;
              hls_variant _hi  BANDWIDTH=2140000;
              # ffmpeg static execution
              exec_static /usr/bin/ffmpeg -rtsp_transport tcp -i rtsp://myipaddress:554 -framerate 6 -video_size 1280x720 -vcodec libx264 -preset veryfast -maxrate 6144k -bufsize 3968k -pix_fmt yuv420p -g 60 -c:a aac -b:a 128k -ar 44100 -f flv rtmp://localhost/media_server/test;
          }
      }
   }
  </code></pre>
  
  <p>here is my html:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;&lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;meta charset="utf-8"&gt;
  
      &lt;!-- for video tag based installs flowplayer depends on jQuery 1.7.2+ --&gt;
      &lt;script src="https://code.jquery.com/jquery-1.11.2.min.js"&gt;&lt;/script&gt;
  
      &lt;!--
          include flowplayer JavaScript file that does
          Flash embedding and provides the Flowplayer API.
      --&gt;
      &lt;script type="text/javascript" src="http://releases.flowplayer.org/js/flowplayer-3.2.13.min.js"&gt;&lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;
      &lt;!-- widescreen container, 1280x720 (clip dimensions) * 1.15, center splash --&gt;
      &lt;div id="theplayer" style="width:512px;height:288px;margin:0 auto;text-align:center"&gt;&lt;object id="theplayer_api" name="theplayer_api" data="http://releases.flowplayer.org/swf/flowplayer-3.2.18.swf" type="application/x-shockwave-flash" width="100%" height="100%"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;param name="quality" value="high"&gt;&lt;param name="bgcolor" value="#000000"&gt;&lt;param name="flashvars" value="config={&amp;quot;clip&amp;quot;:{&amp;quot;url&amp;quot;:&amp;quot;test&amp;quot;,&amp;quot;live&amp;quot;:true,&amp;quot;scaling&amp;quot;:&amp;quot;fit&amp;quot;,&amp;quot;provider&amp;quot;:&amp;quot;rtmp&amp;quot;},&amp;quot;plugins&amp;quot;:{&amp;quot;rtmp&amp;quot;:{&amp;quot;url&amp;quot;:&amp;quot;http://releases.flowplayer.org/swf/flowplayer.rtmp-3.2.13.swf&amp;quot;,&amp;quot;netConnectionUrl&amp;quot;:&amp;quot;rtmp://localhost:1935/media_server/telesanremo&amp;quot;},&amp;quot;controls&amp;quot;:{&amp;quot;url&amp;quot;:&amp;quot;http://releases.flowplayer.org/swf/flowplayer.controls-3.2.16.swf&amp;quot;}},&amp;quot;playerId&amp;quot;:&amp;quot;theplayer&amp;quot;,&amp;quot;playlist&amp;quot;:[{&amp;quot;url&amp;quot;:&amp;quot;test&amp;quot;,&amp;quot;live&amp;quot;:true,&amp;quot;scaling&amp;quot;:&amp;quot;fit&amp;quot;,&amp;quot;provider&amp;quot;:&amp;quot;rtmp&amp;quot;}]}"&gt;&lt;/object&gt;&lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
      $f("theplayer", "http://releases.flowplayer.org/swf/flowplayer-3.2.18.swf", {
  
      clip: {
          url: 'test', 
          live: 'true', 
          provider: 'rtmp' 
      },
      plugins: {
          rtmp: {
              url: 'flowplayer.rtmp-3.2.13.swf', 
              netConnectionUrl: 'rtmp://localhost:1935/media_server'
          } 
      } 
      });
  &lt;/script&gt;
  
  
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p>the error i get is:</p>
  
  <blockquote>
    <p>201: unable to load stream or clip file connection failed</p>
  </blockquote>
  
  <p>What am i doing wrong?</p>