use of de.danoeh.antennapod.core.util.playback.PlaybackServiceStarter in project AntennaPod by AntennaPod.
the class PlayActionButton method onClick.
@Override
public void onClick(Context context) {
FeedMedia media = item.getMedia();
if (media == null) {
return;
}
if (!media.fileExists()) {
DBTasks.notifyMissingFeedMediaFile(context, media);
return;
}
new PlaybackServiceStarter(context, media).callEvenIfRunning(true).startWhenPrepared(true).shouldStream(false).start();
if (media.getMediaType() == MediaType.VIDEO) {
context.startActivity(PlaybackService.getPlayerActivityIntent(context, media));
}
}
use of de.danoeh.antennapod.core.util.playback.PlaybackServiceStarter in project AntennaPod by AntennaPod.
the class StreamActionButton method onClick.
@Override
public void onClick(Context context) {
final FeedMedia media = item.getMedia();
if (media == null) {
return;
}
UsageStatistics.logAction(UsageStatistics.ACTION_STREAM);
if (!NetworkUtils.isStreamingAllowed()) {
new StreamingConfirmationDialog(context, media).show();
return;
}
new PlaybackServiceStarter(context, media).callEvenIfRunning(true).startWhenPrepared(true).shouldStream(true).start();
if (media.getMediaType() == MediaType.VIDEO) {
context.startActivity(PlaybackService.getPlayerActivityIntent(context, media));
}
}
Aggregations