サーバーのポート 8080 で実行されているサービスから JSON オブジェクトを取得しようとしています。これを実現するために、次の JavaScript および PHP コードを実装しました。
JavaScript:
$.ajax({
    type: 'GET',
    url: "mediainfo.php?file="+stream_,
    dataType: 'json',
    success: play,
    error: function( xhr, reply ) {
       play({});
    }
});
mediainfo.php:
<?php
    $url = "http://localhost:8080/media_info/" . $_GET['file'];
    echo file_get_contents($url);
ただし、Ajax 呼び出しが成功した場合でも、コールバックは呼び出されません。奇妙なことに、失敗した場合 (たとえば、$url が有効な JSON を返さない場合)、コールバックが呼び出されます。
何が問題なのかわかりません。どんな助けでも大歓迎です。
編集:
コールバック関数:
var play = function( info ) {
     if ( info.width && info.height ) {
         while ( info.width < 640 ) {
             info.width = Math.round( info.width * 1.5 );
             info.height = Math.round( info.height * 1.5 );
         }
         while( info.width > 1024 ) {
             info.width = Math.round( info.width / 2 );
             info.height = Math.round( info.height / 2 );
         }
     }
     var width = info && info.width || 640;
     var height = info && info.height || 480;
     var flashvars = {
         file : stream,
         streamer : "rtmp://myserver.com:1935/vodplayback",
         'rtmp.tunneling' : false,
         bufferlength : 5,
         autostart : true
     };
     var paramObj = {allowfullscreen : "true", allowscriptaccess : "always"};
     swfobject.embedSWF("http://myserver.com:8080/flu/jwplayer.swf", "videoplayer", width, height, "10.3", false, flashvars, paramObj, {id : "jwplayer", name : "jwplayer"});
  }
mediinfo.php からの応答:
{"duration":69960.0,"width":720,"height":406}