當前位置: 首頁>>代碼示例>>Java>>正文


Java ExoPlayer.STATE_ENDED屬性代碼示例

本文整理匯總了Java中com.google.android.exoplayer.ExoPlayer.STATE_ENDED屬性的典型用法代碼示例。如果您正苦於以下問題:Java ExoPlayer.STATE_ENDED屬性的具體用法?Java ExoPlayer.STATE_ENDED怎麽用?Java ExoPlayer.STATE_ENDED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.google.android.exoplayer.ExoPlayer的用法示例。


在下文中一共展示了ExoPlayer.STATE_ENDED屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getStateString

private String getStateString(int state) {
  switch (state) {
    case ExoPlayer.STATE_BUFFERING:
      return "B";
    case ExoPlayer.STATE_ENDED:
      return "E";
    case ExoPlayer.STATE_IDLE:
      return "I";
    case ExoPlayer.STATE_PREPARING:
      return "P";
    case ExoPlayer.STATE_READY:
      return "R";
    default:
      return "?";
  }
}
 
開發者ID:Dreamxiaoxuan,項目名稱:AndroidTvDemo,代碼行數:16,代碼來源:EventLogger.java

示例2: isPlaying

@Override
public boolean isPlaying() {
    if (mInternalPlayer == null)
        return false;
    int state = mInternalPlayer.getPlaybackState();
    switch (state) {
        case ExoPlayer.STATE_BUFFERING:
        case ExoPlayer.STATE_READY:
            return mInternalPlayer.getPlayWhenReady();
        case ExoPlayer.STATE_IDLE:
        case ExoPlayer.STATE_PREPARING:
        case ExoPlayer.STATE_ENDED:
            default:
            return false;
    }
}
 
開發者ID:Dreamxiaoxuan,項目名稱:AndroidTvDemo,代碼行數:16,代碼來源:IjkExoMediaPlayer.java

示例3: isPlaying

@Override
public boolean isPlaying() {
    if (mInternalPlayer == null)
        return false;
    int state = mInternalPlayer.getPlaybackState();
    switch (state) {
        case ExoPlayer.STATE_BUFFERING:
        case ExoPlayer.STATE_READY:
            return mInternalPlayer.getPlayWhenReady();
        case ExoPlayer.STATE_IDLE:
        case ExoPlayer.STATE_PREPARING:
        case ExoPlayer.STATE_ENDED:
        default:
            return false;
    }
}
 
開發者ID:bigjelly,項目名稱:ShaddockVideoPlayer,代碼行數:16,代碼來源:IjkExoMediaPlayer.java

示例4: run

@Override public void run() {
  switch (player.getPlaybackState()) {
    case ExoPlayer.STATE_BUFFERING:
      mlistener.onBuffering(playerControl.getBufferPercentage() + "");
      break;
    case ExoPlayer.STATE_ENDED:
      mlistener.onCompletion();
      break;
    case ExoPlayer.STATE_IDLE:
      break;
    case ExoPlayer.STATE_PREPARING:
      mlistener.onBufferingStarted();
      break;
    case ExoPlayer.STATE_READY:
      mlistener.onBufferingFinished();

      break;
    default:
      break;
  }
  mlistener.onProgressChanged((int) player.getCurrentPosition());
  mainHandler.postDelayed(updatePlayer, 200);
}
 
開發者ID:karanvs,項目名稱:ExVidPlayer,代碼行數:23,代碼來源:ExVidPlayerImp.java

示例5: getCurrentPosition

@MainThread
public long getCurrentPosition() {
    // TODO: More precise time may be necessary.
    MpegTsPlayer mpegTsPlayer = mPlayer;
    long currentTime = mpegTsPlayer != null
            ? mRecordStartTimeMs + mpegTsPlayer.getCurrentPosition() : mRecordStartTimeMs;
    if (mChannel == null && mPlayerState == ExoPlayer.STATE_ENDED) {
        currentTime = mRecordingDuration + mRecordStartTimeMs;
    }
    if (DEBUG) {
        long systemCurrentTime = System.currentTimeMillis();
        Log.d(TAG, "currentTime = " + currentTime
                + " ; System.currentTimeMillis() = " + systemCurrentTime
                + " ; diff = " + (currentTime - systemCurrentTime));
    }
    return currentTime;
}
 
