Java Code Examples for com.google.android.exoplayer2.Player#REPEAT_MODE_OFF

The following examples show how to use com.google.android.exoplayer2.Player#REPEAT_MODE_OFF . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CustomizeControlView.java    From bcm-android with GNU General Public License v3.0 6 votes vote down vote up
public void setRepeatToggleModes(@RepeatModeUtil.RepeatToggleModes int repeatToggleModes) {
    this.repeatToggleModes = repeatToggleModes;
    if (player != null) {
        @Player.RepeatMode int currentMode = player.getRepeatMode();
        if (repeatToggleModes == RepeatModeUtil.REPEAT_TOGGLE_MODE_NONE
                && currentMode != Player.REPEAT_MODE_OFF) {
            controlDispatcher.dispatchSetRepeatMode(player, Player.REPEAT_MODE_OFF);
        } else if (repeatToggleModes == RepeatModeUtil.REPEAT_TOGGLE_MODE_ONE
                && currentMode == Player.REPEAT_MODE_ALL) {
            controlDispatcher.dispatchSetRepeatMode(player, Player.REPEAT_MODE_ONE);
        } else if (repeatToggleModes == RepeatModeUtil.REPEAT_TOGGLE_MODE_ALL
                && currentMode == Player.REPEAT_MODE_ONE) {
            controlDispatcher.dispatchSetRepeatMode(player, Player.REPEAT_MODE_ALL);
        }
    }
}
 
Example 2
Source File: ExoVideoPlaybackControlView.java    From ExoVideoView with Apache License 2.0 6 votes vote down vote up
/**
 * Sets which repeat toggle modes are enabled.
 *
 * @param repeatToggleModes A set of {@link RepeatModeUtil.RepeatToggleModes}.
 */
public void setRepeatToggleModes(@RepeatModeUtil.RepeatToggleModes int repeatToggleModes) {
    this.repeatToggleModes = repeatToggleModes;
    if (player != null) {
        @Player.RepeatMode int currentMode = player.getRepeatMode();
        if (repeatToggleModes == RepeatModeUtil.REPEAT_TOGGLE_MODE_NONE
                && currentMode != Player.REPEAT_MODE_OFF) {
            controlDispatcher.dispatchSetRepeatMode(player, Player.REPEAT_MODE_OFF);
        } else if (repeatToggleModes == RepeatModeUtil.REPEAT_TOGGLE_MODE_ONE
                && currentMode == Player.REPEAT_MODE_ALL) {
            controlDispatcher.dispatchSetRepeatMode(player, Player.REPEAT_MODE_ONE);
        } else if (repeatToggleModes == RepeatModeUtil.REPEAT_TOGGLE_MODE_ALL
                && currentMode == Player.REPEAT_MODE_ONE) {
            controlDispatcher.dispatchSetRepeatMode(player, Player.REPEAT_MODE_ALL);
        }
    }
}
 
Example 3
Source File: RepeatModeUtil.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
/**
 * Verifies whether a given {@code repeatMode} is enabled in the bitmask {@code enabledModes}.
 *
 * @param repeatMode The mode to check.
 * @param enabledModes The bitmask representing the enabled modes.
 * @return {@code true} if enabled.
 */
public static boolean isRepeatModeEnabled(@Player.RepeatMode int repeatMode, int enabledModes) {
  switch (repeatMode) {
    case Player.REPEAT_MODE_OFF:
      return true;
    case Player.REPEAT_MODE_ONE:
      return (enabledModes & REPEAT_TOGGLE_MODE_ONE) != 0;
    case Player.REPEAT_MODE_ALL:
      return (enabledModes & REPEAT_TOGGLE_MODE_ALL) != 0;
    default:
      return false;
  }
}
 
Example 4
Source File: EventLogger.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
private static String getRepeatModeString(@Player.RepeatMode int repeatMode) {
  switch (repeatMode) {
    case Player.REPEAT_MODE_OFF:
      return "OFF";
    case Player.REPEAT_MODE_ONE:
      return "ONE";
    case Player.REPEAT_MODE_ALL:
      return "ALL";
    default:
      return "?";
  }
}
 
Example 5
Source File: CustomizeControlView.java    From bcm-android with GNU General Public License v3.0 5 votes vote down vote up
private void updateRepeatModeButton() {
    if (!isVisible() || !isAttachedToWindow || repeatToggleButton == null) {
        return;
    }
    if (repeatToggleModes == RepeatModeUtil.REPEAT_TOGGLE_MODE_NONE) {
        repeatToggleButton.setVisibility(View.GONE);
        return;
    }
    if (player == null) {
        setButtonEnabled(false, repeatToggleButton);
        return;
    }
    setButtonEnabled(true, repeatToggleButton);
    switch (player.getRepeatMode()) {
        case Player.REPEAT_MODE_OFF:
            repeatToggleButton.setImageDrawable(repeatOffButtonDrawable);
            repeatToggleButton.setContentDescription(repeatOffButtonContentDescription);
            break;
        case Player.REPEAT_MODE_ONE:
            repeatToggleButton.setImageDrawable(repeatOneButtonDrawable);
            repeatToggleButton.setContentDescription(repeatOneButtonContentDescription);
            break;
        case Player.REPEAT_MODE_ALL:
            repeatToggleButton.setImageDrawable(repeatAllButtonDrawable);
            repeatToggleButton.setContentDescription(repeatAllButtonContentDescription);
            break;
        default:
            // Never happens.
    }
    repeatToggleButton.setVisibility(View.VISIBLE);
}
 
Example 6
Source File: RepeatModeUtil.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Verifies whether a given {@code repeatMode} is enabled in the bitmask {@code enabledModes}.
 *
 * @param repeatMode The mode to check.
 * @param enabledModes The bitmask representing the enabled modes.
 * @return {@code true} if enabled.
 */
public static boolean isRepeatModeEnabled(@Player.RepeatMode int repeatMode, int enabledModes) {
  switch (repeatMode) {
    case Player.REPEAT_MODE_OFF:
      return true;
    case Player.REPEAT_MODE_ONE:
      return (enabledModes & REPEAT_TOGGLE_MODE_ONE) != 0;
    case Player.REPEAT_MODE_ALL:
      return (enabledModes & REPEAT_TOGGLE_MODE_ALL) != 0;
    default:
      return false;
  }
}
 
Example 7
Source File: EventLogger.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
private static String getRepeatModeString(@Player.RepeatMode int repeatMode) {
  switch (repeatMode) {
    case Player.REPEAT_MODE_OFF:
      return "OFF";
    case Player.REPEAT_MODE_ONE:
      return "ONE";
    case Player.REPEAT_MODE_ALL:
      return "ALL";
    default:
      return "?";
  }
}
 
Example 8
Source File: RepeatModeUtil.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Verifies whether a given {@code repeatMode} is enabled in the bitmask {@code enabledModes}.
 *
 * @param repeatMode The mode to check.
 * @param enabledModes The bitmask representing the enabled modes.
 * @return {@code true} if enabled.
 */
public static boolean isRepeatModeEnabled(@Player.RepeatMode int repeatMode, int enabledModes) {
  switch (repeatMode) {
    case Player.REPEAT_MODE_OFF:
      return true;
    case Player.REPEAT_MODE_ONE:
      return (enabledModes & REPEAT_TOGGLE_MODE_ONE) != 0;
    case Player.REPEAT_MODE_ALL:
      return (enabledModes & REPEAT_TOGGLE_MODE_ALL) != 0;
    default:
      return false;
  }
}
 
Example 9
Source File: EventLogger.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
private static String getRepeatModeString(@Player.RepeatMode int repeatMode) {
  switch (repeatMode) {
    case Player.REPEAT_MODE_OFF:
      return "OFF";
    case Player.REPEAT_MODE_ONE:
      return "ONE";
    case Player.REPEAT_MODE_ALL:
      return "ALL";
    default:
      return "?";
  }
}
 
