* feat(android): implement AndroidX media3 dependencies * refactor(android): remove duplicate code * refactor(android): remove unused codes * feat(android): replace ExoPlayer2 with AndroidX media3 * fix(android): move default properties to gradle.properties * revert(android): prevent security exception * chore: align indent * chore: remove redundant comments * chore: reorder import * fix: apply media3's legacy player control view
36 lines
876 B
Java
36 lines
876 B
Java
package com.brentvatne.exoplayer;
|
|
|
|
import android.annotation.SuppressLint;
|
|
|
|
import androidx.media3.common.C;
|
|
|
|
@SuppressLint("InlinedApi")
|
|
public enum AudioOutput {
|
|
SPEAKER("speaker", C.STREAM_TYPE_MUSIC),
|
|
EARPIECE("earpiece", C.STREAM_TYPE_VOICE_CALL);
|
|
|
|
private final @C.StreamType int streamType;
|
|
private final String mName;
|
|
|
|
AudioOutput(final String name, @C.StreamType int stream) {
|
|
mName = name;
|
|
streamType = stream;
|
|
}
|
|
|
|
public static AudioOutput get(String name) {
|
|
for (AudioOutput d : values()) {
|
|
if (d.mName.equalsIgnoreCase(name))
|
|
return d;
|
|
}
|
|
return SPEAKER;
|
|
}
|
|
|
|
public int getStreamType() {
|
|
return streamType;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return getClass().getSimpleName() + "(" + this.mName + ", " + streamType + ")";
|
|
}
|
|
} |