问题描述
有目前无论是使用原生HTML5或Flash与后备通过MediaElement的RTMP流式音频技术支持吗?我看到了什么样子了使用中的视频标签数据mejsoptions属性flashStreamer选项视频的支持。
Is there currently any support for streaming audio via RTMP using either native HTML5 or Flash fallback with MediaElement? I saw what looked like support for Video using the flashStreamer option in the video tag 'data-mejsoptions' attribute.
推荐答案
我知道你的问题是一岁,但我要去尝试,并希望我能救一个人想出来的时间和麻烦回答
I know your question is a year old but I'm going to try and answer it in the hope I can save someone the time and trouble of figuring it out.
至于我在任何原生的HTML5不支持知道RTMP音频/视频内容。
As far as I'm aware RTMP is not supported in any of the native HTML5 audio/video elements.
幸运的是mediaelement.js似乎支持这个协议在这里Flash版本
Luckily mediaelement.js seems to support this protocol in here Flash version
看来这个协议是用于更普遍的视频。这就是为什么你必须提供一些额外的参数进行RTMP流的工作。
It seems this protocol is used more commonly for videos. That is why you'll have to provide a few extra arguments to make a RTMP stream work.
下面是我得到了一个RTMP音频流与mediaelement.js工作:
Here is how I got a RTMP audio stream working with mediaelement.js:
JavaScript的:
JavaScript:
$('video,audio').mediaelementplayer({
audioWidth: 500,
features: ['playpause','current', 'progress', 'volume'],
pluginVars: 'isvideo=true',
//Example rtmp://my-streaming-service.com/specific-stream
flashStreamer: "rtmp://<base-url+path>",
mode:'shim'
});
HTML
<audio preload="none" controls="controls">
<!-- Example rtmp://my-streaming-service.com/specific-stream/64.stream -->
<source src="rtmp://<base-url+path>/<filename>" type="video/mp4">
</audio>
这篇关于mediaelement.js - 用于音频流的RTMP支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!