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 7741845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:07:58+00:00 2026-06-01T09:07:58+00:00

i have to make an application where i need to play two video simultaniously,on

  • 0

i have to make an application where i need to play two video simultaniously,on screen.
here is my code.but the video dose not play.am i doing wrong anywhere? 🙁

    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    VideoView myVideoView = (VideoView)findViewById(R.id.myvideoview);
    myVideoView.setVideoURI(Uri.parse(SrcPath));
    myVideoView.setMediaController(new MediaController(this));
    myVideoView.requestFocus();
    myVideoView.start();
    VideoView myVideoView2 = (VideoView)findViewById(R.id.myvideoview2);
    myVideoView2.setVideoURI(Uri.parse(SrcPath2));

    myVideoView2.setMediaController(new MediaController(this));
    myVideoView2.requestFocus();
    myVideoView2.start();
    }
  • 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-06-01T09:07:59+00:00Added an answer on June 1, 2026 at 9:07 am

    I think you require two separate threads for playing two videos. since IO operations are blocking… One of the video Player may starve for CPU… Call start() in two separate threads…. Hope that helps!!!

    EDIT
    first remove the start() calls from onCreate().. Create two separate threads

        Thread view1Thrad = new Thread(new Runnable(){
        @Override
        public void run(){
    android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_DISPLAY);
        myVideoView.start();
        });
        Thread view2Thrad = new Thread(new Runnable(){
            @Override
            public void run(){
    android.os.Process.setThreadPriority(android.os.Process.THREAD_PRIORITY_URGENT_DISPLAY);
            myVideoView2.start();
            });
    

    now start these threads one by one…

    view1Thread.start(); //starts first video
    view2Thread.start(); //starts second video
    

    Hope that helps!!!

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

Sidebar

Related Questions

I have an application that will need to make a call and play a
I have a relatively simple application which I need to make native Mac OSX
I have been developing an asp.net mvc application where i need to make large
I have created an application. I usually make changes in my application. But the
I have make an application. In this application client need that when user download
I need to obtain the server time but I only have javascript to play
I have some code that I am trying to make it play nicely with
i have to make an android application in which i need to find the
I have to make a graphical user interface application using the language of my
I have to make a connection to an XMLRPC site from a web application,

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.