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은 웹 페이지 용입니다.) 프로그래밍 방식으로 수행하는 경우 HTML을 구문 분석해야합니다. – Brad

답변

0

그것은 당신에게 플레이어와 HTML 페이지를 생성 링크를 제공합니다. 당신은 링크를 열 수 있고 꽤 좋은 자바 스크립트 코드가 있습니다. 다음은 스트림 얻는 방법을 말했다 조각이다 : 그것은 조각에서 명확하지 않으면

   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

관련 문제