コード例 #1
0
ファイル: PlayerService.java プロジェクト: jsimpson66/Podax
  private void refreshPodcast() {
    if (_player == null) return;

    PlayerStatus status = PlayerStatus.getCurrentState(this);
    if (!status.hasActivePodcast()) {
      _player.stop();
      return;
    }

    if (status.getPodcastId() != _currentPodcastId) {
      _currentPodcastId = status.getPodcastId();
      if (!_player.prepare(status.getFilename(), status.getPosition())) {
        _player.stop();
        String toastMessage =
            getResources().getString(R.string.cannot_play_podcast, status.getTitle());
        Toast.makeText(this, toastMessage, Toast.LENGTH_LONG).show();
      } else {
        QueueManager.changeActivePodcast(this, status.getPodcastId());
        _lockscreenManager.setupLockscreenControls(this, status);
        showNotification();
      }
    } else {
      _player.seekTo(status.getPosition());
    }
  }
コード例 #2
0
ファイル: PlayerService.java プロジェクト: jsimpson66/Podax
 public static void play(Context context, long podcastId) {
   QueueManager.changeActivePodcast(context, podcastId);
   PlayerService.sendCommand(context, Constants.PLAYER_COMMAND_REFRESHPODCAST);
 }