¡@

Home 

2014/10/16 ¤W¤È 08:19:30

android Programming Glossary: mmediaplayer

Playing video on TextureView

http://stackoverflow.com/questions/10736517/playing-video-on-textureview

TextureView.SurfaceTextureListener private MediaPlayer mMediaPlayer private TextureView mPreview @Override public void onCreate.. int width int height Surface s new Surface surface try mMediaPlayer new MediaPlayer mMediaPlayer.setDataSource http daily3gp.com.. s new Surface surface try mMediaPlayer new MediaPlayer mMediaPlayer.setDataSource http daily3gp.com vids 747.3gp mMediaPlayer.setSurface..

How to play ringtone/alarm sound in Android

http://stackoverflow.com/questions/2618182/how-to-play-ringtone-alarm-sound-in-android

RingtoneManager.getDefaultUri RingtoneManager.TYPE_ALARM mMediaPlayer new MediaPlayer mMediaPlayer.setDataSource this alert final.. RingtoneManager.TYPE_ALARM mMediaPlayer new MediaPlayer mMediaPlayer.setDataSource this alert final AudioManager audioManager AudioManager..

audio and video recording errors in android

http://stackoverflow.com/questions/3281549/audio-and-video-recording-errors-in-android

File audiofile File video private MediaPlayer mMediaPlayer Called when the activity is first created. @Override public.. setContentView R.layout.main mrec new MediaRecorder mMediaPlayer new MediaPlayer Log.i TAG Video starting startRecording Button.. new View.OnClickListener public void onClick View v try mMediaPlayer new MediaPlayer Context appContext getApplicationContext startRecording.setEnabled..

SurfaceView height + width gets ignored

http://stackoverflow.com/questions/8293909/surfaceview-height-width-gets-ignored

mVideoWidth private int mVideoHeight private MediaPlayer mMediaPlayer private SurfaceView mPreview private SurfaceHolder holder private.. this private void playVideo doCleanUp try mMediaPlayer new MediaPlayer this Intent myIntent this.getIntent String url.. this.getIntent String url myIntent.getStringExtra url mMediaPlayer.setDataSource url mMediaPlayer.setDisplay holder mMediaPlayer.prepareAsync..

How to play multiple video files simultaneously in one layout side by side in different view in Android

http://stackoverflow.com/questions/9834882/how-to-play-multiple-video-files-simultaneously-in-one-layout-side-by-side-in-di

R.id.video_3_surfaceview private MediaPlayer mMediaPlayers new MediaPlayer SURFACE_RES_IDS.length private SurfaceView.. if index 1 return sanity check should never happen try mMediaPlayers index new MediaPlayer AssetFileDescriptor afd getAssets .openFd.. AssetFileDescriptor afd getAssets .openFd sample.3gp mMediaPlayers index .setDataSource afd.getFileDescriptor afd.getStartOffset..

VideoView onResume loses buffered portion of the video

http://stackoverflow.com/questions/9987042/videoview-onresume-loses-buffered-portion-of-the-video

something as usual video is buffered. openVideo actually mMediaPlayer.prepareAsync is the first key point it is also called in other.. null mMediaController.hide release true release actually mMediaPlayer.release is the second key point it is also called in other two.. mVideoWidth private int mVideoHeight private MediaPlayer mMediaPlayer private SurfaceView mPreview private SurfaceHolder holder private..

Playing video on TextureView

http://stackoverflow.com/questions/10736517/playing-video-on-textureview

public class MediaPlayerDemo_Video extends Activity implements TextureView.SurfaceTextureListener private MediaPlayer mMediaPlayer private TextureView mPreview @Override public void onCreate Bundle icicle super.onCreate icicle mPreview TextureView findViewById.. public void onSurfaceTextureAvailable SurfaceTexture surface int width int height Surface s new Surface surface try mMediaPlayer new MediaPlayer mMediaPlayer.setDataSource http daily3gp.com vids 747.3gp mMediaPlayer.setSurface s mMediaPlayer.prepare.. SurfaceTexture surface int width int height Surface s new Surface surface try mMediaPlayer new MediaPlayer mMediaPlayer.setDataSource http daily3gp.com vids 747.3gp mMediaPlayer.setSurface s mMediaPlayer.prepare mMediaPlayer.setOnBufferingUpdateListener..

How to play ringtone/alarm sound in Android

http://stackoverflow.com/questions/2618182/how-to-play-ringtone-alarm-sound-in-android

and I cannot compile it. I cannot make this work Uri alert RingtoneManager.getDefaultUri RingtoneManager.TYPE_ALARM mMediaPlayer new MediaPlayer mMediaPlayer.setDataSource this alert final AudioManager audioManager AudioManager getSystemService Context.AUDIO_SERVICE.. cannot make this work Uri alert RingtoneManager.getDefaultUri RingtoneManager.TYPE_ALARM mMediaPlayer new MediaPlayer mMediaPlayer.setDataSource this alert final AudioManager audioManager AudioManager getSystemService Context.AUDIO_SERVICE if audioManager.getStreamVolume..

audio and video recording errors in android

http://stackoverflow.com/questions/3281549/audio-and-video-recording-errors-in-android

stopRecording null private static final String TAG SoundRecordingDemo File audiofile File video private MediaPlayer mMediaPlayer Called when the activity is first created. @Override public void onCreate Bundle savedInstanceState super.onCreate savedInstanceState.. Bundle savedInstanceState super.onCreate savedInstanceState setContentView R.layout.main mrec new MediaRecorder mMediaPlayer new MediaPlayer Log.i TAG Video starting startRecording Button findViewById R.id.startrecording stopRecording Button findViewById.. R.id.stoprecording startRecording.setOnClickListener new View.OnClickListener public void onClick View v try mMediaPlayer new MediaPlayer Context appContext getApplicationContext startRecording.setEnabled false stopRecording.setEnabled true..

SurfaceView height + width gets ignored

http://stackoverflow.com/questions/8293909/surfaceview-height-width-gets-ignored

private static final String TAG MediaPlayerDemo private int mVideoWidth private int mVideoHeight private MediaPlayer mMediaPlayer private SurfaceView mPreview private SurfaceHolder holder private boolean mIsVideoSizeKnown false private boolean mIsVideoReadyToBePlayed.. findViewById R.id.surface holder mPreview.getHolder holder.addCallback this private void playVideo doCleanUp try mMediaPlayer new MediaPlayer this Intent myIntent this.getIntent String url myIntent.getStringExtra url mMediaPlayer.setDataSource url.. doCleanUp try mMediaPlayer new MediaPlayer this Intent myIntent this.getIntent String url myIntent.getStringExtra url mMediaPlayer.setDataSource url mMediaPlayer.setDisplay holder mMediaPlayer.prepareAsync mMediaPlayer.setScreenOnWhilePlaying true mMediaPlayer.setOnBufferingUpdateListener..

How to play multiple video files simultaneously in one layout side by side in different view in Android

http://stackoverflow.com/questions/9834882/how-to-play-multiple-video-files-simultaneously-in-one-layout-side-by-side-in-di

int SURFACE_RES_IDS R.id.video_1_surfaceview R.id.video_2_surfaceview R.id.video_3_surfaceview private MediaPlayer mMediaPlayers new MediaPlayer SURFACE_RES_IDS.length private SurfaceView mSurfaceViews new SurfaceView SURFACE_RES_IDS.length private.. indexOf holder surfaceCreated called int index indexOf holder if index 1 return sanity check should never happen try mMediaPlayers index new MediaPlayer AssetFileDescriptor afd getAssets .openFd sample.3gp mMediaPlayers index .setDataSource afd.getFileDescriptor.. should never happen try mMediaPlayers index new MediaPlayer AssetFileDescriptor afd getAssets .openFd sample.3gp mMediaPlayers index .setDataSource afd.getFileDescriptor afd.getStartOffset afd.getLength mMediaPlayers index .setDisplay mSurfaceHolders..

VideoView onResume loses buffered portion of the video

http://stackoverflow.com/questions/9987042/videoview-onresume-loses-buffered-portion-of-the-video

holder if videoOpened openVideo if first time opened do something as usual video is buffered. openVideo actually mMediaPlayer.prepareAsync is the first key point it is also called in other two VideoView's public methods setVideoURI and resume make.. surface any more. mSurfaceHolder null if mMediaController null mMediaController.hide release true release actually mMediaPlayer.release is the second key point it is also called in other two VideoView's public methods stopPlayback and suspend make.. final String TAG BufferedMediaPlayerActivity private int mVideoWidth private int mVideoHeight private MediaPlayer mMediaPlayer private SurfaceView mPreview private SurfaceHolder holder private String path private boolean mIsVideoReadyToBePlayed false..