Guest User

LocalCast

a guest
Mar 17th, 2017
912,463
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.     }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×