Advertisement
Guest User

LocalCast

a guest
Mar 17th, 2017
967,458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public void openLocalcastPlayer(String url, String title){
  2.        
  3.         Intent intent = new Intent(Intent.ACTION_VIEW);
  4.         Uri videoUri = Uri.parse(url);
  5.         intent.setDataAndType(videoUri, "video/mp4");
  6.         intent.setPackage("de.stefanpledl.localcast");
  7.         intent.putExtra("title", title);
  8.  
  9.         /*
  10.         //Want to add subtitles?
  11.         //remove comment and
  12.         //change method signature to:
  13.         //public void openLocalcastPlayer(String url, String title, String sub)
  14.        
  15.         Parcelable[] parcels = {Uri.parse(sub)};
  16.         Parcelable[] parcelsSub = {Uri.parse(sub)};
  17.         String[] names = {"Português"};
  18.  
  19.         intent.putExtra("subs", parcels);
  20.         intent.putExtra("subs.enable", parcelsSub);
  21.         intent.putExtra("subs.name", names);
  22.         */
  23.  
  24.         startActivity(intent);
  25.         this.finish();
  26.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement