android Programming Glossary: playvideo
Android: How to create video player? http://stackoverflow.com/questions/1188346/android-how-to-create-video-player View.OnClickListener @Override public void onClick View v playVideo btnPause.setOnClickListener new View.OnClickListener @Override.. holder TODO Auto generated method stub private void playVideo try mp new MediaPlayer mp.setOnErrorListener this mp.setOnBufferingUpdateListener..
Full screen videoview without stretching the video http://stackoverflow.com/questions/12211837/full-screen-videoview-without-stretching-the-video true player.setDisplay holder private void playVideo new Thread new Runnable public void run try player.setDataSource.. stub public void surfaceCreated SurfaceHolder holder playVideo public void surfaceDestroyed SurfaceHolder holder TODO Auto..
Listener (or handler) for video finish http://stackoverflow.com/questions/1847818/listener-or-handler-for-video-finish videoView VideoView this.findViewById R.id.videoView playVideo video finish listener videoView.setOnCompletionListener new.. @Override public void onCompletion MediaPlayer mp not playVideo playVideo mp.start public void playVideo MediaController.. public void onCompletion MediaPlayer mp not playVideo playVideo mp.start public void playVideo MediaController mc new MediaController..
MediaController with MediaPlayer http://stackoverflow.com/questions/2961749/mediacontroller-with-mediaplayer again mcontroller.show return false ...... private void playVideo doCleanUp try path getIntent .getStringExtra url if path Toast.makeText..
Android: MediaPlayer gapless or seamless Video Playing http://stackoverflow.com/questions/3877119/android-mediaplayer-gapless-or-seamless-video-playing new File Environment.getExternalStorageDirectory file2.mp4 playVideo clip.getAbsolutePath public void onPrepared MediaPlayer mediaplayer.. player.getVideoHeight player.start private void playVideo String url try File clip new File Environment.getExternalStorageDirectory..
Play m3u8 video in android http://stackoverflow.com/questions/8270060/play-m3u8-video-in-android SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS private void playVideo doCleanUp try TODO Set path variable to progressive streamable.. SurfaceHolder holder Log.d TAG surfaceCreated called playVideo @Override protected void onPause super.onPause releaseMediaPlayer..
SurfaceView height + width gets ignored http://stackoverflow.com/questions/8293909/surfaceview-height-width-gets-ignored mPreview.getHolder holder.addCallback this private void playVideo doCleanUp try mMediaPlayer new MediaPlayer this Intent myIntent.. SurfaceHolder holder Log.d TAG surfaceCreated called playVideo @Override protected void onPause super.onPause releaseMediaPlayer..
Pass and return the values from javascript and android and use as a phone gap plugin http://stackoverflow.com/questions/8982570/pass-and-return-the-values-from-javascript-and-android-and-use-as-a-phone-gap-pl the page you provide the following method script function playVideo video window.JSInterface.startVideo video script Easy isn't..
VideoView onResume loses buffered portion of the video http://stackoverflow.com/questions/9987042/videoview-onresume-loses-buffered-portion-of-the-video null mIsVideoReadyToBePlayed false private void playVideo mIsVideoReadyToBePlayed false try Create a new media player.. Log.d TAG surfaceCreated called if mIsVideoReadyToBePlayed playVideo else mMediaPlayer.start @Override public void surfaceDestroyed..
Android: How to create video player? http://stackoverflow.com/questions/1188346/android-how-to-create-video-player getPathFromParentDialog btnPlay.setOnClickListener new View.OnClickListener @Override public void onClick View v playVideo btnPause.setOnClickListener new View.OnClickListener @Override public void onClick View v TODO Auto generated method stub.. method stub @Override public void surfaceDestroyed SurfaceHolder holder TODO Auto generated method stub private void playVideo try mp new MediaPlayer mp.setOnErrorListener this mp.setOnBufferingUpdateListener this mp.setOnCompletionListener this mp.setOnPreparedListener..
Full screen videoview without stretching the video http://stackoverflow.com/questions/12211837/full-screen-videoview-without-stretching-the-video this player.setOnCompletionListener this player.setScreenOnWhilePlaying true player.setDisplay holder private void playVideo new Thread new Runnable public void run try player.setDataSource video_uri player.prepare catch Exception e I can split.. holder int format int width int height TODO Auto generated method stub public void surfaceCreated SurfaceHolder holder playVideo public void surfaceDestroyed SurfaceHolder holder TODO Auto generated method stub prepare the video public void onPrepared..
Listener (or handler) for video finish http://stackoverflow.com/questions/1847818/listener-or-handler-for-video-finish savedInstanceState this.setContentView R.layout.player videoView VideoView this.findViewById R.id.videoView playVideo video finish listener videoView.setOnCompletionListener new MediaPlayer.OnCompletionListener @Override public void onCompletion.. new MediaPlayer.OnCompletionListener @Override public void onCompletion MediaPlayer mp not playVideo playVideo mp.start public void playVideo MediaController mc new MediaController this videoView.setMediaController.. new MediaPlayer.OnCompletionListener @Override public void onCompletion MediaPlayer mp not playVideo playVideo mp.start public void playVideo MediaController mc new MediaController this videoView.setMediaController mc videoView.setVideoURI..
MediaController with MediaPlayer http://stackoverflow.com/questions/2961749/mediacontroller-with-mediaplayer will hide after 3 seconds tap the screen to make it appear again mcontroller.show return false ...... private void playVideo doCleanUp try path getIntent .getStringExtra url if path Toast.makeText ActivityVedioPlay.this URL Not found Toast.LENGTH_LONG..
Android: MediaPlayer gapless or seamless Video Playing http://stackoverflow.com/questions/3877119/android-mediaplayer-gapless-or-seamless-video-playing public void onCompletion MediaPlayer arg0 File clip new File Environment.getExternalStorageDirectory file2.mp4 playVideo clip.getAbsolutePath public void onPrepared MediaPlayer mediaplayer holder.setFixedSize player.getVideoWidth player.getVideoHeight.. MediaPlayer mediaplayer holder.setFixedSize player.getVideoWidth player.getVideoHeight player.start private void playVideo String url try File clip new File Environment.getExternalStorageDirectory file1.mp4 if player null player new MediaPlayer..
Play m3u8 video in android http://stackoverflow.com/questions/8270060/play-m3u8-video-in-android holder mPreview.getHolder holder.addCallback this holder.setType SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS private void playVideo doCleanUp try TODO Set path variable to progressive streamable mp4 or 3gpp format URL. Http protocol should be used... Log.d TAG surfaceDestroyed called public void surfaceCreated SurfaceHolder holder Log.d TAG surfaceCreated called playVideo @Override protected void onPause super.onPause releaseMediaPlayer doCleanUp @Override protected void onDestroy super.onDestroy..
SurfaceView height + width gets ignored http://stackoverflow.com/questions/8293909/surfaceview-height-width-gets-ignored mPreview SurfaceView 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.. Log.d TAG surfaceDestroyed called public void surfaceCreated SurfaceHolder holder Log.d TAG surfaceCreated called playVideo @Override protected void onPause super.onPause releaseMediaPlayer doCleanUp @Override protected void onDestroy super.onDestroy..
Pass and return the values from javascript and android and use as a phone gap plugin http://stackoverflow.com/questions/8982570/pass-and-return-the-values-from-javascript-and-android-and-use-as-a-phone-gap-pl intent Now if yo want to call this code form the html of the page you provide the following method script function playVideo video window.JSInterface.startVideo video script Easy isn't it Calling javascript code from native code This is also simple..
VideoView onResume loses buffered portion of the video http://stackoverflow.com/questions/9987042/videoview-onresume-loses-buffered-portion-of-the-video super.onDestroy if mMediaPlayer null mMediaPlayer.release mMediaPlayer null mIsVideoReadyToBePlayed false private void playVideo mIsVideoReadyToBePlayed false try Create a new media player and set the listeners mMediaPlayer new MediaPlayer mMediaPlayer.setDataSource.. @Override public void surfaceCreated SurfaceHolder holder Log.d TAG surfaceCreated called if mIsVideoReadyToBePlayed playVideo else mMediaPlayer.start @Override public void surfaceDestroyed SurfaceHolder surfaceholder Log.d TAG surfaceDestroyed called..
|