From 515ee8024005d2dd9c4fdd0f3a01caa6e5fa8bde Mon Sep 17 00:00:00 2001 From: Emily Dixon Date: Wed, 5 Apr 2023 14:46:35 -0700 Subject: [PATCH] releases/v0.1.0 (#22) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 🥳 First beta release of the Mux Android SDK ## Features * Upload multiple files at once * Pause and resume uploads, even after process death * Observe upload progress from anywhere in your app without extra code --- README.md | 68 ++++++++++++++++++- .../java/com/mux/video/vod/demo/Util.java | 8 --- 2 files changed, 66 insertions(+), 10 deletions(-) delete mode 100644 app/src/main/java/com/mux/video/vod/demo/Util.java diff --git a/README.md b/README.md index f967c20d..af986202 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,66 @@ -# mux-vod-upload-android -An Android SDK for uploading video files to Mux Video VOD assets +# Mux's Android Upload SDK + +This SDK makes it easy to upload videos to Mux from an Android app. It handles large files by +breaking them into chunks and uploads each chunk individually. Each file that gets uploaded will get +sent to +an [upload URL created by a backend server](https://docs.mux.com/guides/video/upload-files-directly) +. **Do not include credentials to create an upload URL from an app.** + +## Usage + +To use this SDK, you must first add it as a dependency. The Mux Android Swift Upload SDK is +available via gradle + +### Add the SDK to your app + +#### Add the Mux maven repository + +Add Mux's maven repository to your project. Depending on your project configuration you may do this +in either `settings.gradle` or `build.gradle`. + +```groovy +repositories { + maven { + url "https://muxinc.jfrog.io/artifactory/default-maven-release-local" + } +} +``` + +### Add a dependency on our SDK + +```groovy +implememntation "com.mux.video:upload:0.1.0" +``` + +### Server-Side: Create a Direct Upload + +To start an upload, you must first create +an [upload URL](https://docs.mux.com/guides/video/upload-files-directly). Then, pass return that +direct-upload PUT URL to your app, so the app can begin the upload process + +### App-Side: Start your Upload + +Once you have your [upload URL](https://docs.mux.com/guides/video/upload-files-directly), create +a `MuxUpload` for your video file, that uploads to that URL. After that you just call start() + +Uploads created this way can be paused or resumed at will, even after the app is killed by the +system + +```kotlin +fun beginUpload(contentUri: Uri) { + viewModelScope.launch { + val upl = MuxUpload.Builder(myUploadUrl, myVideoFile).build() + upl.addProgressListener { innerUploads.postValue(uploadList) } + upl.addResultListener { + if (it.isSuccess) { + notifyUploadSuccess() + } else { + notifyUploadFail() + } + } + upl.start() + } +} +``` + +A simple example usage can be found in our [Example App](app/) diff --git a/app/src/main/java/com/mux/video/vod/demo/Util.java b/app/src/main/java/com/mux/video/vod/demo/Util.java deleted file mode 100644 index 3ba4fb74..00000000 --- a/app/src/main/java/com/mux/video/vod/demo/Util.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.mux.video.vod.demo; - - - -public class Util { - public void thing() { - } -}