WeAccess.Ai WeSign Video Sign Language SDK Integration for Android Applications

WeAccess.Ai WeSign Video Sign Language SDK Integration for Android Applications
Step 1. Add JitPack to settings.gradle
Open your settings.gradle file and add the JitPack repository:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}Step 2. Add Dependency to build.gradle
Add the following line to your app/build.gradle file:
dependencies {
implementation 'com.github.signfordeaf:video-sign-translate-kt:1.0.1'
}Permissions
Add this permission to your AndroidManifest.xml file:
<uses-permission android:name="android.permission.INTERNET" />Usage
Step 4.1 XML Layout
Add the WeSign view to your layout file (e.g., activity_main.xml):
<com.weaccess.wesign.WeSign
android:id="@+id/weSign"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />Step 4.2 Kotlin Class
Initialize the SDK and associate your video player:
class MainActivity : AppCompatActivity() {
private lateinit var weSign: WeSign
private lateinit var playerView: PlayerView
private lateinit var player: ExoPlayer
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
WeAccessConfig.initialize("YOUR_API_KEY")
setContentView(R.layout.activity_main)
weSign = findViewById(R.id.weSign)
player = ExoPlayer.Builder(this).build()
playerView = PlayerView(this)
val videoUri = Uri.parse("android.resource://${packageName}/${R.raw.sample_video}")
// Place sample_video.mp4 inside res/raw directory
val mediaItem = MediaItem.fromUri(videoUri)
player.setMediaItem(mediaItem)
player.prepare()
playerView.player = player
weSign.setPlayer(playerView)
}
}
