本文整理汇总了Java中com.google.android.youtube.player.YouTubePlayerSupportFragment类的典型用法代码示例。如果您正苦于以下问题:Java YouTubePlayerSupportFragment类的具体用法?Java YouTubePlayerSupportFragment怎么用?Java YouTubePlayerSupportFragment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
YouTubePlayerSupportFragment类属于com.google.android.youtube.player包,在下文中一共展示了YouTubePlayerSupportFragment类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import com.google.android.youtube.player.YouTubePlayerSupportFragment; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState){
View rootView2;
//getActivity().setTitle("Movie Show");
rootView2=inflater.inflate(R.layout.tab_fragment_2, container, false);
TextView title2 = (TextView) rootView2.findViewById(R.id.title2);
title2.setVisibility(View.VISIBLE);
title2.setText(R.string.tab2Text);
mVideoId2 = getString(R.string.tab2VideoID);
Log.d("mVideoId2 is ", mVideoId2);
playerFragment2 = (YouTubePlayerSupportFragment) getChildFragmentManager().findFragmentById(R.id.moviePlayer2);
playerFragment2.setUserVisibleHint(true);
return rootView2;
}
示例2: onCreateView
import com.google.android.youtube.player.YouTubePlayerSupportFragment; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState){
View rootView1;
//getActivity().setTitle("Movie Show");
rootView1=inflater.inflate(R.layout.tab_fragment_1, container, false);
TextView title1 = (TextView) rootView1.findViewById(R.id.title1);
title1.setVisibility(View.VISIBLE);
title1.setText(R.string.tab1Text);
mVideoId1 = getString(R.string.tab1VideoID);
Log.d("mVideoId1 is ", mVideoId1);
playerFragment1 = (YouTubePlayerSupportFragment) getChildFragmentManager().findFragmentById(R.id.moviePlayer1);
playerFragment1.setUserVisibleHint(true);
//playerFragment1.initialize(getString(R.string.google_maps_key), this);
return rootView1;
}
示例3: onCreateView
import com.google.android.youtube.player.YouTubePlayerSupportFragment; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState){
View rootView3;
//getActivity().setTitle("Movie Show");
rootView3=inflater.inflate(R.layout.tab_fragment_3, container, false);
TextView title3 = (TextView) rootView3.findViewById(R.id.title3);
title3.setVisibility(View.VISIBLE);
title3.setText(R.string.tab3Text);
mVideoId3 = getString(R.string.tab3VideoID);
Log.d("mVideoId3 is ", mVideoId3);
playerFragment3 = (YouTubePlayerSupportFragment) getChildFragmentManager().findFragmentById(R.id.moviePlayer3);
playerFragment3.setUserVisibleHint(true);
return rootView3;
}
示例4: YoutubeTrailerAdapter
import com.google.android.youtube.player.YouTubePlayerSupportFragment; //导入依赖的package包/类
public YoutubeTrailerAdapter(FragmentManager fm, List<MovieTrailer> movieTrailers1, String movieName) {
super(fm);
movieTrailers = new ArrayList<>();
for(MovieTrailer trailer:movieTrailers1){
if(trailer.site.equals("YouTube")){
movieTrailers.add(trailer);
}else {
Log.v("NonYoutubeTrailer", trailer.site+trailer.key);
}
}
trailerPlayerFragments = new YouTubePlayerSupportFragment[movieTrailers.size()];
fragmentManagers = new FragmentManager[movieTrailers.size()];
currentlyPlayingTrailer = -1;
numOfTrailers = movieTrailers.size();
this.movieName = movieName;
this.childFragmentManager = fm;
}
示例5: setupView
import com.google.android.youtube.player.YouTubePlayerSupportFragment; //导入依赖的package包/类
private void setupView() {
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
FloatingActionButton facebook = (FloatingActionButton) findViewById(R.id.facebook);
facebook.setOnClickListener(onFacebookClickListener);
FloatingActionButton twitter = (FloatingActionButton) findViewById(R.id.twitter);
twitter.setOnClickListener(onTwitterClickListener);
YoutubePlayer youtubePlayer = new YoutubePlayer(this);
youtubeFragment = (YouTubePlayerSupportFragment) getSupportFragmentManager()
.findFragmentById(R.id.youtube_fragment);
if(youtubeFragment != null) {
youtubeFragment.initialize(youtubePlayer.getYoutubeKey(), onYoutubeInitializeListener);
}
}
示例6: onCreateView
import com.google.android.youtube.player.YouTubePlayerSupportFragment; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
this.sharedPref = PreferenceManager.getDefaultSharedPreferences(getContext());
this.context = getContext();
sharedPreference = ListPreferences.getInstance(this.context);
if (sharedPreference.isNightModeActive(context)) {
nightMode = true;
} else {
nightMode = false;
}
View view = inflater.inflate(R.layout.detail_launch_summary, container, false);
ButterKnife.bind(this, view);
youTubePlayerFragment = YouTubePlayerSupportFragment.newInstance();
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
transaction.add(R.id.youtube_view, youTubePlayerFragment).commit();
return view;
}
示例7: onCreate
import com.google.android.youtube.player.YouTubePlayerSupportFragment; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_youtube);
mPlayerFragment =
(YouTubePlayerSupportFragment) getSupportFragmentManager().findFragmentById(R.id.youtube_fragment);
mPlayerFragment.initialize(getString(R.string.android_simple_api_access_key), this);
setRequestedOrientation(PORTRAIT_ORIENTATION);
}
示例8: onCreate
import com.google.android.youtube.player.YouTubePlayerSupportFragment; //导入依赖的package包/类
protected void onCreate(Bundle paramBundle)
{
super.onCreate(paramBundle);
setContentView(2130903085);
aj.a(this, findViewById(16908290), "coda.ttf");
if (paramBundle != null)
this.d = paramBundle.getString("video_url");
Intent localIntent;
for (this.c = paramBundle.getString("title"); ; this.c = localIntent.getStringExtra("title"))
{
((TextView)findViewById(2131230747)).setText(this.c);
this.b = ((YouTubePlayerSupportFragment)getSupportFragmentManager().a(2131230869));
this.b.a("AIzaSyB0PCixY_NOhjG0M-6YWaNz5mL8IUIVD0M", this);
setResult(0, b());
return;
localIntent = getIntent();
this.d = localIntent.getStringExtra("video_url");
}
}
示例9: fillData
import com.google.android.youtube.player.YouTubePlayerSupportFragment; //导入依赖的package包/类
public void fillData(String url) {
this.mUrlYoutubeVideo = url;
YouTubePlayerSupportFragment youTubePlayerFragment = YouTubePlayerSupportFragment.newInstance();
FragmentTransaction transaction = getBaseActivity().getSupportFragmentManager().beginTransaction();
transaction.add(R.id.youtube_layout, youTubePlayerFragment).commit();
youTubePlayerFragment.initialize(getBaseActivity().getResources().getString(R.string.developer_key_youtube), this);
}
示例10: getYouTubePlayerProvider
import com.google.android.youtube.player.YouTubePlayerSupportFragment; //导入依赖的package包/类
@Override
protected YouTubePlayer.Provider getYouTubePlayerProvider() {
return new YouTubePlayerSupportFragment();
}
示例11: setYouTubePlayerFragment
import com.google.android.youtube.player.YouTubePlayerSupportFragment; //导入依赖的package包/类
public void setYouTubePlayerFragment(YouTubePlayerSupportFragment youTubePlayerFragment) {
this.youTubePlayerFragment = youTubePlayerFragment;
}