How to resume video after a pause call in videoview android

In this example video get stuck on the last frame when it is paused and never starts again.It never goes inside the setOnPreparedListener.

public void pauseVideo(){ videoPos=videoView.getCurrentPosition(); Log.w("Video Position", Integer.toString(videoPos)); isVideoPaused=true; videoView.pause(); } public void resumeVideo(){ Log.w("Video Pos in resume", Integer.toString(videoPos)); videoView.seekTo(videoPos); videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { @Override public void onPrepared(MediaPlayer mp) { Log.w("Inside on prepared","finally inside"); mp.setOnSeekCompleteListener(new MediaPlayer.OnSeekCompleteListener() { @Override public void onSeekComplete(MediaPlayer mp) { Log.w("Inside on seek complete","finally inside"); videoView.start(); } }); } }); }

--------------Solutions-------------

there is no need to set setOnPreparedListener, Just use below code:

videoView.seekTo(video_pos);
videoView.start();

Category:android Time:2018-12-18 Views:2

Related post

  • MVC 3 - How to RedirectToAction immediately after asynchronous WCF call 2011-06-09

    How do i get my MVCcontroller method to call a long running WCF task asynchronously and redirect immediately after the asynchronously call is fired? I have configured my WCF service reference to "Generate asynchronously operations" yet when the metho

  • how to get videos to not pause or delay 2012-03-31

    how can i get my videos to not pause or delay --------------Solutions------------- Do you mean Videos which you play in Window Media Player, or Videos which you view in a browser, from online sources? If you mean online videos played through the brow

  • How to resume video playback after the surface was destroyed? 2010-04-28

    I'm working with the media player on a streaming application (RTSP): Video and sound are played great but when an incoming call pauses the Activity, the Surface is destroyed (I know this because of traces in SurfaceHolder.Callback). Once the call fin

  • music player will not resume playing after a phone call interrupts the playback 2012-11-10

    this happens especially with my Bluetooth headset, whenever a call interrupts the music i am listening to i find it difficult to resume playback of the music and the Bluetooth headset seem unrecognized unless i switched off the Bluetooth and switch i

  • How to flush output after each `echo` call? 2010-06-28

    I have a php script that only produces logs to the client. When I echo something, I want it to be transferred to client on-the-fly. (Because while the script is processing, the page is blank) I had already played around with ob_start() and ob_flush()

  • How to resume playing after i sliding the indicator of the slider in my custom moviePlayer? 2010-07-07

    In my custom movie player ,i use [player setInitialPlaybackTime:playSlider.value]; to make the movie resume playing at the time i slide to,but it has this situation: the indicator returns to the start of the movie,then go to the time playSlider.value

  • How to play video after onClick on "Show Video" button? 2011-05-16

    Can someone tell me what is the specific code i should add into my current codes to play the video? public class ViewVideo extends Activity { private String filename; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedIns

  • How to return value after asynchronous ajax call is completed? 2011-11-30

    Possible Duplicate: AJAX- response data not saved to global scope? Inside of function that gets the thumbnails of vimeo video using vimeo API: function getVimeoThumb(){ var t = new Array(); $.ajax({ 'url' : 'http://vimeo.com/api/v2/video/' + id + '.j

  • Resume video after video player has switched itself to the store front? 2013-02-27

    If I watch a video through the video player on Windows 8.1 and then minimize for more than a few seconds, it will go to the video store when I maximize it again. There used to be a way to resume the video I was watching but since the last (terrible)

  • After making a call programatically, my android app crashes 2010-05-04

    The title explains all... I have this snippet of code in my application: String url = createTelUrl("3112007315"); Intent intent = new Intent(Intent.ACTION_CALL); intent.setData(Uri.parse(url)); context.startActivity(intent); It does make a call, but

  • How to Resume Previous running application from An Application in Android? 2011-06-20

    Give me a little guidance: as My Application is running with Broadcast Receiver and when ever my application in Background and any incoming event comes it triggers the my Application. Now we want as We are listening or playing some video file or brow

  • how to record video of my application screen programmatically in android 2011-07-19

    I am developing Android application. In my application, I have to capture a screen animation for few seconds as video in programmatically. Is it possible? When I Googled all the code are for starting camera in video mode or capture the system screen

  • How to play video in inside of image view in android 2011-04-23

    I am putting imageview with play button, if user click the play button, then videoview will be played inside the imageview. can anybody help in this problem please with some sample ? Thanks --------------Solutions------------- Mohan I got your proble

  • How to delete particular contacts in recent call list in android? 2011-11-18

    I have created a hash map with unique keys and their boolean value. In keys I am getting the row unique ID of callog.calls. What I want is that those keys who has corresponding true value will get deleted from recent call list in phone. I need to kno

  • how to terminate any application on End Call pressed in android? 2012-02-03

    I am starting an activity on"TelephonyManager.EXTRA_STATE_OFFHOOK" and it works well also. but in"TelephonyManager.EXTRA_STATE_IDLE" i want to terminate that previously opened activity. I tried setting global variable, and that global variable intera

  • How to turn list scrolling off when calling onContentChanged in Android ListActivity? 2010-07-01

    I got a ListActivity. I update the activity using onContentChanged() API. My problem is that each time I call the above API the list scrolls to the top. Is there any easy way to turn this "feature" off? Thanks. / Henrik --------------Solutions-------

  • How to Hide Video view's Seekbar or Progressbar in android 2011-10-01

    i am doing live streaming and play video in video view. i want to hide default progress bar of video view . so i kindly request for my problem if anybody have good solution for my problem please send me. Thanx in advance....... --------------Solution

  • How to access video files from sd card folder in android app 2011-10-14

    I am trying to display video files in listview from folder created in sdcard. I am using content provider such as: videocursor = managedQuery(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, proj, null, null, null); But it reads all video files stored in

  • How to stream video using AIR Flex Mobile SDK for Android? 2012-04-16

    I am merely trying to stream a video file that's on the web in a Flex Mobile AIR project on an Android device (Nexus S). my file format is H.264 .mp4 i'm using a stageWebView loading a remote webpage that has a video tag with the video set as the sou

Copyright (C) pcaskme.com, All Rights Reserved.

processed in 0.776 (s). 13 q(s)