網站上的實時音頻流 (Live audio streaming on a website)


問題描述

網站上的實時音頻流 (Live audio streaming on a website)

I am trying to build a website for an internet radio station.  I would like to incorporate a feature that allows visitors to play the live audio stream on the website itself.

What technologies should I be looking at to get started?  How is this commonly done?  Is there a method that is often considered the best for live streaming?

‑‑‑‑‑

參考解法

方法 1:

Depending on the formats you stream to, you have a few options:

  • HTML5 Audio objects (codec compatibility varies from browser to browser and I am not aware of any format besides WAV that is cross‑compatible; if you have OGG and MP3 you should cover all current browsers supporting HTML5 Audio). This allows you to control audio through Javascript and is very lightweight in terms of implementation. This will probably work well with modern browsers, but will not be great for Internet Explorer users as not so many users switched to IE9. example stats
  • A Flash‑based player. This will allow you to stream MP3 or FLA audio. Development is clunkier than plain Javascript, but you probably have better penetration than HTML5 Audio. In my limited experience, the Flash player needs some time to initialize so the user experience is not as quick as with HTML5 Audio.
  • Native browser plugins. They are hacky, most likely don't work cross‑platform. Stay away if you can.

方法 2:

Flash is the most widely used for this, as evidenced by sites like NPR, and Bandcamp.

Java might also be a valid option if you are more of the programmer type.

Either way I recommend using the <object> tag, not <embed> or <applet>

For flash look at: http://www.alistapart.com/articles/flashsatay

For Java use something like:

<object width="" height=""
    type="application/x‑java‑applet"
    archive="containing.jar"
    classid="java:package.applet.class">
</object>

If, however you want to run from a folder, not a jar archive the codebase is added in as a <param /> not an attribute.

(by Brian RoisentulSorin MocanuHawken)

參考文件

  1. Live audio streaming on a website (CC BY‑SA 3.0/4.0)

#audio-streaming #internet-radio






相關問題

在 windows phone 7 應用程序中流式傳輸音頻 (Streaming audio in windows phone 7 app)

從 FFMPEG for android 的命令行版本訪問網絡攝像頭麥克風 (Accessing webcam mic from command line version of FFMPEG for android)

Siaran Langsung Node.js: Hindari buffering (Node.js Live Streaming: Avoid buffering)

Icecast 流媒體無法播放 (Icecast streamming not playing)

如何使用 NAudio 在 C# 中解碼 mp3 文件 (how to decode mp3 file in c# using NAudio)

在 Nodejs 中使用 Kurento 複合媒體元素進行音頻會議需要幫助 (Need help for audio conference using Kurento composite media element in Nodejs)

iPhone - 在顯示圖像時使用 UIWebView 流式傳輸音頻 (iPhone - streaming audio using UIWebView while displaying an image)

jQuery:跨瀏覽器問題——調試 Internet Explorer (jQuery: Cross-browser problem -- Debugging Internet Explorer)

在 xuggler 中轉發和倒帶音頻 (forwarding and rewinding audio in xuggler)

網站上的實時音頻流 (Live audio streaming on a website)

如何通過 NAT 流式傳輸 WebRTC 音頻? (How to stream WebRTC audio through a NAT?)

從 WebAPI 在瀏覽器中播放 WAV 文件 (Play WAV file in Browser from WebAPI)







留言討論