有支持M3U8格式的HTML5播放器吗
2个回答
展开全部
有的。一般都是直播用到这个协议吧。选择一个流媒体系统如800li media server这样的,都是既可以进行直播流承载分发,又自带了H5播放器的。可以试试。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
有的,在浏览器上播放m3u8的视频地址有两种方式:
一、html的video标签的方式,这种方式播放很简单:
<!DOCTYPE hmtl>
<html>
<head>
<title>the5fire m3u8 test</title>
</head>
<body>
<video controls autoplay >
<source src="../v1d30/posts/2014/barcelona/barcelona.m3u8">
</video>
</body>
</html>
二、通过开源的swfobject.js以及两个flash组件:OSMF和HLSProvider来播放,代码如下:
<!DOCTYPE html>
<html>
<head>
<title>the5fire m3u8 test</title>
<script src="../staticfile/swfobject.js"></script>
</head>
<body>
<div id="player">
</div>
<script>
var flashvars = {
// M3U8 url, or any other url which compatible with SMP player (flv, mp4, f4m)
// escaped it for urls with ampersands
src: escape("http://www.the5fire.com/static/demos/diaosi.m3u8"),
// url to OSMF HLS Plugin
plugin_m3u8: "http://www.the5fire.com/static/demos/swf/HLSProviderOSMF.swf",
};
var params = {
// self-explained parameters
allowFullScreen: true,
allowScriptAccess: "always",
bgcolor: "#000000"
};
var attrs = {
name: "player"
};
swfobject.embedSWF(
// url to SMP player
"http://www.the5fire.com/static/demos/swf/StrobeMediaPlayback.swf",
// div id where player will be place
"player",
// width, height
"800", "485",
// minimum flash player version required
"10.2",
// other parameters
null, flashvars, params, attrs
);
</script>
</body>
</html>
通过嵌入以上代码就可以播m3u8了。
一、html的video标签的方式,这种方式播放很简单:
<!DOCTYPE hmtl>
<html>
<head>
<title>the5fire m3u8 test</title>
</head>
<body>
<video controls autoplay >
<source src="../v1d30/posts/2014/barcelona/barcelona.m3u8">
</video>
</body>
</html>
二、通过开源的swfobject.js以及两个flash组件:OSMF和HLSProvider来播放,代码如下:
<!DOCTYPE html>
<html>
<head>
<title>the5fire m3u8 test</title>
<script src="../staticfile/swfobject.js"></script>
</head>
<body>
<div id="player">
</div>
<script>
var flashvars = {
// M3U8 url, or any other url which compatible with SMP player (flv, mp4, f4m)
// escaped it for urls with ampersands
src: escape("http://www.the5fire.com/static/demos/diaosi.m3u8"),
// url to OSMF HLS Plugin
plugin_m3u8: "http://www.the5fire.com/static/demos/swf/HLSProviderOSMF.swf",
};
var params = {
// self-explained parameters
allowFullScreen: true,
allowScriptAccess: "always",
bgcolor: "#000000"
};
var attrs = {
name: "player"
};
swfobject.embedSWF(
// url to SMP player
"http://www.the5fire.com/static/demos/swf/StrobeMediaPlayback.swf",
// div id where player will be place
"player",
// width, height
"800", "485",
// minimum flash player version required
"10.2",
// other parameters
null, flashvars, params, attrs
);
</script>
</body>
</html>
通过嵌入以上代码就可以播m3u8了。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |