Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7507647
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:31:50+00:00 2026-05-29T22:31:50+00:00

I’m using VideoView to display a rtsp streaming video. Below you can find a

  • 0

I’m using VideoView to display a rtsp streaming video. Below you can find a snippet of the code.

OnCreate() {
    ...
    // Setup video view
    videoView = (VideoView) findViewById(R.id.videoViewStream);
    videoView.setMediaController(new MediaController(this));
    ....
    // Create a button
}

OnButtonClickListener() {
    videoView.setVideoURI(Uri.parse(videoUri));
videoView.requestFocus();
}

I have no code concerning the VideoView in the OnResume and OnPause functions.

The use case for the problem is:

  1. Open the application and start the video
  2. I minimize the application to get to the Android Desktop
  3. Use other applications
  4. Re-open or re-trigger the Video Application
  5. Video is not display and not running. I have to reclick on the VideoView

The issue is then, how is it possible to get the video to be redisplayed again? Should I have to put start(), stop() or pause() the video?

Any help is welcome.

TA

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T22:31:51+00:00Added an answer on May 29, 2026 at 10:31 pm

    I would recommend you to save current video postition (and all you need in case of restart) and stop playback in onPause. In onDestroy you need to release mediaPlayer. If user returns you will then get onResume or onCreate. In onCreate you init player again like the first time. In onResume you create a safety check if player is really inited and if everything is ok start playback (or wait for click event). Check also last saved position for possible seek.

    I would extract code from OnButtonClickListener into separate method and call that method from clickListener or in onResume if you wish to autostart playback.

    Updated answer:

    I made a mistake with release. It’s done by VideoView in stopPlayback method (look into VideoView source code on grepcode).
    I don’t know how your RTSP streaming server works, but streaming server that I use doesn’t support seeking with VideoView’s seekTo method. You can call pause in onPause and start in onResume but this will start stream from 0 (in my case). So I had to create custom seekbar. But that’s another story.

    In my implementation I’m calling pause in onPause and stopPlayback in onDestroy. In onPause I also store last position. In onCreate I only get view and set media controls. In onResume I check if I have any info about last position. If this exist then I prepare player (setVideoPath, requestFocus, start) with that parameter (seek), otherwise without (seek = 0).

    That’s my solution 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Does anyone know how can I replace this 2 symbol below from the string
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.