简体   繁体   English

直播视频在HTML5

[英]Live streaming video in HTML5

I need to develop a web application, it needs to support IE9 as well as iPad and Android tablets.我需要开发一个 web 应用程序,它需要支持 IE9 以及 iPad 和 Android 平板电脑。 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? HTML5如何实现视频直播?

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.我建议您使用 Wowza Media Server(当然那里有几个流媒体服务器。Wowza 提供具有出色性能和服务的视频/音频)我正在将它用于我的项目。 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.它还支持开源播放器,如 flow 播放器、Jw 播放器等。在您的机器上安装 Wowza Media Server 并在其上创建一个直播应用程序并开始广播。 You need an encoder for live streaming, You can use Adobe Flash Media Live Encoder for testing.直播需要编码器,可以使用Adobe Flash Media Live Encoder 进行测试。 Wowza can able to broadcast the videos to iphone, Webpage, etc., Wowza可以将视频播放到iphone、网页等,

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.如果浏览器无法播放 MP4 版本,它会尝试加载 Ogg 版本。 If that fails, it uses Flowplayer (flash) as a fallback.s如果失败,它将使用 Flowplayer (flash) 作为后备。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM