AlbumCameraRecorder
1.1.80X
効率的なマルチメディアサポートオペレーションライブラリは、さまざまなシンプルな構成操作写真、アルバム、録音、録音、その他の機能にすることができます。
また、写真、ビデオ、オーディオ9グリッド機能の表示の使用をサポートします。
非Xライブラリバージョン、維持されなくなりました(https://github.com/zhongjhatc/albumcamerarecorder/tree/master)
allprojects {
repositories {
...
maven { url 'https://www.jitpack.io' }
}
}
dependencies {
// if you want to simplify the code and at the same time use multilibrary and progresslibrary, albumCameraRecorderCommon, can directly use the combined library
implementation 'com.github.zhongjhATC.AlbumCameraRecorder:combined:1.1.104X'
// Public library, if not using the combined library above
implementation 'com.github.zhongjhATC.AlbumCameraRecorder:common:1.1.104X'
// core lib, call display album, screen recording, recording, etc
implementation 'com.github.zhongjhATC.AlbumCameraRecorder:multilibrary:1.1.104X'
// It is mainly used to display the relevant upload progress after obtaining data. If you only need to obtain photos, videos and recordings, you don't need to use this
implementation 'com.github.zhongjhATC.AlbumCameraRecorder:progresslibrary:1.1.104X'
// use it with editing pictures
implementation 'com.github.zhongjhATC.AlbumCameraRecorder:imageedit:1.1.104X'
// Supporting editing video use, currently only compression function, continue to add related functions, because the library uses ffmpeg, occupies a file size of 25M, according to the actual situation to choose whether to use
implementation 'com.github.zhongjhATC.AlbumCameraRecorder:videoedit:1.1.104X'
// Because the library uses mp4parser, which takes up a file size of about 300kb, choose whether to use it according to the actual situation
implementation 'com.github.zhongjhATC.AlbumCameraRecorder:videomerge:1.1.104X'
}




100%スルースルーコンパビティテストレポート。
// Shooting Related Settings
CameraSetting cameraSetting = new CameraSetting();
// Types supported: picture, video
cameraSetting.mimeTypeSet(MimeType.ofAll());
// album
mAlbumSetting = new AlbumSetting(false)
// Types supported: picture, video
.mimeTypeSet(MimeType.ofAll())
// Whether to display the number of multiple selected images
.countable(true)
// Custom filter
.addFilter(new GifSizeFilter(320, 320, 5 * BaseFilter.K * BaseFilter.K))
// Open the original
.originalEnable(true)
// Maximum original size, valid only if originalEnable is true
.maxOriginalSize(10);
// recorder
RecorderSetting recorderSetting = new RecorderSetting();
// globalSetting
GlobalSetting globalSetting = MultiMediaSetting.from(MainActivity.this).choose(MimeType.ofAll());
globalSetting.cameraSetting(cameraSetting);
globalSetting.albumSetting(albumSetting);
globalSetting.recorderSetting(recorderSetting);
mGlobalSetting
.setOnMainListener(errorMessage -> {
Log.d(TAG, errorMessage);
Toast.makeText(MainSimpleActivity.this.getApplicationContext(), errorMessage, Toast.LENGTH_LONG).show();
})
// Set paths and 7.0 protection paths, and so on
.allStrategy(new SaveStrategy(true, "com.zhongjh.cameraapp.fileprovider", "aabb"))
// for glide-V4
.imageEngine(new Glide4Engine())
// Maximum 5 images or maximum 3 video
.maxSelectablePerMediaType(null,
5,
3,
3,
alreadyImageCount,
alreadyVideoCount,
alreadyAudioCount)
.forResult(REQUEST_CODE_CHOOSE);
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (resultCode != RESULT_OK)
return;
List<LocalFile> result = MultiMediaSetting.obtainLocalFileResult(data);
}
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.fileProvider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_paths_public" />
</provider>
簡単な拡張機能については、デモを参照してください。拡張機能の詳細についてもっと詳しく知る必要がある場合
[Cameraview](https://github.com/natario1/cameraview)のカメラの内部は、解像度を変更すると、テープ録画やその他の機能がより多くのインターフェイスを表示できるようにアクセスできるように閉じます。
表示されているライブラリを使用する場合、次のAPIも役立ちます
歴史の更新。
あなたがそれがうまくいくと思うなら、私に星をください(github)
バグが見つかった場合は、コメントを残すか、問題を残してください(問題
再版はソースを示してください