Android Question Exoplayer url video with header authentication?

Erel

B4X founder
Staff member
Licensed User
Longtime User
Try this:
B4X:
Dim source As JavaObject = player.CreateUriSource("https//www....")
Dim r As Reflector
r.Target = source
r.Target = r.GetField("dataSourceFactory")
Dim jo As JavaObject = r.GetField("baseDataSourceFactory")
Dim requestProperties As JavaObject = jo.RunMethod("getDefaultRequestProperties", Null)
requestProperties.RunMethod("set", Array("Authorization", "value"))
player.Prepare(source)
 
Upvote 0

tuhatinhvn

Active Member
Licensed User
Longtime User
Thank you for your code, can we set header (exam user-agent) for exoplayer too?
 
Upvote 0

Shalu Samtani

Member
Licensed User
Longtime User
Thank You
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…