開發者ID:trevd,項目名稱:android_packages_apps_tv,代碼行數:17,代碼來源:TunerSessionWorker.java

示例6: executeListeners

private void executeListeners() {
    long duration = player.getDuration() / 1000;
    long position = player.getCurrentPosition() / 1000;
    List<Pair<Long, OnTimeReached>> executed = new ArrayList<>();
    if (duration > 0 && (state == ExoPlayer.STATE_READY || state == ExoPlayer.STATE_ENDED)) {
        long remain = duration - position;
        for (Pair<Long, OnTimeReached> listener : listeners) {
            long condition = listener.first;
            if (remain <= condition) {
                Log.d(TAG, "Executing listener, duration=" + duration + ", position=" + position + ", remaining=" + remain);
                listener.second.onPositionRemainingReached(duration, position);
                executed.add(listener);
            }
        }
    }
    listeners.removeAll(executed);
}
 
開發者ID:nextux,項目名稱:sbs-android-tv,代碼行數:17,代碼來源:DurationLogger.java

示例7: onPlayerStateChanged

@Override
public void onPlayerStateChanged(boolean playWhenReady, int state) {
  switch (player.getPlaybackState()) {
    case ExoPlayer.STATE_BUFFERING:
      playerState = "buffering";
      break;
    case ExoPlayer.STATE_ENDED:
      playerState = "ended";
      break;
    case ExoPlayer.STATE_IDLE:
      playerState = "idle";
      break;
    case ExoPlayer.STATE_PREPARING:
      playerState = "preparing";
      break;
    case ExoPlayer.STATE_READY:
      playerState = "ready";
      break;
  }
  updateDebugInfoTextView();
}
 
開發者ID:asifkhan11,項目名稱:ExoPlayer-Demo,代碼行數:21,代碼來源:PlayerActivity.java

示例8: getStateString

private static String getStateString(int state) {
  switch (state) {
    case ExoPlayer.STATE_BUFFERING:
      return "B";
    case ExoPlayer.STATE_ENDED:
      return "E";
    case ExoPlayer.STATE_IDLE:
      return "I";
    case ExoPlayer.STATE_PREPARING:
      return "P";
    case ExoPlayer.STATE_READY:
      return "R";
    default:
      return "?";
  }
}
 
開發者ID:asifkhan11,項目名稱:ExoPlayer-Demo,代碼行數:16,代碼來源:LogcatLogger.java

示例9: getStateString

private String getStateString(int state) {
    switch (state) {
        case ExoPlayer.STATE_BUFFERING:
            return "B";
        case ExoPlayer.STATE_ENDED:
            return "E";
        case ExoPlayer.STATE_IDLE:
            return "I";
        case ExoPlayer.STATE_PREPARING:
            return "P";
        case ExoPlayer.STATE_READY:
            return "R";
        default:
            return "?";
    }
}
 
開發者ID:cklar,項目名稱:ExoPlayerWrapper,代碼行數:16,代碼來源:EventLogger.java

示例10: onStateChanged

@Override
public void onStateChanged(boolean playWhenReady, int playbackState) {
    state = playbackState;
    String text = "playWhenReady=" + playWhenReady + ", playbackState=";
    switch (playbackState) {
        case ExoPlayer.STATE_BUFFERING:
            text += "buffering";
            break;
        case ExoPlayer.STATE_ENDED:
            text += "ended";
            break;
        case ExoPlayer.STATE_IDLE:
            text += "idle";
            break;
        case ExoPlayer.STATE_PREPARING:
            text += "preparing";
            break;
        case ExoPlayer.STATE_READY:
            text += "ready";
            break;
        default:
            text += "unknown";
            break;
    }
    Log.d(TAG, text);
}
 
開發者ID:xwz,項目名稱:iview-android-tv,代碼行數:26,代碼來源:DurationLogger.java

示例11: onPlayerStateChanged

