Commit 33785624 authored by Yusuke Iwaki's avatar Yusuke Iwaki

add "record audio", "record video"

parent 9445f491
package chat.rocket.android.layouthelper.extra_action.upload;
import android.content.Intent;
import android.provider.MediaStore;
import chat.rocket.android.R;
......@@ -16,7 +17,13 @@ public class AudioUploadActionItem extends AbstractUploadActionItem {
Intent intent = new Intent();
intent.setType("audio/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
return Intent.createChooser(intent, "Select Audio to Upload");
Intent recordSoundIntent = new Intent(MediaStore.Audio.Media.RECORD_SOUND_ACTION);
Intent chooserIntent = Intent.createChooser(intent, "Select Audio to Upload");
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[] { recordSoundIntent });
return chooserIntent;
}
@Override
......
package chat.rocket.android.layouthelper.extra_action.upload;
import android.content.Intent;
import android.provider.MediaStore;
import chat.rocket.android.R;
......@@ -16,7 +17,14 @@ public class VideoUploadActionItem extends AbstractUploadActionItem {
Intent intent = new Intent();
intent.setType("video/*");
intent.setAction(Intent.ACTION_GET_CONTENT);
return Intent.createChooser(intent, "Select Video to Upload");
Intent recordVideoIntent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
recordVideoIntent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 0); //low quality.
Intent chooserIntent = Intent.createChooser(intent, "Select Video to Upload");
chooserIntent.putExtra(Intent.EXTRA_INITIAL_INTENTS, new Intent[] { recordVideoIntent });
return chooserIntent;
}
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment