Skip to content

Commit

Permalink
refactor(android): migrate AudioOutput to Kotlin (#3993)
Browse files Browse the repository at this point in the history
* Rename .java to .kt

* refactor(android): migrate AudioOutput to Kotlin

* fix: lint error

* refactor: rename of variables
  • Loading branch information
seyedmostafahasani authored Jul 15, 2024
1 parent df9ffde commit 5abc223
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 38 deletions.
38 changes: 0 additions & 38 deletions android/src/main/java/com/brentvatne/exoplayer/AudioOutput.java

This file was deleted.

25 changes: 25 additions & 0 deletions android/src/main/java/com/brentvatne/exoplayer/AudioOutput.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.brentvatne.exoplayer

import android.annotation.SuppressLint
import androidx.media3.common.C

@SuppressLint("InlinedApi")
enum class AudioOutput(private val outputName: String, @C.StreamType val streamType: Int) {

SPEAKER("speaker", C.STREAM_TYPE_MUSIC),
EARPIECE("earpiece", C.STREAM_TYPE_VOICE_CALL);

companion object {
@JvmStatic
fun get(name: String): AudioOutput {
for (entry in entries) {
if (entry.outputName.equals(name, ignoreCase = true)) {
return entry
}
}
return SPEAKER
}
}

override fun toString(): String = "${javaClass.simpleName}($outputName, $streamType)"
}

0 comments on commit 5abc223

Please sign in to comment.