没有Android的网页浏览器使用的是什么播放音频流? MediaPlayer的还是其他什么东西? [英] What does android web browser use for playing audio streams? MediaPlayer or something else?

查看:180
本文介绍了没有Android的网页浏览器使用的是什么播放音频流? MediaPlayer的还是其他什么东西?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个特定的网站(m.aveamuzik.com)在浏览器中的播放RTSP音频流。当我尝试使用的MediaPlayer 课堂上播放相同的流,我得到 MEDIA_ERROR_UNKNOWN (额外= -2147483648 )。该错误是没有很好的记载,但有点谷歌搜索显示,这是因为不支持的媒体格式最有可能。

I have rtsp audio streams from a specific site (m.aveamuzik.com) that play within a browser. When I try to play the same stream using MediaPlayer class, I get MEDIA_ERROR_UNKNOWN (with extra=-2147483648). The error is not well documented but a little googling shows that it is most probably because of unsupported media format.

我的问题是,如果的MediaPlayer 类不支持某种格式,请问内置的浏览器玩什么呢?此外,如何使用,而不是的MediaPlayer 类在我的code浏览器使用相同的机制,?

My question is, if MediaPlayer class does not support some format, how does the built-in browser play it? Also, how to use the same mechanism used by the browser in my code, instead of the MediaPlayer class?

修改1: @Joe

我尝试以下code:

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(streamURL));
startActivity(intent);

MX播放器 BSPlayer 的露面作为选项来打开该文件,但没有任何与相关音频previewActivity 。其实这是非常合理的为我的网址是 RTSP ,但意图过滤器音频previewActivity 只是为 HTTP 文件内容类型的URI。

MX Player and BSPlayer showed up as options to open the file, but not anything related with AudioPreviewActivity. Actually this is quite reasonable as my URLs are rtsp, but the intent filters for AudioPreviewActivity are just for http, file and content type of URIs.

推荐答案

事实

浏览器具有额外的功能设置剥离网页中的视频信号源,并启动它在本地播放器的大部分时间。此功能是没有内置的WebView,与本土球员是非常挑剔什么需要传递到它作为一个URI才能够发挥它。

The Browser has extra features set up to strip the video source from the page and launch it in the native player most of the time. This functionality is not built into WebView, and the native player is very picky about what needs to passed into it as a URI to be able to play it.

它的工作原理,因为姜饼在默认的Andr​​oid浏览器。

It works since Gingerbread in the default android browser.

可能的解释

您可能不使用Android浏览器做了的MediaPlayer 的方式。张贴一些code,帮助futher帮助。

You probably don't use the MediaPlayer the way the android browser does. Post some code to help futher help.

更多帮助

  • 的MediaPlayer 有很多虫子4.0之前(即固定大把RTSP错误)。
  • 在所描述的W3C的网络音频API:链接
  • 在这里是搭载Android支持的所有媒体格式和协议的详细列表:链接
  • 测试页:链接
  • 在这个完整的博客文章还帮我一下流了Android的媒体:的链接
  • The MediaPlayer has a lot of bugs before 4.0 (that fixed a lot a RTSP bugs).
  • The Web Audio API as described by W3C: link
  • Here is a detailed list of all media formats and protocols supported by Android: link
  • Testing page: link
  • This complete blog post also helped me about media streaming for Android: link

这篇关于没有Android的网页浏览器使用的是什么播放音频流? MediaPlayer的还是其他什么东西?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