随同InputStream Android中创建媒体播放器 [英] Create mediaplayer with inputstream in android

查看:182
本文介绍了随同InputStream Android中创建媒体播放器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何创建与媒体播放器的InputStream实例?

How to I create mediaplayer instance with inputstream?

我只看到4功能的setDataSource。而且也没有功能获得的InputStream? 它是一个必须要使用的FileDescriptor 到媒体播放器?它似乎很基本的。但是,我couldnot找到一种方法。在J2ME中,有一个函数Manager.createPlayer(InputStream中)。你也可以使用输入流来创建一个媒体播放器。有没有一种方法来创建一个像J2ME一个媒体播放器?

I see only 4 function for setDataSource. And there is no function getting inputstream ? is it a must to use FileDescriptor to mediaplayer ? It seems so basic. but, I couldnot find a way. In j2me, there is a function that Manager.createPlayer(InputStream). And you can use inputstream to create a media player. Is there a way to create a mediaplayer like j2me ?

推荐答案

一种方法可以写你流一个文件,然后把它交给了的MediaPlayer 进行播放。

One approach can be to write your stream to a File and then give it to the MediaPlayer for playback.

这篇关于随同InputStream Android中创建媒体播放器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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