media-player

Android Mediaplayer play different songs after eachother

点点圈 提交于 2019-12-23 01:46:37
问题 I generate midi files on the go. I want to play these files continuously. I initialise a mediaplayer and start song1.mid. Then I use the following code to play song2.mid // set on completion listener music file mediaPlayer .setOnCompletionListener(new MediaPlayer.OnCompletionListener() { @Override public void onCompletion(MediaPlayer mp) { String filePath2 = null; File file = null; FileInputStream inputStream = null; //set the filePath try { filePath2 = getCacheDir() + "/optimuse" + song + "

how to ShoutCast Streamming with MediaPlayer with android 2.3.3

若如初见. 提交于 2019-12-22 17:46:17
问题 Hi all and thanks in advance, I have been all day looking forums and on internet and i'm not getting any clear about this. I am not sure if it possible in a direct and simple way. I read all time that since 2.2 it is supported natively but i don't see and example where it works easily First, i make some test with some .mp3 on a web and this code worked fine: mp = new MediaPlayer(); mp.setDataSource(localContext, Uri.parse(SomeURL.mp3)); mp.prepare(); mp.start() but now....i have to reproduce

How would I use a pack uri resource with media player?

时间秒杀一切 提交于 2019-12-22 17:36:19
问题 I have some very simple code which just needs to play a sound with a specified volume, as follows : var mp = new MediaPlayer(); mp.Open(uri); mp.Volume = volume; mp.Play(); The problem arises because this is part of a Prism module. I don't know where the executing assembly is going to be so I can't use a relative Uri or siteoforigin and MediaPlayer doesn't understand the pack Uri syntax. I have a resource wav file at the root of my assembly called "notify.wav", but I have no way to pass it

MediaPlayer making APP not responding

痞子三分冷 提交于 2019-12-22 13:05:58
问题 I have an activity that's using a MediaPlayer to play video content. The activity simulates a TV device by playing different HLS video streams on key up/down presses. After watching some video for a longer time (approx. > 15 mins), when I press any key the APP is not responding and is getting to a Force Close screen. Here's what I'm doing on every key event up/down: //I'm creating the media player object only once, after every channel switch i do: if(mMediaPlayer.isPlaying()) { mMediaPlayer

MediaPlayer making APP not responding

本秂侑毒 提交于 2019-12-22 13:05:54
问题 I have an activity that's using a MediaPlayer to play video content. The activity simulates a TV device by playing different HLS video streams on key up/down presses. After watching some video for a longer time (approx. > 15 mins), when I press any key the APP is not responding and is getting to a Force Close screen. Here's what I'm doing on every key event up/down: //I'm creating the media player object only once, after every channel switch i do: if(mMediaPlayer.isPlaying()) { mMediaPlayer

Add Custom Controls to MoviePlayer in iPhone 3.0 SDK

寵の児 提交于 2019-12-22 13:00:20
问题 I'd like to add custom controls to the mediaPlayer control view much as this asker: Add Custom Controls to MoviePlayer However, the solution posted in the above question is depreciated in 3.0. Does anyone know of a way to do this with the new SDK? So far I have added an overlayView to the moviePlayer view and can display my own controls on touch, but I can't seem to pass the touch on to the moviePlayer view to get it to display the native controls. I've been using touchesBegan and

JavaFX media player does not play video

穿精又带淫゛_ 提交于 2019-12-22 10:48:15
问题 Using OpenJFX 11 I am using a mediaplayer to play some clips on a Linux system. Some of them display, others don't. As far as I can tell the only difference in the encoding is, that the not playing video contains an audio track. This is the output of mediainfo for the video that plays: General Complete name : OpenPatricianData/src/main/resources/video/event/BlackDeath.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom (isom/iso2/avc1/mp41) File size : 26.0 MiB Duration : 30s 0ms

MediaPlayer sometimes not preparing when screen is locked

爷,独闯天下 提交于 2019-12-22 10:23:37
问题 I have a MusicService for MediaPlayback, wich uses a MediaPlayer with the settings: player.setWakeMode(getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK); player.setAudioStreamType(AudioManager.STREAM_MUSIC); and those Listeners are set: OnPreparedListener, OnCompletionListener, OnErrorListener, OnSeekCompleteListener The MediaPlayer is used for mp3-Playback. When one Song is finished, onCompletion is called. Then PlayNext is called, wich resets the MediaPlayer, then sets the Datasource

Android MediaPlayer URL's with Cookie

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-22 06:58:49
问题 I have an android application that plays music from a site, however to authenticate to the stream, you need to send a cookie first I.E: http://example.com/site/content?id=SOMEID = mp3 formatted stream If you access the url without a cookie, you'll get a Server 500 error. If you have a cookie, then you'll get the stream. For the life of me, I can't figure out how to make the mediaplayer play a URL while sending a cookie. I can play any url that doesn't require a cookie, however. 回答1: As far as

Is there a better way to save streamed files with MediaPlayer? [closed]

送分小仙女□ 提交于 2019-12-22 04:45:23
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I'm trying to build a mediaplayer app, that allows the user to stream mp3 files from online, and save the file when it's finished downloading. It looks like MediaPlayer doesn't provide any means of doing this, so