Intégrer Beedown !
String videoURL = "https://media.w3.org/2010/05/sintel/trailer.mp4";
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.parse(videoURL), "video/*"); // Lien de la vidéo
intent.setPackage("com.beedown.id");
try {{
startActivity(intent);
} catch (ActivityNotFoundException ex) {
// Open Play Store if it fails to launch the app because the package doesn't exist.
// Alternatively you could use PackageManager.getLaunchIntentForPackage() and check for null.
// You could try catch this and launch the Play Store website if it fails but this shouldn’t
// fail unless the Play Store is missing.
Intent intent = new Intent(Intent.ACTION_VIEW);
String uriString = "market://details?id=com.beedown.id" ;
intent.setData(Uri.parse(uriString));
startActivity(intent);
}
Vous voulez un contrôle supplémentaire ? Beedown accepte les titres, les en-têtes (header), etc.
intent.putExtra("title", "le titre de la vidéo");
intent.putExtra("poster", "http://posterurl");
Headers :
Bundle headers = new Bundle();
headers.putString("Referer", "http://somereferrer");
headers.putString("Cookie", "some cookie");
headers.putString("User-Agent", "user agent string");
intent.putExtra("android.media.intent.extra.HTTP_HEADERS",headers);