Skip to content

Instantly share code, notes, and snippets.

@rvi
Created March 13, 2018 16:45
Show Gist options
  • Save rvi/f8260989db156c1204699dfa479301d7 to your computer and use it in GitHub Desktop.
Save rvi/f8260989db156c1204699dfa479301d7 to your computer and use it in GitHub Desktop.
class StreamActivity : AppCompatActivity(), VlcListener {
private var vlcVideoLibrary: VlcVideoLibrary? = null
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_stream)
val surfaceView = findViewById<SurfaceView>(R.id.surfaceView)
vlcVideoLibrary = VlcVideoLibrary(this, this, surfaceView)
vlcVideoLibrary?.play(url)
}
override fun onComplete() {
Toast.makeText(this, "Playing", Toast.LENGTH_SHORT).show()
}
override fun onError() {
Toast.makeText(this, "Error, make sure your endpoint is correct", Toast.LENGTH_SHORT).show()
vlcVideoLibrary?.stop()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment