当前位置: 首页>>代码示例>>Java>>正文


Java SimpleExoPlayerView.setControllerVisibilityListener方法代码示例

本文整理汇总了Java中com.google.android.exoplayer2.ui.SimpleExoPlayerView.setControllerVisibilityListener方法的典型用法代码示例。如果您正苦于以下问题:Java SimpleExoPlayerView.setControllerVisibilityListener方法的具体用法?Java SimpleExoPlayerView.setControllerVisibilityListener怎么用?Java SimpleExoPlayerView.setControllerVisibilityListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.android.exoplayer2.ui.SimpleExoPlayerView的用法示例。


在下文中一共展示了SimpleExoPlayerView.setControllerVisibilityListener方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import com.google.android.exoplayer2.ui.SimpleExoPlayerView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    shouldAutoPlay = true;
    clearResumePosition();
    mediaDataSourceFactory = buildDataSourceFactory(true);
    mainHandler = new Handler();
    if (CookieHandler.getDefault() != DEFAULT_COOKIE_MANAGER) {
        CookieHandler.setDefault(DEFAULT_COOKIE_MANAGER);
    }

    setContentView(R.layout.player_activity);
    View rootView = findViewById(R.id.root);
    rootView.setOnClickListener(this);
    debugRootView = (LinearLayout) findViewById(R.id.controls_root);
    debugTextView = (TextView) findViewById(R.id.debug_text_view);
    retryButton = (Button) findViewById(R.id.retry_button);
    retryButton.setOnClickListener(this);

    simpleExoPlayerView = (SimpleExoPlayerView) findViewById(R.id.player_view);
    simpleExoPlayerView.setControllerVisibilityListener(this);
    simpleExoPlayerView.requestFocus();
}
 
开发者ID:ashwanijanghu,项目名称:ExoPlayer-Offline,代码行数:24,代码来源:PlayerActivity.java

示例2: PlayerView

import com.google.android.exoplayer2.ui.SimpleExoPlayerView; //导入方法依赖的package包/类
public PlayerView(Context context, SimpleExoPlayer player) {
    super(context);
    simpleExoPlayerView = new SimpleExoPlayerView(context);
    progressBar = new ProgressBar(context);
    textView = new TextView(context);
    textView.setX(40);
    textView.setY(20);
    textView.setTextColor(Color.parseColor("#FFFFFF"));
    textView.setTextSize(16);
    textView.setText("By Herudi");
    RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(100,100);
    params.addRule(RelativeLayout.CENTER_IN_PARENT);
    simpleExoPlayerView.setLayoutParams(new SimpleExoPlayerView.LayoutParams(
            SimpleExoPlayerView.LayoutParams.MATCH_PARENT,
            SimpleExoPlayerView.LayoutParams.MATCH_PARENT
    ));
    setLayoutParams(new RelativeLayout.LayoutParams(
            RelativeLayout.LayoutParams.WRAP_CONTENT,
            RelativeLayout.LayoutParams.WRAP_CONTENT
    ));
    setBackgroundColor(ContextCompat.getColor(context, android.R.color.black));
    addView(simpleExoPlayerView);
    addView(textView);
    addView(progressBar,params);
    simpleExoPlayerView.setUseController(true);
    simpleExoPlayerView.requestFocus();
    simpleExoPlayerView.setPlayer(player);
    simpleExoPlayerView.setControllerVisibilityListener(new PlaybackControlView.VisibilityListener() {
        @Override
        public void onVisibilityChange(int visibility) {
            if (visibility==0){
                textView.setVisibility(VISIBLE);
            }else {
                textView.setVisibility(GONE);
            }
        }
    });
}
 
开发者ID:herudi,项目名称:react-native-exoplayer-intent-video,代码行数:39,代码来源:PlayerView.java

示例3: onCreate

import com.google.android.exoplayer2.ui.SimpleExoPlayerView; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  shouldAutoPlay = true;
  mediaDataSourceFactory = buildDataSourceFactory(true);
  mainHandler = new Handler();
  window = new Timeline.Window();
  if (CookieHandler.getDefault() != DEFAULT_COOKIE_MANAGER) {
    CookieHandler.setDefault(DEFAULT_COOKIE_MANAGER);
  }

  setContentView(R.layout.player_activity);
  View rootView = findViewById(R.id.root);
  rootView.setOnClickListener(this);
  debugRootView = (LinearLayout) findViewById(R.id.controls_root);
  debugTextView = (TextView) findViewById(R.id.debug_text_view);
  retryButton = (Button) findViewById(R.id.retry_button);
  retryButton.setOnClickListener(this);

  simpleExoPlayerView = (SimpleExoPlayerView) findViewById(R.id.player_view);
  simpleExoPlayerView.setControllerVisibilityListener(this);
  simpleExoPlayerView.requestFocus();

  String title = getIntent().getStringExtra(PLAYER_TITLE);
  setTitle(title);
  tracker.setScreenName("播放器: " + title);
  tracker.send(new HitBuilders.ScreenViewBuilder().build());
}
 
开发者ID:TakumaMochizuki,项目名称:Komica,代码行数:29,代码来源:PlayerActivity.java


注:本文中的com.google.android.exoplayer2.ui.SimpleExoPlayerView.setControllerVisibilityListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。