@Override
public void onPlayerStateChanged(boolean playWhenReady, int state) {
  String playerState = "";
  switch (player.getPlaybackState()) {
    case ExoPlayer.STATE_BUFFERING:
      playerState = "buffering";
      break;
    case ExoPlayer.STATE_ENDED:
      playerState = "ended";
      break;
    case ExoPlayer.STATE_IDLE:
      playerState = "idle";
      break;
    case ExoPlayer.STATE_PREPARING:
      playerState = "preparing";
      break;
    case ExoPlayer.STATE_READY:
      playerState = "ready";
      break;
  }
  playerStateView.setText("Player State: " + playerState);
}
 
開發者ID:raphanda,項目名稱:ExoPlayer,代碼行數:22,代碼來源:VideoPlayer.java

示例12: onStateChanged

@Override
public void onStateChanged(boolean playWhenReady, int playbackState) {
    switch (playbackState) {
        case ExoPlayer.STATE_BUFFERING:
            // Do nothing.
            break;
        case ExoPlayer.STATE_ENDED:
            mIsMetadataSet = false;
            mMediaController.getTransportControls().skipToNext();
            break;
        case ExoPlayer.STATE_IDLE:
            // Do nothing.
            break;
        case ExoPlayer.STATE_PREPARING:
            mIsMetadataSet = false;
            break;
        case ExoPlayer.STATE_READY:
            // Duration is set here.
            if (!mIsMetadataSet) {
                updateMetadata(mSelectedVideo);
                mIsMetadataSet = true;
            }
            break;
        default:
            // Do nothing.
            break;
    }
}
 
開發者ID:nejtv,項目名稱:androidtv-sample,代碼行數:28,代碼來源:PlaybackOverlayFragment.java

示例13: onPlayerStateChanged

@Override
public void onPlayerStateChanged(boolean playWhenReady, int state) {
    maybeReportPlayerState();

    if (state == ExoPlayer.STATE_ENDED && looping) {
        player.seekTo(0);
    }
}
 
開發者ID:MimiReader,項目名稱:mimi-reader,代碼行數:8,代碼來源:ExoPlayerHelper.java

示例14: restart

/**
 * Seeks to the beginning of the media, and plays it. This method will not succeed if playback state is not {@code ExoPlayer.STATE_IDLE} or {@code ExoPlayer.STATE_ENDED}.
 *
 * @return {@code true} if the media was successfully restarted, otherwise {@code false}
 */
public boolean restart() {
      int playbackState = getPlaybackState();
      if(playbackState != ExoPlayer.STATE_IDLE && playbackState != ExoPlayer.STATE_ENDED) {
          return false;
      }

      seekTo(0);
      setPlayWhenReady(true);

      forcePrepare();
      prepare();

      return true;
  }
 
開發者ID:ayaseruri,項目名稱:luxunPro,代碼行數:19,代碼來源:EMExoPlayer.java

示例15: onStateChanged

@Override
    public void onStateChanged(boolean playWhenReady, int playbackState) {
        if (playbackState == ExoPlayer.STATE_ENDED) {
            mediaController.show(Integer.MAX_VALUE);
        }
//        String text = "playWhenReady=" + playWhenReady + ", playbackState=";
        switch(playbackState) {
            case ExoPlayer.STATE_BUFFERING:
//                text += "buffering";
                break;
            case ExoPlayer.STATE_ENDED:
//                text += "ended";
                break;
            case ExoPlayer.STATE_IDLE:
//                text += "idle";
                break;
            case ExoPlayer.STATE_PREPARING:
//                text += "preparing";
                break;
            case ExoPlayer.STATE_READY:
//                text += "ready";
                mHandler.sendEmptyMessage(MSG_HIDE_THUMBNAIL);
//                new Handler().postDelayed(new Runnable() {
//                    @Override
//                    public void run() {
//                        TransitionManager.beginDelayedTransition(videoFrame, new Fade());
//                        shutterView.setVisibility(View.GONE);
//                        progressBar.setVisibility(View.GONE);
//                        mediaController.show();
//                    }
//                }, 300);
//                break;
            default:
//                text += "unknown";
                break;
        }
//        playerStateTextView.setText(text);
//        updateButtonVisibilities();
    }
 
開發者ID:PJakcson,項目名稱:Mediathek,代碼行數:39,代碼來源:PlayerFragment.java


注:本文中的com.google.android.exoplayer.ExoPlayer.STATE_ENDED屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。