¡@

Home 

2014/10/16 ¤W¤È 08:23:42

android Programming Glossary: setdatasource

Android: How to create video player?

http://stackoverflow.com/questions/1188346/android-how-to-create-video-player

Runnable r new Runnable @Override public void run try setDataSource mPath catch Exception ex Log.e TAG ex.getMessage try mp.prepare.. ex.toString if mp null mp.stop mp.release private void setDataSource String path throws IOException if URLUtil.isNetworkUrl mPath.. path throws IOException if URLUtil.isNetworkUrl mPath mp.setDataSource mPath else URL url new URL mPath URLConnection cn url.openConnection..

How to Play RTSP Video in Android?

http://stackoverflow.com/questions/12853769/how-to-play-rtsp-video-in-android

new audio session id 10 12 11 56 50.430 D MediaPlayer 6880 setDataSource Context context rtsp v3.cache7.c.youtube.com CiILENy73wIaGQlOCTh0GvUeYRMYDSANFEgGUgZ2aWRlb3MM.. 6880 disable CIQ 10 12 11 56 50.470 D MediaPlayer 6880 setDataSource Context context rtsp v3.cache7.c.youtube.com CiILENy73wIaGQlOCTh0GvUeYRMYDSANFEgGUgZ2aWRlb3MM..

Anyone Have MediaPlayer Working with ParcelFileDescriptor and createPipe()?

http://stackoverflow.com/questions/12920429/anyone-have-mediaplayer-working-with-parcelfiledescriptor-and-createpipe

setup to private void loadClip try mp new MediaPlayer mp.setDataSource this PipeProvider.CONTENT_URI.buildUpon .appendPath clip.ogg.. 30916 newAudioSessionId Out id 178 D MediaPlayer 30916 setDataSource Context context content com.commonsware.android.audiolstream.. clip.ogg Map String String headers in D MediaPlayer 30916 setDataSource FileDescriptor fd in E MediaPlayerService 28138 offset error..

Android ShoutCast Internet Radio FilenotFoundException

http://stackoverflow.com/questions/16264225/android-shoutcast-internet-radio-filenotfoundexception

the url stream to a temporary location and then call the setDataSource for that local file public void downloadAudioIncrement String.. FileInputStream ins new FileInputStream f mp1.setDataSource ins.getFD mp1.setAudioStreamType AudioManager.STREAM_MUSIC.. FileInputStream ins new FileInputStream f mp2.setDataSource ins.getFD mp2.setAudioStreamType AudioManager.STREAM_MUSIC..

Play audio file from the assets directory

http://stackoverflow.com/questions/3289038/play-audio-file-from-the-assets-directory

.openFd AudioFile.mp3 player new MediaPlayer player.setDataSource afd.getFileDescriptor player.prepare player.start The problem.. reusing MediaPlayer s because there is no id parameter for setDataSource . I can't find a good guideline for handling this kind of problem... android assets share improve this question player.setDataSource afd.getFileDescriptor afd.getStartOffset afd.getLength Your..

MediaPlayer.setDataSource() and prepare() not working - android

http://stackoverflow.com/questions/3533837/mediaplayer-setdatasource-and-prepare-not-working-android

and prepare not working android I'm having a crack at using.. of url. According to all of the documentation I've read setDataSource should accept a string param with a url to a file. I keep getting.. have any ideas MediaPlayer mp new MediaPlayer try mp.setDataSource http www.urltofile.com file.mp3 mp.prepare mp.start catch IllegalArgumentException..

Android playing resource files from internal storage causes MediaPlayer.prepare to give IOException

http://stackoverflow.com/questions/4833777/android-playing-resource-files-from-internal-storage-causes-mediaplayer-prepare

. It seems to download the files to that location okay setDataSource String path doesn't throw any exceptions but MediaPlayer.prepare.. Downloads Files public void MusicPlay try mp.setDataSource data data com.app.pronounce winds.mp3 catch IllegalArgumentException.. can create a file descriptor and pass that to mediaPlayer.setDataSource FileInputStream fileInputStream new FileInputStream data data..

android capture video frame

http://stackoverflow.com/questions/5337505/android-capture-video-frame

MediaMetadataRetriever.MODE_CAPTURE_FRAME_ONLY retriever.setDataSource context videoUri return retriever.captureFrame catch IllegalArgumentException.. working. It throws an exception java.lang.RuntimeException setDataSource failed status 0x80000000 when I set data source. Do you know.. retriever new MediaMetadataRetriever try retriever.setDataSource FD return retriever.getFrameAtTime catch IllegalArgumentException..

