Created
March 13, 2018 16:45
-
-
Save rvi/f8260989db156c1204699dfa479301d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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