Greetings to all
Can someone help me to pass this code from android studio to b4a?
I know it can be done because I have seen something similar in several posts on this forum:
www.b4x.com
www.b4x.com
I've looked up and down the forum but can't find anything, and I've done 200 tests, but I can't get it to work.
It seems easy, but I can't do it.
I would be very grateful to anyone who can give me a hand.
Thank you
Can someone help me to pass this code from android studio to b4a?
B4X:
playVideo("nrQFDeRLSAKTLifXUIPiZg","FmY0xnWCPCNaSpRG-tUuTQ")
fun playVideo( id: String, value: String){
try {
drmSessionManager =
Util.getDrmUuid(C.CLEARKEY_UUID.toString())?.let { buildDrmSessionManager(
it,
true,
id,
value
) }
} catch (e: UnsupportedDrmException) {
e.printStackTrace()
}
exoPlayer?.prepare(buildDashMediaSource(Uri.parse("https://media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest_ClearKey.mpd")))
exoPlayer?.playWhenReady = true
}
@Throws(UnsupportedDrmException::class)
private fun buildDrmSessionManager(uuid: UUID, multiSession: Boolean, id: String, value: String): DefaultDrmSessionManager {
val drmCallback = LocalMediaDrmCallback("{\"keys\":[{\"kty\":\"oct\",\"k\":\"${value}\",\"kid\":\"${id}\"}],\"type\":\"temporary\"}".toByteArray())
val mediaDrm = FrameworkMediaDrm.newInstance(uuid)
return DefaultDrmSessionManager(uuid, mediaDrm, drmCallback, null, multiSession)
}
I know it can be done because I have seen something similar in several posts on this forum:
ExoPlayer Setting Uri Source Header
Hello, I'm trying to play a UriSource with exoplayer but I need to set up the http header for the link. I've found this java code (link) // (1) Create method returns 'DataSource.Factory' public DataSource.Factory headers() { Map headersMap = new HashMap()...
Error in new exoplayer
Hi, In the new version of exoplayer, I get the following error: java.lang.RuntimeException: Constructor not found. This error in b4a reference to this code: Sub CreateMergedSource(Sources() As Object) As Object Dim arr As JavaObject...
I've looked up and down the forum but can't find anything, and I've done 200 tests, but I can't get it to work.
It seems easy, but I can't do it.
I would be very grateful to anyone who can give me a hand.
Thank you