【发布时间】:2023-04-02 05:24:01
【问题描述】:
我正在尝试让 rtmp 流媒体工作。我有几乎相同的代码建议here
<html>
<head>
<script src="me/build/jquery.js"></script>
<script src="me/build/mediaelement-and-player.js"></script>
<link rel="stylesheet" href="me/build/mediaelementplayer.min.css" /></code>
</head>
<body>
<video>
<source src="000109f6004b00a6004af03676235daa" type="video/rtmp">
</video>
<script>
$('video').mediaelementplayer({flashStreamer:"rtmp://thinkbuntu:1935/flvplayback/000109f6004b00a6004af03676235daa"});
</script>
</body>
</html>
而 rtmp://thinkbuntu:1935/flvplayback 是本地 rtmpserver 的 URL,而 '000109f6004b00a6004af03676235daa' 是 mp4 视频。我知道本地服务器正在工作,因为我可以通过 rtmpdump 转储它,并且使用 jwplayer 我可以正常播放视频。
使用 flv、webm、ogv 的中介也不起作用。
我在 Firefox 中收到此错误(在 Chrome 中完全没有错误):
Specified "type" attribute of "video/rtmp" is not supported. Load of media resource 000109f6004b00a6004af03676235daa failed.
通过 json 属性配置它以同样的方式失败。
我也尝试过这种方法Replacing media source (http with rtmp) in MediaElementsJS based on browser capabilities,但它也失败了。
我做错了吗?
【问题讨论】:
标签: video-streaming mediaelement.js rtmp