Editframe Kotlin Client library
Installing
Add the project to your gradle dependencies. It also depends on a ktor client.
plugins {
kotlin("jvm") version "1.6.10"
application
}
repositories {
mavenCentral()
}
dependencies {
implementation("com.editframe:editframe-kt-jvm:0.1.0-alpha")
implementation("io.ktor:ktor-client-cio:1.6.7")
}
Usage
import Editframe import com.editframe.modules.video.* import Filter.* // These values are found in the application page of the Editframe portal const val CLIENT_ID = "" const val API_TOKEN = "" suspend fun main(args: Array<String>) { // Instantiate a new API instance val api = Editframe(CLIENT_ID, API_TOKEN) // You can choose to override the default http implementation // Editframe(CLIENT_ID, API_TOKEN, httpClient =) val (id) = api.videos.newAndEncode { backgroundColor = "#333333" duration = 10 image("https://picfiles.alphacoders.com/282/thumb-1920-282237.jpg") filter(Brightness(-.1)) text("This is My Test Video With a Fox") { horizontalAlignment = AlignH.CENTER verticalAlignment = AlignV.MIDDLE color = "#ffffff" } } val video = api.videos.get(id) println(video) }
Testing
Library tests can be run with
$ ./gradlew test
To test GH actions you will need to install act
# act depends on docker
$ brew install --cask docker
$ brew install act
# use the appropriate docker architecture
$ act --container-architecture linux/amd64
Roadmap
- Use kotlin datetime when it becomes stable
- Create singleton requester wrapper around base class client