Skip to content

Commit

Permalink
releases/v0.1.0 (#22)
Browse files Browse the repository at this point in the history
# 🥳 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
  • Loading branch information
daytime-em committed Apr 5, 2023
1 parent 0c3ebbc commit 515ee80
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 10 deletions.
68 changes: 66 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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/)
8 changes: 0 additions & 8 deletions app/src/main/java/com/mux/video/vod/demo/Util.java

This file was deleted.

0 comments on commit 515ee80

Please sign in to comment.