2017-05-05 1 views
0

ラジオ局用のアプリを作成しようとしていますが、同じエラーが発生しています。ウェブサイトからmp3オーディオストリーミングURLを取得するには?

これは私に与えられたものです。

http://www.tantalk1340.com/wp-content/plugins/shoutcast-icecast-html5-radio-player/html5/html5icecast.php?id=7&caching=201&rand=2/

+0

どのようなエラーが表示されますか?あなたはこれをワンオフ、またはプログラムで行うことを試みていますか?ワンオフの場合は、デベロッパーツールでネットワークリクエストを監視し、実際のストリーミングURLを探します。 (このURLはWebページのためのものです。)プログラムで実行する場合は、HTMLを解析する必要があります。 – Brad

答えて

0

それはあなたのプレイヤーとHTMLページを生成しますリンクを提供します。あなたはリンクを開くことができ、それはかなり良いjavascriptコードを持っています。以下は、ストリームを取得する方法を言ったスニペットです:

   var currentTime = Date.now() || +new Date(); 

       var stream = { 
        title: "Tan Talk 1340 AM", 
        mp3: "http://home.besedic.com:8000/live?hash="+currentTime 
       }, 
       ready = false; 

       jQuery("#jquery_jplayer_1").jPlayer({ 
        ready: function (event) { 
         ready = true; 

         if(autoplayz==false) 
         jQuery(this).jPlayer("setMedia", stream); 
         else 
         jQuery(this).jPlayer("setMedia", stream).jPlayer("play"); 


        }, 
        pause: function() { 
         jQuery(this).jPlayer("clearMedia"); 
        }, 
        error: function(event) { 
         if(ready && event.jPlayer.error.type === jQuery.jPlayer.error.URL_NOT_SET) { 
          // Setup the media stream again and play it. 
          jQuery(this).jPlayer("setMedia", stream).jPlayer("play"); 
         } 
        }, 
        swfPath: "js", 
        supplied: "mp3", 
        preload: "auto", 
        wmode: "window", 
        /*autoPlay: true,*/ 
        solution:"flash,html", 
        volume: vol/100, 
        keyEnabled: true 
       }); 

それはスニペットから明確でない場合は、URLは次のとおりです。 ます。http://home.besedic.com:?8000 /生きるハッシュ= + CURRENTTIME

image

関連する問題