如何使用标题和说明在youtube上传视频

时间:2015-03-21 11:49:29

标签: android android-youtube-api

如何通过intent上传带有标题和描述的视频。我通过此示例How to upload video to youtube in android?中的Intent尝试了但我只能设置一个视频。如何设置视频的标题和说明?谢谢。

这是我的代码的和平

 Video videoForShare = mListVideos.get(position);

            ContentValues content = new ContentValues(4);
            content.put(MediaStore.Video.VideoColumns.DATE_ADDED,
                    System.currentTimeMillis() / 1000);
            content.put(MediaStore.Video.Media.MIME_TYPE, "video/mp4");
            content.put(MediaStore.Video.Media.DATA, videoForShare.getVideoName());
            ContentResolver resolver = mContext.getContentResolver();
            Uri uri = resolver.insert(MediaStore.Video.Media.INTERNAL_CONTENT_URI, content);

            if (uri == null)
                uri = resolver.insert(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, content);

            Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
            sharingIntent.setType("video/*");
            sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Title");
            sharingIntent.putExtra(android.content.Intent.EXTRA_STREAM, uri);

            mContext.startActivity(Intent.createChooser(sharingIntent, "Upload video via: "));

0 个答案:

没有答案