gpt4 book ai didi

com.google.android.youtube.player.YouTubePlayerView.initialize()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 23:12:03 26 4
gpt4 key购买 nike

本文整理了Java中com.google.android.youtube.player.YouTubePlayerView.initialize()方法的一些代码示例,展示了YouTubePlayerView.initialize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YouTubePlayerView.initialize()方法的具体详情如下:
包路径:com.google.android.youtube.player.YouTubePlayerView
类名称:YouTubePlayerView
方法名:initialize

YouTubePlayerView.initialize介绍

暂无

代码示例

代码示例来源:origin: anitaa1990/TrailersApp

private void initialiseView() {
  binding = DataBindingUtil.setContentView(this, R.layout.activity_video);
  binding.youtubeView.initialize(AppConstants.YOUTUBE_API_KEY, this);
  videoKey = getIntent().getStringExtra(INTENT_VIDEO_KEY);
}

代码示例来源:origin: UdacityAndroidBasicsScholarship/wmn-safety

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_player);
  youtube_video_id = getIntent().getExtras().getString("videoID");
  youTubePlayerView = findViewById(R.id.youtube_player_view);
  youTubePlayerView.initialize(YOUTUBE_API_KEY, this);
}

代码示例来源:origin: narenkukreja/Munch-For-Reddit

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  SwipeBack.attach(this, Position.LEFT)
      .setContentView(R.layout.activity_youtube)
      .setSwipeBackView(R.layout.swipeback_custom);
  Bundle bundle = getIntent().getExtras();
  youtubeUrl = bundle.getString("youtube_link");
  browserYoutubeUrl = bundle.getString("youtube_link");
  if (youtubeUrl.contains("youtube")) {
    normalYoutubeUrl = youtubeUrl.substring(youtubeUrl.lastIndexOf("=") + 1);
  } else {
    normalYoutubeUrl = youtubeUrl.substring(youtubeUrl.lastIndexOf("/") + 1);
  }
  YouTubePlayerView youTubePlayerView = (YouTubePlayerView) findViewById(R.id.youtube_player);
  youTubePlayerView.initialize(API_KEY, this);
}

代码示例来源:origin: msahakyan/nested-recycler-view

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  requestWindowFeature(Window.FEATURE_NO_TITLE);
  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
    WindowManager.LayoutParams.FLAG_FULLSCREEN);
  setContentView(R.layout.activity_trailer);
  ButterKnife.bind(this);
  initTrailerIdFromIntent();
  // Initializing video player with developer key
  youTubeView.initialize(Config.DEVELOPER_KEY, this);
}

代码示例来源:origin: flipkart-incubator/android-inline-youtube-view

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setFullscreen();
  setContentView(R.layout.youtube_player_view);
  YouTubePlayerView youTubePlayerView = findViewById(R.id.youtube_player);
  String videoId = getVideoId();
  String apiKey = getApiKey();
  /*
   * In case videoId or apiKey is null, throw IllegalStateException as apiKey and videoId is mandatory to run
   * youtube activity.
   */
  $Precondition$Check.checkArgument(!TextUtils.isEmpty(videoId), " videoId cannot be null");
  $Precondition$Check.checkArgument(!TextUtils.isEmpty(apiKey), " apiKey cannot be null");
  /*
   * In case of YouTube Service not available, fallback to WebView implementation.
   */
  if (ServiceUtil.isYouTubeServiceAvailable(this)) {
    youTubePlayerView.initialize(apiKey, this);
  } else {
    String webViewUrl = getWebUrl();
    if (!TextUtils.isEmpty(webViewUrl)) {
      youTubePlayerView.setVisibility(GONE);
      handleWebViewPlayer(videoId, webViewUrl);
    } else {
      Log.d(TAG, "Web Url is Null");
      finish();
    }
  }
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com