media-player

how to stream through mms://

狂风中的少年 提交于 2019-11-30 10:23:01
There are some posts about this, but so far, i haven't seen any good answer. Is there a way i can stream audio from mms:// uris with Android?. MediaPlayer seems not to like these streams. Also changing mms:// with http or rtsp doesn't work either. Did someone find a workaround to this?. Thanks! hiennt Download Android NDK Then download modified libmms and libffmpeg at http://radiotime.com/apps/android.aspx basically you has to have 2 threads: 1st thread for downloading the audio data from mms station then write to a wma file 2nd thread decode this wma to PCM data using the libffmpeg. To save

android media player shows audio but no video

拜拜、爱过 提交于 2019-11-30 10:15:43
I am using media player to stream a video. It only plays the audio but not the video. Could anyone help? My code is below. public class VideoViewApplication extends Application { @Override public void onCreate() { } @Override public void onTerminate() { } } public class VideoViewDemo extends Activity implements OnErrorListener,OnBufferingUpdateListener, OnCompletionListener, MediaPlayer.OnPreparedListener, SurfaceHolder.Callback { private static final String TAG = "VideoViewDemo"; private MediaPlayer mp; private EditText mPath; private SurfaceHolder holder; private ImageButton mPlay; private

phonegap media sound stop playing after 5 times

随声附和 提交于 2019-11-30 09:15:37
I need to play the "correct" sound if user answer the question correctly and "wrong" if incorrect. The sound is playing at first but after at the fifth time I answer correctly which output the fourth time "correct" sound already the fifth time, no sound can be heard. It seems the music can only played at most 4th times. What is the possible reason that cause this? updated* I added media.release in my stopAudio() but so far the sound can be heard for 6th (improved) but it is still not suits my case. (Many questions that need the same sound effect) Js.file // Audio player var my_media = null;

Play video in background using mediaplayer in service

≯℡__Kan透↙ 提交于 2019-11-30 07:43:21
I'm develop a app that can play video from youtube, if user pressed home button, user can hear the audio and then they can back to see video again. So, i use Mediaplayer and setDisplay surfaceview to it to see video, but it can't keep player play when home pressed, i know Service can perform long-running operations in the background and does not provide a user interface. so, i create a service that hold Mediaplayer public class VideoPlayerService extends Service implements MediaPlayer.OnPreparedListener { private static final String TAG = "VideoPlayerService"; public MediaPlayer mPlayer;

Using WakeLock to Keep A Stream Playing

匆匆过客 提交于 2019-11-30 07:30:30
问题 I have a MediaPlayer running in a Service that's playing audio from a URL (streaming). As of now it appears to work well, and even continues playing when I put the phone in standby. I currently do not acquire a wakelock. My question is: Is it actually necessary to acquire a wakelock in my situation? If it is necessary, what type of wakelock should I acquire? And yes, this is a legitimate use-case for wakelock, because my users explicitly want the audio to continue playing. 回答1: MediaPlayer

Reduce video buffering

夙愿已清 提交于 2019-11-30 07:30:04
I'm playing video on Android using media player via RTSP. The player takes about 12s to buffer before it starts playing. Anyone know how I can convince the player to buffer less? I have full control over the RTSP server and the SDP it returns. As per usual, as soon as I decide I should ask a question I work out the answer. I have a line "b=AS:91" in my SDP. If I reduce the number the amount of buffering decreases - so b=AS:2 gives about 4 or 5s buffering. 来源: https://stackoverflow.com/questions/3937241/reduce-video-buffering

Video not playing in Android

不羁岁月 提交于 2019-11-30 07:22:33
Video not working properly in the below mentioned code. What could be the problem for this? MediaController mediaController = new MediaController(getBaseContext()); mediaController.setAnchorView(videoweb); Uri video = Uri.parse("http://www.youtube.com/v/wwI2w2YHkCQ?fs=1"); videoweb.setMediaController(mediaController); videoweb.setVideoURI(video); videoweb.start(); Error: Cannot play video Sorry,this video cannot be played. Karthik The link you have provided, http://www.youtube.com/v/wwI2w2YHkCQ?fs=1 , is for an HTML page. The URI to be provided for setVideoURI() should be a media file such as

MediaPlayer error: pause called in state 64

China☆狼群 提交于 2019-11-30 06:58:16
I am using a MediaPlayer in my Activity . When I hit the back button, I get this error: 09-20 19:44:16.540: E/MediaPlayer(1822): pause called in state 64 09-20 19:44:16.540: E/MediaPlayer(1822): error (-38, 0) Code public boolean onKeyDown(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) { if (mp!= null && mp.isPlaying()) { mp.stop(); } Intent intentstart = new Intent(X.this, Y.class); intentstart.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intentstart); } return super.onKeyDown(keyCode, event); } If I use mp.pause() , it's working

android MediaPlayer not playing mp3 file

吃可爱长大的小学妹 提交于 2019-11-30 06:56:23
I have written the most basic application I can think of to try to play an mp3 file, but it is not working. I don't get any errors, but when the application starts up, the sound is not played. public class soundtest extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); MediaPlayer mp = new MediaPlayer(); mp.create(getApplicationContext(), R.raw.norm_iphone_money); mp.start(); } } What am I missing? I have "norm_iphone_money.mp3" inside the res/raw folder

A simple C program to play mp3 using libvlc

余生颓废 提交于 2019-11-30 05:43:38
I am an average C/C++ programmer. Recently I took a project to make a media player with a smart playlist that will work like Zune's SmartDj. I have decided to use libvlc for playing. I have never coded an open source software before, so I know nothing about git and all. Can you please help me to write at least a C program to play a mp3 file? Where should I get started? How do you extract a song's artist and other information from the mp3 file itself? regards. be sure that you have installed the following packages (else install it): $ apt-get install libvlccore-dev libvlc-dev test.c: #include