MediaPlayer stutters at start of mp3 playback

http://stackoverflow.com/questions/5343730/mediaplayer-stutters-at-start-of-mp3-playback

not load sound. Toast.LENGTH_LONG .show return mPlayer.setDataSource afd.getFileDescriptor afd.getStartOffset afd.getLength afd.close.. getContext mAudioId and skip the calls to setDataSource ... and prepare . Then I noticed that LogCat always shows this.. your media player going with something like MediaPlayer.setDataSource http 127.0.0.1 8888 localfilepath I should note that it is rather..

Strange Behavior of Android VideoView - “Can't Play Video”

http://stackoverflow.com/questions/7806261/strange-behavior-of-android-videoview-cant-play-video

10 17 10 40 54.mp4 E MetadataDriver 2182 MetadataDriver setDataSource url file type is isAudiofile 0 D 2182 SISO TEST registering..

Media Player called in state 0, error (-38,0)

http://stackoverflow.com/questions/9008770/media-player-called-in-state-0-error-38-0

MediaPlayer mediaPlayer new MediaPlayer try mediaPlayer.setDataSource URL catch IllegalArgumentException e e.printStackTrace catch..

Playing sound in WebView from JavaScript

http://stackoverflow.com/questions/9162022/playing-sound-in-webview-from-javascript

for second trough fifth case I StagefrightPlayer 33 setDataSource 'file android_asset www audio sound.mp3' Although this question.. status PVMFSuccess 02 06 17 15 13.829 V PVPlayer 95 setDataSource file android_asset www audio sound.mp3 02 06 17 15 13.839 V..

Modifying FileInputStream for mediaPlayer setDataSource

http://stackoverflow.com/questions/9257364/modifying-fileinputstream-for-mediaplayer-setdatasource

FileInputStream for mediaPlayer setDataSource I'm trying to modify extend the FileInputStream class so that.. an encrypted file and use the stream for MediaPlayer's setDataSource FileDescriptor . Problem is I don't know which method should..

MediaPlayer setDataSource, better to use path or FileDescriptor?

http://stackoverflow.com/questions/9625680/mediaplayer-setdatasource-better-to-use-path-or-filedescriptor

setDataSource better to use path or FileDescriptor Let's say I have a full.. String filePath somepath somefile.mp3 mediaPlayer.setDataSource filePath OR String filePath somepath somefile.mp3 File file.. inputStream new FileInputStream file mediaPlayer.setDataSource inputStream.getFD inputStream.close Does it matter Simply using..

Android: How to create video player?

http://stackoverflow.com/questions/1188346/android-how-to-create-video-player

this mp.setAudioStreamType 2 mp.setDisplay mPreview.getHolder Runnable r new Runnable @Override public void run try setDataSource mPath catch Exception ex Log.e TAG ex.getMessage try mp.prepare Log.v TAG Duration mp.getDuration catch IllegalStateException.. new Thread r .start catch Exception ex String sDummy ex.toString if mp null mp.stop mp.release private void setDataSource String path throws IOException if URLUtil.isNetworkUrl mPath mp.setDataSource mPath else URL url new URL mPath URLConnection.. null mp.stop mp.release private void setDataSource String path throws IOException if URLUtil.isNetworkUrl mPath mp.setDataSource mPath else URL url new URL mPath URLConnection cn url.openConnection cn.connect InputStream stream cn.getInputStream if..

How to Play RTSP Video in Android?

http://stackoverflow.com/questions/12853769/how-to-play-rtsp-video-in-android

flinger 10 12 11 56 50.430 I AudioSystem 6880 returning new audio session id 10 12 11 56 50.430 D MediaPlayer 6880 setDataSource Context context rtsp v3.cache7.c.youtube.com CiILENy73wIaGQlOCTh0GvUeYRMYDSANFEgGUgZ2aWRlb3MM 0 0 0 video.3gp Map String.. client side trying server side 10 12 11 56 50.470 I MediaPlayer 6880 disable CIQ 10 12 11 56 50.470 D MediaPlayer 6880 setDataSource Context context rtsp v3.cache7.c.youtube.com CiILENy73wIaGQlOCTh0GvUeYRMYDSANFEgGUgZ2aWRlb3MM 0 0 0 video.3gp Map String..

Anyone Have MediaPlayer Working with ParcelFileDescriptor and createPipe()?

