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


Java SimpleExoPlayer.getPlaybackState方法代码示例

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


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

示例1: seekOrSkip

import com.google.android.exoplayer2.SimpleExoPlayer; //导入方法依赖的package包/类
private void seekOrSkip() {
    if (fsmPlayer == null) {
        return;
    }

    if (fsmPlayer instanceof FsmPlayer) {

        if (((FsmPlayer) fsmPlayer).getController() != null) {
            SimpleExoPlayer adPlayer = ((FsmPlayer) fsmPlayer).getController().getAdPlayer();

            if (adPlayer != null && adPlayer.getPlaybackState() == ExoPlayer.STATE_BUFFERING) {

                long position = adPlayer.getCurrentPosition() + 1000 < adPlayer.getDuration() ? adPlayer.getCurrentPosition() + 1000 : adPlayer.getDuration();
                adPlayer.seekTo(position);
                adPlayer.setPlayWhenReady(true);
                return;
            }
        }
    }
}
 
开发者ID:Tubitv,项目名称:TubiPlayer,代码行数:21,代码来源:AdPlayingMonitor.java

示例2: updateMovieResumePosition

import com.google.android.exoplayer2.SimpleExoPlayer; //导入方法依赖的package包/类
/**
 * update the resume position of the main movice
 *
 * @param controller
 */
public static void updateMovieResumePosition(PlayerUIController controller) {

    if (controller == null) {
        return;
    }

    SimpleExoPlayer moviePlayer = controller.getContentPlayer();

    if (moviePlayer != null && moviePlayer.getPlaybackState() != ExoPlayer.STATE_IDLE) {
        int resumeWindow = moviePlayer.getCurrentWindowIndex();
        long resumePosition = moviePlayer.isCurrentWindowSeekable() ? Math.max(0, moviePlayer.getCurrentPosition())
                : C.TIME_UNSET;
        controller.setMovieResumeInfo(resumeWindow, resumePosition);
    }
}
 
开发者ID:Tubitv,项目名称:TubiPlayer,代码行数:21,代码来源:FsmPlayer.java

示例3: performWorkAndupdatePlayerUI

import com.google.android.exoplayer2.SimpleExoPlayer; //导入方法依赖的package包/类
@Override
public void performWorkAndupdatePlayerUI(@Nullable FsmPlayer fsmPlayer, @NonNull PlayerUIController controller, @NonNull PlayerComponentController componentController, @NonNull MediaModel movieMedia, @Nullable AdMediaModel adMedia) {
    // doesn't need to do any UI work.

    if (isNull(fsmPlayer, controller, componentController, movieMedia, adMedia)) {
        return;
    }

    SimpleExoPlayer moviePlayer = controller.getContentPlayer();

    // this mean, user jump out of the activity lifecycle in ReceivedAdState.
    if (moviePlayer!=null && moviePlayer.getPlaybackState() == ExoPlayer.STATE_IDLE) {
        fsmPlayer.transit(Input.ERROR);
    }

}
 
开发者ID:Tubitv,项目名称:TubiPlayer,代码行数:17,代码来源:ReceiveAdState.java

示例4: doActionAndScheduleNextImpl

import com.google.android.exoplayer2.SimpleExoPlayer; //导入方法依赖的package包/类
@Override
protected void doActionAndScheduleNextImpl(final SimpleExoPlayer player,
    final MappingTrackSelector trackSelector, final Surface surface, final Handler handler,
    final ActionNode nextAction) {
  if (nextAction == null) {
    return;
  }
  if (targetPlaybackState == player.getPlaybackState()) {
    nextAction.schedule(player, trackSelector, surface, handler);
  } else {
    player.addListener(new Player.DefaultEventListener() {
      @Override
      public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
        if (targetPlaybackState == playbackState) {
          player.removeListener(this);
          nextAction.schedule(player, trackSelector, surface, handler);
        }
      }
    });
  }
}
 
开发者ID:y20k,项目名称:transistor,代码行数:22,代码来源:Action.java

示例5: stopAdandPlayerMovie

import com.google.android.exoplayer2.SimpleExoPlayer; //导入方法依赖的package包/类
private void stopAdandPlayerMovie(PlayerUIController controller, PlayerComponentController componentController, MediaModel movieMedia) {

        SimpleExoPlayer adPlayer = controller.getAdPlayer();
        SimpleExoPlayer moviePlayer = controller.getContentPlayer();

        //first remove the AdPlayer's listener and pause the player
        adPlayer.removeListener(componentController.getAdPlayingMonitor());
        adPlayer.setPlayWhenReady(false);

        //then update the playerView with SimpleExoPlayer and Movie MediaModel
        TubiExoPlayerView tubiExoPlayerView = (TubiExoPlayerView) controller.getExoPlayerView();
        tubiExoPlayerView.setPlayer(moviePlayer, componentController.getTubiPlaybackInterface());
        tubiExoPlayerView.setMediaModel(movieMedia, false);

        //prepare the moviePlayer with data source and set it play

        boolean haveResumePosition = controller.getMovieResumePosition() != C.TIME_UNSET;
        if (moviePlayer.getPlaybackState() == ExoPlayer.STATE_IDLE) {
            moviePlayer.prepare(movieMedia.getMediaSource(), !haveResumePosition, false);
        }

        updatePlayerPosition(moviePlayer, controller);

        moviePlayer.setPlayWhenReady(true);

        hideVpaidNShowPlayer(controller);
    }
 
开发者ID:Tubitv,项目名称:TubiPlayer,代码行数:28,代码来源:MoviePlayingState.java

示例6: pausePlayer

import com.google.android.exoplayer2.SimpleExoPlayer; //导入方法依赖的package包/类
private static void pausePlayer(SimpleExoPlayer internalPlayer){
    internalPlayer.setPlayWhenReady(false);
    internalPlayer.getPlaybackState();
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:5,代码来源:ExoGifPlayer.java

示例7: startPlayer

import com.google.android.exoplayer2.SimpleExoPlayer; //导入方法依赖的package包/类
private static void startPlayer(SimpleExoPlayer internalPlayer){
    internalPlayer.setPlayWhenReady(true);
    internalPlayer.getPlaybackState();
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:5,代码来源:ExoGifPlayer.java

示例8: pausePlayer

import com.google.android.exoplayer2.SimpleExoPlayer; //导入方法依赖的package包/类
public static void pausePlayer(SimpleExoPlayer player) {
    player.setPlayWhenReady(false);
    player.getPlaybackState();
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:5,代码来源:ExoUtil.java

示例9: startPlayer

import com.google.android.exoplayer2.SimpleExoPlayer; //导入方法依赖的package包/类
public static void startPlayer(SimpleExoPlayer player) {
    player.setPlayWhenReady(true);
    player.getPlaybackState();
}
 
开发者ID:PhoenixDevTeam,项目名称:Phoenix-for-VK,代码行数:5,代码来源:ExoUtil.java


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