media-player

Android MediaPlayer play m3u8 only audio streamming

筅森魡賤 提交于 2019-12-04 19:26:42
Hi all and thanks in advance, After all day looking, searching and trying i do not know if it is even possible, or if the problem is in the code, or if the problem is in the server.... First of all, can MediaPlayer play a m3u8 file? In case Yes...it is only in versions greater than 3.0 or 4.0? if i just try to play the url in a real device 4.0.4 i get error (1,-1010) or error 100 or -214.... The code is simple: MediaPlayer mp = new MediaPlayer(); fich="http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8"; //e.g. mp.setDataSource(localContext, Uri.parse(fich)); mp

Mediaplayer stops playing after playing a few times

不羁岁月 提交于 2019-12-04 18:46:31
I've got a button that on press it plays a random sound clip followed by another and then another via one mediaplayer however after pressing the button numerous times (15-20 times) all audio just stops. I'm releasing the mediaplayer after the last audio clip is played so I don't see that being the reason. Any pointers? public class Main extends Activity { MediaPlayer mp; Button generate; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); generate = (Button) findViewById(R.id.sound); } public void youSir (View view)

How to cancel a thread

懵懂的女人 提交于 2019-12-04 18:36:17
I am trying to make a media player which has a seekbar . As the seekbar should stop progress when pause is pressed or stop is pressed. I want to stop the thread accordingly. Moreover when back is pressed I want to cancel the thread again. Use Thread.currentThread().interrupt() Thread interruption Every thread has a Boolean property associated with it that represents its interrupted status. The interrupted status is initially false; when a thread is interrupted by some other thread through a call to Thread.interrupt(), one of two things happens. If that thread is executing a low-level

Android playing stream m3u using mediaPlayer

白昼怎懂夜的黑 提交于 2019-12-04 18:06:51
I'm building an application that play streaming m3u file from web. I'm using mediaPlayer class and it works. Here's the code : String test_path = "http://cast.idvps.com:8000/djwirya.m3u"; try { mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mediaPlayer.setDataSource(test_path); mediaPlayer.prepareAsync(); } catch (IOException e) {Log.e("Error", "No Stream");} mediaPlayer.start(); It was working perfectly. But, after a whie I compiled it again, there's no sound. pls help.... THX You need to call mediaPlayer.setOnPreparedListener(this) before the prepareAsync(). This assumes that

Android VideoView Error 1,0

别来无恙 提交于 2019-12-04 17:39:23
I have an application thats main goal is to play a specific video file. it plays the video correctly sometimes. But other times it gives me this error: 03-21 14:52:36.181: I/AwesomePlayer(119): setDataSource_l('/data/data/my.package.name/files/MyMovie.mp4') 03-21 14:52:36.196: W/VideoView(26612): Unable to open content: /data/data/my.package.name/files/MyMovie.mp4 03-21 14:52:36.196: W/VideoView(26612): java.lang.IllegalArgumentException: The surface has been released 03-21 14:52:36.196: W/VideoView(26612): at android.media.MediaPlayer._setVideoSurface(Native Method) 03-21 14:52:36.196: W

Media player libraries in Java [closed]

雨燕双飞 提交于 2019-12-04 17:10:12
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I am evaluating libraries for playing audio/video in Java. It does not need to be 100% Java ; Java bindings to native libraries are perfectly OK. An external application that can be controlled from Java is also fine, as long as it can render video on a Java component. The target platform is Linux. Windows

how to get informed of new song info while retrieving metadata from shoutcast stream

时光怂恿深爱的人放手 提交于 2019-12-04 17:09:00
Background: I'm streaming radio using double buffering approach for html shoutcast. I get metadata information from stream using http://www.smackfu.com/stuff/programming/shoutcast.html Problem I have three problems. 1- I already use a urlconnection and inputstream for listening radio. I don't want to open a new connection to retrieve metadata. But when I tried to get both from same inputstream, I couldn't listen radio anymore. I guess this is not possible and I have to use two seperate connection? Isn't it bad for performance? 2- When the application started, I retrieve the info of the current

Playing video using MediaPlayer class

若如初见. 提交于 2019-12-04 16:20:02
问题 I am trying to make use of MediaPlayer class for playing a video file. The problem is video is not getting displayed at all though I can hear the sound in the video playing. Following is the code of activity public class MainActivity extends Activity implements OnClickListener { private SurfaceView surfaceView; private Button btnPlay; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); init(); addListener()

No Sound coming from Android Emulator

ぐ巨炮叔叔 提交于 2019-12-04 15:42:58
问题 I ran my application and I can't get the sound working on the Android Emulator. I checked and enabled the audio playback boolean in the Eclipse AVD Manager. I also went into the sound options in the Android Emulator and put them up (no sound while putting them up). I checked the box that says all selections will make a noise(still no sound). My application uses the MediaPlayer class and I am running win7 x64 if that has anything to do with it. Help is appreciated. 回答1: I have a similar issue

Android Media Stream Error? java.io.FileNotFoundException: No content provider :http://

一世执手 提交于 2019-12-04 15:24:14
问题 I followed this to Play Stream Radio In android Here Its working Fine But Player Loading Bit Slow after clicking I need to wait for 30+ seconds time But I am getting This error In console MediaPlayer: setDataSource IOException happend : java.io.FileNotFoundException: No content provider: http://www.example.com:8000/live.ogg at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1074) at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java