media-player

Android MediaPlayer play m3u8 only audio streamming

孤街浪徒 提交于 2019-12-06 15:53:56
问题 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

Processing dynamic MP3 URL

二次信任 提交于 2019-12-06 15:53:32
I am using Yahoo Media Player for playing MP3 songs on my website. I have put some static MP3 links on site. For e.g. <a href='1.mp3'>Song1</a> <a href='2.mp3'>Song2</a> And I have put the YMP JavaScript API code also. Now, I want to load the songs dynamically... For example if user clicks on a button I want to load a complete new play list to the player. //Something like this var clickEventHandler = function(){ YMP.removeAllSongs(); YMP.addSongs(mp3_links); YMP.play(); } This may help you, use this: <script> /** On Yahoo Media API Ready **/ var yesReady = false; YAHOO.MediaPlayer.onAPIReady

MediaPlayer vs SoundPool for only 1 simultaneous stream

╄→гoц情女王★ 提交于 2019-12-06 15:04:32
I'm working on a game in which one single sound is played each time the phone is shaked. Does it make sense to use a SoundPool and load sounds in the onCreate of my activity, or is it ok to create a mediaplayer each time, as shown below: private void onShake() { MediaPlayer mp= MediaPlayer.create(this, whipSound[currentWhip][force]); mp.start(); } My guess is that SoundPool is better because the sounds are loaded only once. Am I right? Thanks Julien As expected, SoundPool is much faster... marcosbeirigo You can create the mediaPlayer outside the onShake method, and then reset and start it on

Two Object of media Player not play song in Sync at same time

橙三吉。 提交于 2019-12-06 14:21:05
问题 I have working on to one android application.Normal concept of this application is to Play Song in Multiple Device at Same Time.Everything is done but Song is not play in Sync.I have done lot's of R&d to solve this problem but not getting success.but at end I have found one Issue of Android Media Player.For finding this issue I have making one demo Application.Description is follow. Demo App Description I create a two object of Android media player firstPlayer and secondPlayer.firstPlayer

Buffered level of music showing in seekbar

こ雲淡風輕ζ 提交于 2019-12-06 13:27:00
Hi there. As you can see i want to show buffered level of media that stream to user in android music player. The solution i imagine for this issue is that: Should i create a seekbar and a progressbar with transparent background and overlap progressbar to seek bar, whereas progreesbar showing buffered level of music. but im not sure about this strategy. is anyone to help me for best way to reaching the goal at this issue. First of all should implements OnBufferingUpdateListener to activity then set onBufferingUpdate ike this: public void onBufferingUpdate(MediaPlayer arg0, int percent) { /**

Mediaplayer stops playing after playing a few times

荒凉一梦 提交于 2019-12-06 12:19:12
问题 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);

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

风格不统一 提交于 2019-12-06 12:04:19
问题 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

MediaPlayer Preparing Failed

若如初见. 提交于 2019-12-06 11:43:45
问题 All I have been doing for the past 8 hours is trying to come up with a simple recorder/ playback app. I want to be able to record the audio in 3GP and then have it automatically loaded into the MediaPlayer so that I can play it back. I am 80% sure that it is recording and saving to the location specified in the code, but when I try and load it into my media player I always get this error. I have tried loading the toto_africa.mp3 file too to make sure it's not the recorded file's problem, and

How to resume activity with audio in Android?

大憨熊 提交于 2019-12-06 11:36:18
问题 I have implemented media player. I have only one Activity. When I'm starting the activity, my music starts to play and when I press the back button the music clip is in pause state, and again when I resume my activity, the music resumes properly. But there is error after I try to resume my Application after song got over. The app crashed, and I'm getting exception for IllegalStateException in back-press method( mp.pause(); ). Please have a look at below code and suggest if I am doing

how do you get the artist and song title from MediaPlayer?

∥☆過路亽.° 提交于 2019-12-06 10:14:24
I'm building a simple app for an online radio station. I using this code to use the MediaPlayer to stream the station. It works great with one problem. I don't know how to show the listener what they're actually listening too. My code: package com.xxxx.android; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import java.util.List; import android.content.BroadcastReceiver; import