media-player

how to stream through mms://

不问归期 提交于 2019-12-18 13:38:46
问题 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! 回答1: 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

How do I make my app work with the media control buttons on lock screen?

别说谁变了你拦得住时间么 提交于 2019-12-18 13:23:26
问题 In recent iOS versions apps have some kind of access to the media control buttons on the lock screen, like the Play/Pause button: It looks like the buttons are supposed to work with the MPMusicPlayerController class, is that right? Is there a way to get the “raw” events from the buttons? Because the music player only seems to offer an API to supply a bunch of MPMediaItem s. What if my app is for example a radio that needs to handle the buttons differently? 回答1: After a bit more searching I

Reduce video buffering

≡放荡痞女 提交于 2019-12-18 12:42:14
问题 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. 回答1: 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

Play video in background using mediaplayer in service

孤街浪徒 提交于 2019-12-18 12:39:11
问题 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

Android SeekBar to control MediaPlayer progress

╄→гoц情女王★ 提交于 2019-12-18 10:52:58
问题 I have a SeekBar , it displays correctly MediaPlayer progress. However, I have troubles with seeking - if I seek scroll box somewhere it just returns on the position where audio file is playing. public class EntityPageActivity extends Activity implements Runnable, OnClickListener, OnSeekBarChangeListener{ private SeekBar seekBar; private Button startMedia; private Button pauseMedia; private MediaPlayer mp; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate

A problem with Media Player base on iOS4 and deploy iOS3

帅比萌擦擦* 提交于 2019-12-18 10:36:51
问题 when Run on Device 3.1.2, why it also pass if(NSClassFromString(@"MPMoviePlayerViewController") != nil) and do code of iOS4 then it will crash , how to fix this issues? if(NSClassFromString(@"MPMoviePlayerViewController") != nil) { // iOS 4 code NSLog(@"MPMoviePlayerViewController"); MPMoviePlayerViewController *mp = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:AppDelegate.PushLink]]; if (mp) { // save the movie player object self.theMovie4 = mp; [mp release];

Android MediaPlayer error codes?

牧云@^-^@ 提交于 2019-12-18 10:36:08
问题 I am struggling with getting a live radio stream to work on android. I am using the MediaPlayer class and just setting the URL and playing it. It works great for the most part, but after 5-30 minutes it inevitably dies. On 2.1 phones (more specifically a hero) I get this log output W/MediaPlayer( 7919): info/warning (1, 26) I/MediaPlayer( 7919): Info (1,26) I/MediaStreamService( 7919): mPlayer info code:1 extra:26 E/MediaPlayer( 7919): error (1, -11) E/MediaPlayer( 7919): Error (1,-11) Where

Play mediaplayer for certain duration

♀尐吖头ヾ 提交于 2019-12-18 09:38:15
问题 I want to play the mediaplayer for just 10 sec. How to control it? 回答1: You could use TimerTask to schedule a MediaPlayer.stop() to run after 10 secs. 回答2: You can implement a CountDownTimer that will stop your MediaPlayer. so you will not have to implement a thread or something. 来源: https://stackoverflow.com/questions/4958003/play-mediaplayer-for-certain-duration

How to resume playing after paused using gstreamer?

回眸只為那壹抹淺笑 提交于 2019-12-18 09:36:30
问题 I've written C++ wrapper for each Gstreamer types. They're simple and intuitive, so I don't think their implementation needs to be posted here (though I could post them (maybe at github) if need arises). The problem I'm facing is that I start playing a video (and simulteneously saving it to a file using gst tee element)....and while it is playing, I pause (from different thread) which is working great. However, when I want to resume it, it doesn't work: void pause() { _pipeline.state(GST

Android mediaplayer MediaPlayer(658): error (1, -2147483648)

为君一笑 提交于 2019-12-18 05:00:14
问题 I get this error when playing a streaming audio in Android: MediaPlayer(658): error (1, -2147483648) mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mediaPlayer.setDataSource(url); mediaPlayer.prepareAsync(); 回答1: I don't know about playing streams but I was getting the same error from trying to play a file residing on the device. The solution was that the MediaPlayer didn't have the right permissions to read the video file. This article helped me out tremendously. http://www