OSMPlayer is an ExoPlayer2 wrapper that simplifies streaming videos with subtitles.
-
Add it in your root build.gradle at the end of repositories:
allprojects { repositories { jcenter() maven { url "https://jitpack.io" } } }
-
Step 2. Add the dependency
implementation 'com.github.OscarMyoMin:OSMPlayer:1.0'
-
Use the library
osmPlayer = OSMPlayer() OSMPlayer.SHOW_LOGO = true osmPlayer!!.setLogo(R.drawable.ic_logo) OSMPlayer.SRTSTYLE_DEFAULT = false osmPlayer!!.srtStyle( Color.WHITE, Color.TRANSPARENT, Color.TRANSPARENT, Color.RED, 10 ) osmPlayer!!.play(context, videoTitle, videoURL, subtitleURL);