2017-03-03 212 views
0

这是我在www.bmixup.com上为我的玩家编写的代码,正在播放来自icecast的流,我不明白,在我按下播放,串流播放之后,但有时候他会在我的浏览器中停止一切,如果我重新推上,没有任何反应,我是一定要重新载入我的所有网页....音频播放器html5播放按钮无法正常工作......?

<audio id="player" preload> 
      <source src="http://bmixup.com:8000/BmixupStream" type="audio/mpeg"></source> 
      Your browser does not support the <code>audio</code> tag. 
    </audio> 
    <div style="background-color: #808080;text->align:center;padding:20px;margin-right:0em;"> 
     <div class="buttonplayer" style="text-align: left;"> 
      <button id="play" type="button" >onclick="document.getElementById('player').play()" class="btn btn-default btn->circle btn-lg"><span class="glyphicon glyphicon-play"></span></button> 
      <button id="Pause" type="button" >onclick="document.getElementById('player').pause()" class="btn btn-default btn->"><span class="glyphicon glyphicon-pause"></span></button> 
      <button id="Voldown" type="button" >onclick="document.getElementById('player').volume -= 0.1" class="btn btn->default btn-circle btn-lg" ><span class="glyphicon glyphicon-volume-down">>>>></span></button>    
      <button id="Volup" type="button" onclick="document.getElementById('player').volume += 0.1" class="btn btn-default btn-circle btn-lg"><span class="glyphicon glyphicon-volume-up"></span></button> 
      <span> 
       <script type="text/javascript" src="/js/titre.js"></script> 
       <span id="track-title" style="font-family: exoregular;margin-left: 1em;color: #ffffff;"></span> 
       <marquee direction="left" scrolldelay="200" style="font-family: exoregular; margin-top: 0.7em;color: #ffffff;">Vous écouter actuellement Bmixup.com, The mix web radio et il y a actuellement : <span id="listeners" style="color: #ffffff;">00</span> auditeurs à l'écoute...Bonne écoute...</marquee> 
      </span> 
     </div> 
    </div> 
</div> 

什么是错的,打后为什么流站,不无是恒定的,于我停下来,为什么如果重新上场,那不是重新乞求...?

你能帮助我吗?..

谢谢...

回答

1

HTML5音频标签是相当稳定的,但流可能会因为网络问题(数据包丢失,连接问题等)中断。 最好的解决方案是使用HTML5音频播放器框架如jPlayerSoundManager2,捕捉流错误并强制播放器重新连接超时。