android - Mutiple YouTubePlayerViews within one Actvity -


I have an activity that can create many YouTubePlayerViews programs, here square is containing each YouTubePlayerView.

  public class expands MyYouTubeView LinearLayout implements YouTubePlayer. Initial Listener {Private string mYouTubeVideoId; Private YouTubePlayerView mYouTubePlayerView; Public Journal YouTubeView (activity reference, string youTubeVideoId) {super (reference); MYouTubeVideoId = youTubeVideoId; String APIYE = reference.greaterSource (). GetString (R. string.Ut_EPI_key); MYouTubePlayerView = New YouTubePlayerView (reference); MYouTubePlayerView.setTag (mYouTubeVideoId); MYouTubePlayerViewInitialize (APKI, it); LinearLayout.LayoutParams parameter = new LinearLayout.LayoutParams (LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT); Int margin = (int) ScreenUtils.dip2pixel (10, reference); Params.leftMargin = Margin; Params.rightMargin = margin; Addview (mYouTubePlayerView, parameter); } @Override public void onInitializationFailure (provider arg0, YouTubeInitializationResult ARG1) {} @Override public void onInitializationSuccess (YouTubePlayer.Provider provider, last YouTubePlayer player, Boolean wasRestored) {if {player.cueVideo (mYouTubeVideoId) (wasRestored!); }}}   

Unfortunately this does not seem to work on having many instances of YouTubePlayerView in my scene hierarchy. In Sample API apps, they use fragments while dealing with multiple videos, but I can not use those people without some major re-engineering of the app. Any help much appreciated

It looks like (although not mentioned in the docs) that you can only have one host per Activity video player solution is to use ThumbNailViews which will launch a YouTubePlayerView.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

jsp - Google line chart x-axis shrinks on transition -

java - Reaching JTextField in a DocumentListener -