media-player

how can i get songs from my iphone's ipod to my application in array in iphone sdk?

断了今生、忘了曾经 提交于 2019-12-02 21:54:02
问题 can i store or just create a customize view which allow user to play songs within from my application when user clicks on songs at that time the iphone's iPod(MusicPlayer) picker should not open it just show all songs in my application in TableView or PickerView it allows user to select the songs within my created customized view that TableView or PickerView.i have also seen this example. but it just opens the music player picker view. did you get my point is this possible to do that within

In h264 NAL units means frame.?

喜你入骨 提交于 2019-12-02 20:41:27
I am working on a h264 video codec. I want to know: Is a single NAL unit in H264 equivalent to one video frame? No, a sequence of NAL units can be decoded into video frames, but they are not equivalent. http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC http://en.wikipedia.org/wiki/Network_Abstraction_Layer#NAL_Units_in_Byte-Stream_Format_Use http://wiki.multimedia.cx/index.php?title=H.264 来源: https://stackoverflow.com/questions/6858991/in-h264-nal-units-means-frame

How to determine video width and height on Android

大城市里の小女人 提交于 2019-12-02 20:34:17
I have a video file and I want to get width and height of video. I don't want to play it, just to get size. I've tried to use MediaPlayer: MediaPlayer mp = new MediaPlayer(); mp.setDataSource(uriString); mp.prepare(); int width = mp.getVideoWidth(); int height = mp.getVideoHeight(); but it returns 0 for width and height, because VideoSizeChangedEvent didn't fire yet. How can I get width and height of video? UPD: I need API version 7 This works in API level 10 and up: MediaMetadataRetriever retriever = new MediaMetadataRetriever(); retriever.setDataSource("/path/to/video.mp4"); int width =

MediaPlayer change DataSource Error when MediaPlayer complets Playing First Audio

余生长醉 提交于 2019-12-02 20:04:21
问题 Any one Help for MediaPlayer Error. when aim is to Change DataSource and Play second Audio when First Audio is Compliting its Playing. My Code is below :- mMediaPlayer.setOnCompletionListener(new OnCompletionListener() { @Override public void onCompletion(MediaPlayer arg0) { String fileName = Environment.getExternalStorageDirectory().getAbsolutePath() + FILENAME+arrListSize+".wav"; mMediaPlayer.release(); mMediaPlayer = null; mMediaPlayer = new MediaPlayer(); Uri uri = Uri.parse("file://"

How do I include http headers with MediaPlayer setDataSource?

被刻印的时光 ゝ 提交于 2019-12-02 18:43:12
I am passing a URI to the setDataSource method of the MediaPlayer object. I am targeting api version less than 14, so believe that I cannot use the new method that allows headers to be included. How can I include headers (specifically, authentication header) with the MediaPlayer request and still support older Android devices? My code looks like: mediaPlayer.setDataSource(url); mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mediaPlayer.prepareAsync(); Background: The method setDataSource(Context context, Uri uri, Map<String, String> headers) has been included in the SDK (marked as

Mediaplayer progress update to seekbar not smooth?

こ雲淡風輕ζ 提交于 2019-12-02 18:22:02
I am working on an app with recorder and player. I am using mediaplayer to play the recorded .wav file and meantime I want to update to a seekbar. Everything is working fine But my problem is mediaplayer progress updation to seekbar is not happening smoothly, If we are playig a small file, thumb of the seekbar jumps in seconds or between. Can anyone help me with a workaround to make it smooth seeking of the progress in seekbar. My code is shown below.I am totlay stuck here. mediaPlayerIntiate(); mediaPlayerSetSource(); mMediaPlayer.start(); task = new TimerTask() { @Override public void run()

Android: mediaplayer went away with unhandled events

雨燕双飞 提交于 2019-12-02 17:50:29
I need to get the duration of an audio file for a series of voice announcements that need to play from an app. I have added the audio files as resources and they do play just fine. The sample code below actually works perfect for its intended purpose: it does return the duration of the audio files. Here is the code: float getDurationOfAudioResource(LocationEnum loc, Context context){ float duration = 0; try { MediaPlayer mp; mp = MediaPlayer.create(context, getAudioResource(loc)); duration = mp.getDuration(); mp.release(); mp = null; } catch (IllegalStateException e) {e.printStackTrace();

Android Media Player: Download to File and Stream From File

淺唱寂寞╮ 提交于 2019-12-02 15:38:59
I'm using Android's MediaPlayer to play MP3 files that are simultaneously downloaded from the internet using the DownloadManager . I'm aware of the MediaPlayer 's capability to stream directly, but I don't want to use that: The obvious advantage you get by downloading and simultaneously streaming from file is that this way, the file gets stored and is available locally afterwards. This works in principle - the MediaPlayer starts to play the file even if it not fully downloaded. (BTW my problem is NOT that I can't get MediaPlayer to play.) The problem is that when the MediaPlayer gets to the

android media player - how to disable range request? (broken audio streaming on Nexus 7)

懵懂的女人 提交于 2019-12-02 14:43:24
I have a audio streaming app, which runs a local proxy server. The local proxy server makes a http connection to a internet streaming source, gets and buffers locally the streaming data. Then, inside in the app, I use MediaPlayer to connect to the local proxy server, using the method mediaPlayer.setDataSource(...); // the url of the local proxy server Everything was fine (with plenty of Android devices and different OS versions - 1.5...4.0), until Nexus 7 release. In Nexus 7, the media player refuses to play the source from the local proxy server. When I took a look at the logs, seems like the

Can't play mp4 converted file - JavaFX 2.1

纵饮孤独 提交于 2019-12-02 13:48:29
问题 I have converted my .mov video to .mp4 , but when I play the video in my javafx application, it doesn't work, I can hear the audio of the video file but without pictures ! maybe the .mp4 is not in the right codec! any idea or solution? UPDATE With the same code I have played another mp4 video, in the same conditions (plateforme, JFX Version, ...), so I'm concluding that I have problem with this mp4 converted file, ie the software that I'm using to convert the mov file doesn't generate the