http://stackoverflow.com/questions/12920429/anyone-have-mediaplayer-working-with-parcelfiledescriptor-and-createpipe

I know that my clip is fine. I have changed my MediaPlayer setup to private void loadClip try mp new MediaPlayer mp.setDataSource this PipeProvider.CONTENT_URI.buildUpon .appendPath clip.ogg .build mp.setOnCompletionListener this mp.prepare catch.. D AudioFlinger 28138 nextUniqueId current 178 D IAudioFlinger 30916 newAudioSessionId Out id 178 D MediaPlayer 30916 setDataSource Context context content com.commonsware.android.audiolstream clip.ogg Map String String headers in D MediaPlayer 30916 setDataSource.. Context context content com.commonsware.android.audiolstream clip.ogg Map String String headers in D MediaPlayer 30916 setDataSource FileDescriptor fd in E MediaPlayerService 28138 offset error That offset error comes from the following lines in MediaPlayerService.cpp..

Android ShoutCast Internet Radio FilenotFoundException

http://stackoverflow.com/questions/16264225/android-shoutcast-internet-radio-filenotfoundexception

stopSelf return Thread t new Thread r t.start Download the url stream to a temporary location and then call the setDataSource for that local file public void downloadAudioIncrement String mediaUrl throws IOException int bufsizeForDownload 8 1024.. break File f new File context.getCacheDir DOWNFILE preparecounter FileInputStream ins new FileInputStream f mp1.setDataSource ins.getFD mp1.setAudioStreamType AudioManager.STREAM_MUSIC playing for live streaming mp1.setOnCompletionListener new.. break File f new File context.getCacheDir DOWNFILE preparecounter FileInputStream ins new FileInputStream f mp2.setDataSource ins.getFD mp2.setAudioStreamType AudioManager.STREAM_MUSIC mp2.setOnCompletionListener new listener mp2.setOnPreparedListener..

Play audio file from the assets directory

http://stackoverflow.com/questions/3289038/play-audio-file-from-the-assets-directory

I have the following code AssetFileDescriptor afd getAssets .openFd AudioFile.mp3 player new MediaPlayer player.setDataSource afd.getFileDescriptor player.prepare player.start The problem is that when I run this code it starts playing all the audio.. files to the res raw folder then I have a problem with reusing MediaPlayer s because there is no id parameter for setDataSource . I can't find a good guideline for handling this kind of problem. android audio android mediaplayer assets android assets.. this kind of problem. android audio android mediaplayer assets android assets share improve this question player.setDataSource afd.getFileDescriptor afd.getStartOffset afd.getLength Your version would work if you had only one file in the assets directory...

MediaPlayer.setDataSource() and prepare() not working - android

http://stackoverflow.com/questions/3533837/mediaplayer-setdatasource-and-prepare-not-working-android

and prepare not working android I'm having a crack at using the MediaPlayer object and not having much success. If I add.. R it works fine. But I want to be able to pull things off of url. According to all of the documentation I've read setDataSource should accept a string param with a url to a file. I keep getting an IO exception on the prepare statement. I've even tried.. even tried copying the file locally and still no dice. Anyone have any ideas MediaPlayer mp new MediaPlayer try mp.setDataSource http www.urltofile.com file.mp3 mp.prepare mp.start catch IllegalArgumentException e e.printStackTrace catch IllegalStateException..

Android playing resource files from internal storage causes MediaPlayer.prepare to give IOException

http://stackoverflow.com/questions/4833777/android-playing-resource-files-from-internal-storage-causes-mediaplayer-prepare

the internal directory designated for my app data data com... . It seems to download the files to that location okay setDataSource String path doesn't throw any exceptions but MediaPlayer.prepare throws IOException.The same code works on the SD card... R.layout.main DownloadFiles MusicPlay public void DownloadFiles Downloads Files public void MusicPlay try mp.setDataSource data data com.app.pronounce winds.mp3 catch IllegalArgumentException e1 e1.printStackTrace catch IllegalStateException.. rooted phones . Since the application owns the file it can create a file descriptor and pass that to mediaPlayer.setDataSource FileInputStream fileInputStream new FileInputStream data data com.mypackage myfile mediaPlayer.setDataSource fileInputStream.getFD..

android capture video frame

http://stackoverflow.com/questions/5337505/android-capture-video-frame

