/** @return */ protected ArrayList<DialogMenuItem> addMenuOptions() { ArrayList<DialogMenuItem> options = new ArrayList<DialogMenuItem>(); options.add(createMenuItemToggleWatchStatus()); options.add(createMenuItemDownload()); options.add(createMenuItemAddToQueue()); if (info.hasTrailer() && YouTubeInitializationResult.SUCCESS.equals( YouTubeApiServiceUtil.isYouTubeApiServiceAvailable(context))) { options.add(createMenuItemPlayTrailer()); } if (!SerenityApplication.isGoogleTV(context) && hasSupportedCaster()) { options.add(createMenuItemFling()); } return options; }
protected void performPlayTrailer() { if (info.hasTrailer()) { if (YouTubeInitializationResult.SUCCESS.equals( YouTubeApiServiceUtil.isYouTubeApiServiceAvailable(context))) { // Intent intent = // YouTubeStandalonePlayer.createVideoIntent(context, // SerenityConstants.YOUTUBE_BROWSER_API_KEY, info.trailerId(), // 0, true, true); // context.startActivity(intent); Intent youTubei = new Intent( Intent.ACTION_VIEW, Uri.parse("http://www.youtube.com/watch?v=" + info.trailerId())); context.startActivity(youTubei); return; } Toast.makeText(context, "YouTube Player not installed", Toast.LENGTH_LONG).show(); } else { Toast.makeText(context, "No Trailers found for this video.", Toast.LENGTH_LONG).show(); } }