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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:01:02+00:00 2026-06-07T12:01:02+00:00

Somewhere in my Android app I would like to play a youtube video, in

  • 0

Somewhere in my Android app I would like to play a youtube video,
in my activity, in a small view.
I’m trying to do this using VideoView, but no luck so far..

I wrote a simple activity, here is my code so far:

public class MainView extends Activity {

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    VideoView videoView = (VideoView) findViewById(R.id.VideoView);
    MediaController mediaController = new MediaController(this);
    mediaController.setAnchorView(videoView);
    /*working good but IT'S NOT youtube*/ //Uri video = Uri.parse("http://commonsware.com/misc/test2.3gp"); 
    /*NOT WORKING*/ //Uri video = Uri.parse("http://www.youtube.com/watch?v=hLQl3WQQoQ0&ob=av2e");
    /*NOT WORKING (RTSP)*/ //Uri video = U-ri.parse("http://m.youtube.com/watch?gl=IL&hl=en&client=mv-google&feature=grec_mobile&v=6WHRxXY67UA");
    /*NOT WORKING (RTSP)*/Uri video = Uri.parse("http://m.youtube.com/watch?gl=IL&hl=en&client=mv-google&v=wWub_aXPCVg");
    videoView.setMediaController(mediaController);
    videoView.setVideoURI(video);
    videoView.start();
   }
}

is it possible?
is there any other SDK component that can do that?
any ideas?

Thanks,
Amitos80

  • 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-07T12:01:04+00:00Added an answer on June 7, 2026 at 12:01 pm

    Google are releasing android components for YouTube “in the coming months”, so hopefully by the end of 2012.

    What I am doing in the meantime is using a WebView with loadData(), and passing in an IFrame as stated on the YoUTube API page. The Iframe is quite limited (most parameters don’t even work, like controls=0), so if you need more flexibility like controlling the view then use the JavaScript API and then embed the JavaScript in the HTMl you pass into loadData.

    I tried the Media Controller and couldn’t get it to work, even though YouTube use it in there own app.

    The other thing to try which i didn’t get around to. Is to use the google search apis. You can specify a YouTube video and it will give you the URL’s to the thumbnails, videos etc. This way you can get to the raw files (www.youtube.com/…../…./myfile.3gp) rather than calling a webpage. These might then be loadable in the MediaController.

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

Sidebar

Related Questions

I would like to create an activity with layout like has Google+ Android App
I'm currently working on an Android app. I would like to use the app
I'm trying to write a voip app for Android, using the Android SIP API
I would like to somehow send a file from my app on one android
I'm trying to parse some html using jsoup (1.3.3) in my android activity. When
I'm in the middle of writing an Android app, and would like to give
Is there a resource somewhere that says what pieces of an Android app are
In my android app, I show an Activity as a dialog. When the user
I have an Android app where i'm using tabs (with ActionBarSherlock). So my main
I'm writing my first 2D app for Android using OpenGL. I'm writing it on

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.