Example 10
Source File: ExoVideoPlaybackControlView.java    From ExoVideoView with Apache License 2.0 5 votes vote down vote up
private void updateRepeatModeButton() {
    if (!isVisible() || !isAttachedToWindow || repeatToggleButton == null) {
        return;
    }
    if (repeatToggleModes == RepeatModeUtil.REPEAT_TOGGLE_MODE_NONE) {
        repeatToggleButton.setVisibility(View.GONE);
        return;
    }
    if (player == null) {
        setButtonEnabled(false, repeatToggleButton);
        return;
    }
    setButtonEnabled(true, repeatToggleButton);
    switch (player.getRepeatMode()) {
        case Player.REPEAT_MODE_OFF:
            repeatToggleButton.setImageDrawable(repeatOffButtonDrawable);
            repeatToggleButton.setContentDescription(repeatOffButtonContentDescription);
            break;
        case Player.REPEAT_MODE_ONE:
            repeatToggleButton.setImageDrawable(repeatOneButtonDrawable);
            repeatToggleButton.setContentDescription(repeatOneButtonContentDescription);
            break;
        case Player.REPEAT_MODE_ALL:
            repeatToggleButton.setImageDrawable(repeatAllButtonDrawable);
            repeatToggleButton.setContentDescription(repeatAllButtonContentDescription);
            break;
    }
    repeatToggleButton.setVisibility(View.VISIBLE);
}
 
Example 11
Source File: EventLogger.java    From GSYVideoPlayer with Apache License 2.0 5 votes vote down vote up
private static String getRepeatModeString(@Player.RepeatMode int repeatMode) {
    switch (repeatMode) {
        case Player.REPEAT_MODE_OFF:
            return "OFF";
        case Player.REPEAT_MODE_ONE:
            return "ONE";
        case Player.REPEAT_MODE_ALL:
            return "ALL";
        default:
            return "?";
    }
}
 
Example 12
Source File: QueuedExoPlayer.java    From Jockey with Apache License 2.0 5 votes vote down vote up
private int getExoPlayerRepeatMode() {
    if (mRepeatAll) {
        return Player.REPEAT_MODE_ALL;
    } else if (mRepeatOne) {
        return Player.REPEAT_MODE_ONE;
    } else {
        return Player.REPEAT_MODE_OFF;
    }
}
 
Example 13
Source File: RepeatModeUtil.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Verifies whether a given {@code repeatMode} is enabled in the bitmask {@code enabledModes}.
 *
 * @param repeatMode The mode to check.
 * @param enabledModes The bitmask representing the enabled modes.
 * @return {@code true} if enabled.
 */
public static boolean isRepeatModeEnabled(@Player.RepeatMode int repeatMode, int enabledModes) {
  switch (repeatMode) {
    case Player.REPEAT_MODE_OFF:
      return true;
    case Player.REPEAT_MODE_ONE:
      return (enabledModes & REPEAT_TOGGLE_MODE_ONE) != 0;
    case Player.REPEAT_MODE_ALL:
      return (enabledModes & REPEAT_TOGGLE_MODE_ALL) != 0;
    default:
      return false;
  }
}
 
Example 14
Source File: EventLogger.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
private static String getRepeatModeString(@Player.RepeatMode int repeatMode) {
  switch (repeatMode) {
    case Player.REPEAT_MODE_OFF:
      return "OFF";
    case Player.REPEAT_MODE_ONE:
      return "ONE";
    case Player.REPEAT_MODE_ALL:
      return "ALL";
    default:
      return "?";
  }
}
 
Example 15
Source File: RepeatModeUtil.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Verifies whether a given {@code repeatMode} is enabled in the bitmask {@code enabledModes}.
 *
 * @param repeatMode The mode to check.
 * @param enabledModes The bitmask representing the enabled modes.
 * @return {@code true} if enabled.
 */
public static boolean isRepeatModeEnabled(@Player.RepeatMode int repeatMode, int enabledModes) {
  switch (repeatMode) {
    case Player.REPEAT_MODE_OFF:
      return true;
    case Player.REPEAT_MODE_ONE:
      return (enabledModes & REPEAT_TOGGLE_MODE_ONE) != 0;
    case Player.REPEAT_MODE_ALL:
      return (enabledModes & REPEAT_TOGGLE_MODE_ALL) != 0;
    default:
      return false;
  }
}
 
Example 16
Source File: EventLogger.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
private static String getRepeatModeString(@Player.RepeatMode int repeatMode) {
  switch (repeatMode) {
    case Player.REPEAT_MODE_OFF:
      return "OFF";
    case Player.REPEAT_MODE_ONE:
      return "ONE";
    case Player.REPEAT_MODE_ALL:
      return "ALL";
    default:
      return "?";
  }
}