Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(oas): add example for upload for Android #72

Merged
merged 1 commit into from
Oct 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,21 @@ paths:
}
}
}
- language: android
code: |
// First add the "video.api:android-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-android-client/blob/main/docs/VideosApi.md#upload

VideosApiStore.initialize("YOUR_API_KEY")
// if you rather like to use the sandbox environment:
// VideosApiStore.initialize("YOUR_SANDBOX_API_KEY", Environment.SANDBOX)

val workManager = WorkManager.getInstance(context) // WorkManager comes from package "androidx.work:work-runtime"

val videoId = "vi4k0jvEUuaTdRAEjQ4Jfrgz" // The videoId you want to use to upload your video.
val file = File("/path/to/file") // The path to the video you want to upload.

workManager.upload(videoId, file) // Dispatch the upload with the WorkManager
- language: csharp
code: |
// First add the "ApiVideo" NuGet package to your project
Expand Down Expand Up @@ -3377,6 +3392,17 @@ paths:
code: |
// First add the "video.api:java-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-java-client/blob/main/docs/VideosApi.md#uploadWithUploadToken
- language: android
code: |
// First add the "video.api:android-api-client" maven dependency to your project
// Documentation: https://github.com/apivideo/api.video-android-client/blob/main/docs/VideosApi.md#uploadWithUploadToken

val workManager = WorkManager.getInstance(context) // WorkManager comes from package "androidx.work:work-runtime"

val token = "to1tcmSFHeYY5KzyhOqVKMKb" // The unique identifier for the token you want to use to upload a video.
val file = File("/path/to/file") // The path to the video you want to upload.

workManager.uploadWithUploadToken(token, file) // Dispatch the upload with the WorkManager
- language: csharp
code: |
// First add the "ApiVideo" NuGet package to your project
Expand Down
Loading