retriever new MediaMetadataRetriever try retriever.setMode MediaMetadataRetriever.MODE_CAPTURE_FRAME_ONLY retriever.setDataSource context videoUri return retriever.captureFrame catch IllegalArgumentException ex throw new RuntimeException catch RuntimeException.. finally retriever.release But this it's not working. It throws an exception java.lang.RuntimeException setDataSource failed status 0x80000000 when I set data source. Do you know how to make this code to work Or Do you have any similar simple.. Bitmap getVideoFrame FileDescriptor FD MediaMetadataRetriever retriever new MediaMetadataRetriever try retriever.setDataSource FD return retriever.getFrameAtTime catch IllegalArgumentException ex ex.printStackTrace catch RuntimeException ex ex.printStackTrace..

MediaPlayer stutters at start of mp3 playback

http://stackoverflow.com/questions/5343730/mediaplayer-stutters-at-start-of-mp3-playback

mAudioId if afd null Toast.makeText mOwner Could not load sound. Toast.LENGTH_LONG .show return mPlayer.setDataSource afd.getFileDescriptor afd.getStartOffset afd.getLength afd.close mPlayer.prepare catch Exception e Log.d LOG_TAG Could.. instead of as a resource. Create the MediaPlayer using MediaPlayer.create getContext mAudioId and skip the calls to setDataSource ... and prepare . Then I noticed that LogCat always shows this line at about the time that playback starts DEBUG AudioSink.. The basic use is that you instantiate it start it and set your media player going with something like MediaPlayer.setDataSource http 127.0.0.1 8888 localfilepath I should note that it is rather experimental and probably not entirely bug free. It was..

Strange Behavior of Android VideoView - “Can't Play Video”

http://stackoverflow.com/questions/7806261/strange-behavior-of-android-videoview-cant-play-video

2182 Use PV_PLAYER for url sdcard DCIM Camera video 2011 10 17 10 40 54.mp4 E MetadataDriver 2182 MetadataDriver setDataSource url file type is isAudiofile 0 D 2182 SISO TEST registering PVMFRecognizerPluginFactory D 2182 SISO TEST registering PVMFRecognizerPluginFactory..

Media Player called in state 0, error (-38,0)

http://stackoverflow.com/questions/9008770/media-player-called-in-state-0-error-38-0

URL for the station and am setting up the Media Player like MediaPlayer mediaPlayer new MediaPlayer try mediaPlayer.setDataSource URL catch IllegalArgumentException e e.printStackTrace catch SecurityException e e.printStackTrace catch IllegalStateException..

Playing sound in WebView from JavaScript

http://stackoverflow.com/questions/9162022/playing-sound-in-webview-from-javascript

from this info message the path to audio file should be correct for second trough fifth case I StagefrightPlayer 33 setDataSource 'file android_asset www audio sound.mp3' Although this question may be considered as duplicate of Android WebView playing.. 06 17 15 13.829 V PlayerDriver 95 Completed command PLAYER_SETUP status PVMFSuccess 02 06 17 15 13.829 V PVPlayer 95 setDataSource file android_asset www audio sound.mp3 02 06 17 15 13.839 V PVPlayer 95 prepareAsync 02 06 17 15 13.839 V PVPlayer 95 data..

Modifying FileInputStream for mediaPlayer setDataSource

http://stackoverflow.com/questions/9257364/modifying-fileinputstream-for-mediaplayer-setdatasource

FileInputStream for mediaPlayer setDataSource I'm trying to modify extend the FileInputStream class so that I can open an encrypted file and use the stream for MediaPlayer's.. to modify extend the FileInputStream class so that I can open an encrypted file and use the stream for MediaPlayer's setDataSource FileDescriptor . Problem is I don't know which method should be overridden to do the decryption inside the stream. I tried..

MediaPlayer setDataSource, better to use path or FileDescriptor?

http://stackoverflow.com/questions/9625680/mediaplayer-setdatasource-better-to-use-path-or-filedescriptor

setDataSource better to use path or FileDescriptor Let's say I have a full path to a file. Which is the better approach to loading that.. Which is the better approach to loading that file into a MediaPlayer String filePath somepath somefile.mp3 mediaPlayer.setDataSource filePath OR String filePath somepath somefile.mp3 File file new File filePath FileInputStream inputStream new FileInputStream.. somepath somefile.mp3 File file new File filePath FileInputStream inputStream new FileInputStream file mediaPlayer.setDataSource inputStream.getFD inputStream.close Does it matter Simply using the path seems easier but is there a reason to do the extra..