SHOW:
|
|
- or go back to the newest paste.
| 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" ); |
| 5 | + | intent.setDataAndType(videoUri, "video/mp4"); |
| 6 | - | intent.setPackage( "de.stefanpledl.localcast" ); |
| 6 | + | intent.setPackage("de.stefanpledl.localcast");
|
| 7 | - | intent.putExtra("title", "YOUR TITLE HERE");
|
| 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 | } |