Sub CreateNativePlayer As Object
Dim np As JavaObject
Dim ctxt As JavaObject
ctxt.InitializeContext
Dim renderer, trackSelecter As JavaObject
renderer.InitializeNewInstance("com.google.android.exoplayer2.DefaultRenderersFactory", Array(ctxt))
trackSelecter.InitializeNewInstance("com.google.android.exoplayer2.trackselection.DefaultTrackSelector", Array(ctxt))
Dim LoadControlBuilder As JavaObject
LoadControlBuilder.InitializeNewInstance("com.google.android.exoplayer2.DefaultLoadControl.Builder", Null)
Dim bufferForPlaybackMs = 2500, minBufferMs = 15000, maxBufferMs = 50000, bufferForPlaybackAfterRebufferMs = 5000 As Int
LoadControlBuilder.RunMethod("setBufferDurationsMs", Array(minBufferMs, maxBufferMs, bufferForPlaybackMs, bufferForPlaybackAfterRebufferMs))
np = np.InitializeStatic("com.google.android.exoplayer2.ExoPlayerFactory").RunMethod("newSimpleInstance", _
Array(ctxt, renderer,trackSelecter, LoadControlBuilder.RunMethod("createDefaultLoadControl", Null)))
Return np
End Sub