Skip to content

Instantly share code, notes, and snippets.

@halilozel1903
Created September 14, 2022 19:46
Show Gist options
  • Save halilozel1903/d218a76906e64ddaf28d7b8dc1afb323 to your computer and use it in GitHub Desktop.
Save halilozel1903/d218a76906e64ddaf28d7b8dc1afb323 to your computer and use it in GitHub Desktop.
How to check media type in ExoPlayer?
private fun checkMediaType() {
val type = when(Util.inferContentType(URL.toUri())){
C.CONTENT_TYPE_HLS -> {
println("Type HLS")
}
C.CONTENT_TYPE_DASH -> {
println("Type DAS")
}
C.CONTENT_TYPE_OTHER -> {
println("Type OTHER")
}
C.CONTENT_TYPE_SS -> {
println("Type SS")
}
C.CONTENT_TYPE_RTSP -> {
println("Type RTSP")
}
else -> {}
}
return type
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment