Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void openLocalcastPlayer(String url, String title){
- Intent intent = new Intent(Intent.ACTION_VIEW);
- Uri videoUri = Uri.parse(url);
- intent.setDataAndType( videoUri, "video/mp4" );
- intent.setPackage( "de.stefanpledl.localcast" );
- intent.putExtra("title", "YOUR TITLE HERE");
- /*
- //Want to add subtitles?
- //remove comment and
- //change method signature to:
- //public void openLocalcastPlayer(String url, String title, String sub)
- Parcelable[] parcels = {Uri.parse(sub)};
- Parcelable[] parcelsSub = {Uri.parse(sub)};
- String[] names = {"Português"};
- intent.putExtra("subs", parcels);
- intent.putExtra("subs.enable", parcelsSub);
- intent.putExtra("subs.name", names);
- */
- startActivity(intent);
- this.finish();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement