-1

I want to upload video on you-tube and i am uploading video using this code but the problem is that whenever i click the button from my app then i have to select you-tube from list view of email,Bluetooth,you-tube,etc..

So i want the permanent solution for this that whenever i click a button from my app it automatically moves to you-tube without showing list view.

So, this is my code which i used to upload video over you-tube.

              **ContentValues content = new ContentValues(4);
                content.put(Video.VideoColumns.TITLE, "My Test");
                content.put(Video.VideoColumns.DATE_ADDED,
                System.currentTimeMillis() / 1000);
                content.put(Video.Media.MIME_TYPE, "video/mp4");
                content.put(MediaStore.Video.Media.DATA, outputFile);
                ContentResolver resolver = getContentResolver();
                Uri uri = resolver.insert(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,content);

                Intent intent = new Intent(Intent.ACTION_SEND);
                intent.setType("video/*");
                intent.putExtra(Intent.EXTRA_STREAM, uri);
                startActivity(Intent.createChooser(intent, "Share using"));**
Vikram Mahal
  • 31
  • 1
  • 4

1 Answers1

0

This might help you,

String url = "http://youtu.be/mo1DmO9JH3Y"; // Your Url here..
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("vnd.youtube://"+url));  
activity.startActivity(intent);
Anthon
  • 69,918
  • 32
  • 186
  • 246
Ajay
  • 1,189
  • 1
  • 12
  • 28