Html HTML5 中的实时流媒体视频

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10039993/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-28 23:36:17  来源:igfitidea点击:

Live streaming video in HTML5

htmlvideostreaminglive

提问by jan

I need to develop a web application, it needs to support IE9 as well as iPad and Android tablets. The problem I am facing is that the client is required to show live streaming video on all the pages. How can I implement live streaming video in HTML5?

我需要开发一个 web 应用程序,它需要支持 IE9 以及 iPad 和 Android 平板电脑。我面临的问题是客户端需要在所有页面上显示实时流媒体视频。如何在 HTML5 中实现实时流媒体视频?

回答by Sathish

I recommended you to use Wowza Media Server ( Ofcourse there are several streaming servers are there. Wowza delivers video/audio with great performance and service ) I am using it for my projects. It also supports opensource players like flow player, Jw players etc.. Install Wowza Media Server on your machine and create a live application on it and start broadcast. You need an encoder for live streaming, You can use Adobe Flash Media Live Encoder for testing. Wowza can able to broadcast the videos to iphone, Webpage, etc.,

我建议你使用 Wowza 媒体服务器(当然那里有几个流媒体服务器。Wowza 提供具有出色性能和服务的视频/音频)我将它用于我的项目。它还支持流式播放器、Jw 播放器等开源播放器。在您的机器上安装 Wowza 媒体服务器并在其上创建一个直播应用程序并开始广播。您需要一个用于直播的编码器,您可以使用 Adob​​e Flash Media Live Encoder 进行测试。Wowza 可以将视频广播到 iphone、网页等,

回答by Naveen Kumar

Try the code

试试代码

<video id="movie" width="" height="" preload controls>
   <source id="srcMp4" src="video.mp4" />
   <source id="srcOgg" src="video.ogg" />
   <object id="flowplayer" name="flowplayer" width="480" height="352" 
   data="http://releases.flowplayer.org/swf/flowplayer-3.2.5.swf" 
            type="application/x-shockwave-flash">
     <param name="movie" 
     value="http://releases.flowplayer.org/swf/flowplayer-3.2.5.swf" />
     <param name="allowfullscreen" value="true" />
     <param name="flashvars" 
     value='config={"clip":"http://domain.com/video.flv"}' />
  </object>
</video>

The MP4 format is provided first, due to a previous bug in iPad which only sees the first source listed.

首先提供 MP4 格式,这是由于 iPad 中以前的一个错误,它只能看到列出的第一个源。

If the browser can't play the MP4 version, it tries to load the Ogg version. If that fails, it uses Flowplayer (flash) as a fallback.s

如果浏览器不能播放 MP4 版本,它会尝试加载 Ogg 版本。如果失败,它将使用 Flowplayer (flash) 作为 fallback.s