protected void performAddToQueue() { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); boolean extplayer = prefs.getBoolean("external_player", false); boolean extplayerVideoQueue = prefs.getBoolean("external_player_continuous_playback", false); if (extplayer && !extplayerVideoQueue) { Toast.makeText( context, R.string.external_player_video_queue_support_has_not_been_enabled_, Toast.LENGTH_LONG) .show(); return; } SerenityApplication.getVideoPlaybackQueue().add(info); }
/** @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 startDownload(String destination) { List<PendingDownload> pendingDownloads = SerenityApplication.getPendingDownloads(); PendingDownload pendingDownload = new PendingDownload(); String filename = info.getTitle() + "." + info.getContainer(); pendingDownload.setFilename(filename); pendingDownload.setUrl(info.getDirectPlayUrl()); pendingDownloads.add(pendingDownload); int pos = pendingDownloads.size() - 1; try { DSInterface downloadService = MainActivity.getDsInterface(); downloadService.addFileDownloadlist(info.getDirectPlayUrl(), destination, filename, pos); Toast.makeText( context, context.getString(R.string.starting_download_of_) + info.getTitle(), Toast.LENGTH_LONG) .show(); } catch (Exception ex) { Log.e("Unable to download " + info.getTitle() + "." + info.getContainer()); } }