Search in sources :

Example 11 with Playable

use of de.danoeh.antennapod.core.util.playback.Playable in project AntennaPod by AntennaPod.

the class TimelineTest method testProcessShownotesAddTimecodeHHMMNoChapters.

public void testProcessShownotesAddTimecodeHHMMNoChapters() throws Exception {
    final String timeStr = "10:11";
    final long time = 3600 * 1000 * 10 + 60 * 1000 * 11;
    Playable p = newTestPlayable(null, "<p> Some test text with a timecode " + timeStr + " here.</p>");
    Timeline t = new Timeline(context, p);
    String res = t.processShownotes(true);
    checkLinkCorrect(res, new long[] { time }, new String[] { timeStr });
}
Also used : Timeline(de.danoeh.antennapod.core.util.playback.Timeline) Playable(de.danoeh.antennapod.core.util.playback.Playable)

Example 12 with Playable

use of de.danoeh.antennapod.core.util.playback.Playable in project AntennaPod by AntennaPod.

the class TimelineTest method testProcessShownotesAddTimecodeAngleBrackets.

public void testProcessShownotesAddTimecodeAngleBrackets() throws Exception {
    final String timeStr = "10:11";
    final long time = 3600 * 1000 * 10 + 60 * 1000 * 11;
    Playable p = newTestPlayable(null, "<p> Some test text with a timecode <" + timeStr + "> here.</p>");
    Timeline t = new Timeline(context, p);
    String res = t.processShownotes(true);
    checkLinkCorrect(res, new long[] { time }, new String[] { timeStr });
}
Also used : Timeline(de.danoeh.antennapod.core.util.playback.Timeline) Playable(de.danoeh.antennapod.core.util.playback.Playable)

Example 13 with Playable

use of de.danoeh.antennapod.core.util.playback.Playable in project AntennaPod by AntennaPod.

the class TimelineTest method testProcessShownotesAddTimecodeBrackets.

public void testProcessShownotesAddTimecodeBrackets() throws Exception {
    final String timeStr = "10:11";
    final long time = 3600 * 1000 * 10 + 60 * 1000 * 11;
    Playable p = newTestPlayable(null, "<p> Some test text with a timecode [" + timeStr + "] here.</p>");
    Timeline t = new Timeline(context, p);
    String res = t.processShownotes(true);
    checkLinkCorrect(res, new long[] { time }, new String[] { timeStr });
}
Also used : Timeline(de.danoeh.antennapod.core.util.playback.Timeline) Playable(de.danoeh.antennapod.core.util.playback.Playable)

Example 14 with Playable

use of de.danoeh.antennapod.core.util.playback.Playable in project AntennaPod by AntennaPod.

the class TimelineTest method testProcessShownotesAddTimecodeParentheses.

public void testProcessShownotesAddTimecodeParentheses() throws Exception {
    final String timeStr = "10:11";
    final long time = 3600 * 1000 * 10 + 60 * 1000 * 11;
    Playable p = newTestPlayable(null, "<p> Some test text with a timecode (" + timeStr + ") here.</p>");
    Timeline t = new Timeline(context, p);
    String res = t.processShownotes(true);
    checkLinkCorrect(res, new long[] { time }, new String[] { timeStr });
}
Also used : Timeline(de.danoeh.antennapod.core.util.playback.Timeline) Playable(de.danoeh.antennapod.core.util.playback.Playable)

Example 15 with Playable

use of de.danoeh.antennapod.core.util.playback.Playable in project AntennaPod by AntennaPod.

the class ExternalPlayerFragment method loadMediaInfo.

private boolean loadMediaInfo() {
    Log.d(TAG, "Loading media info");
    if (controller != null && controller.serviceAvailable()) {
        Playable media = controller.getMedia();
        if (media != null) {
            txtvTitle.setText(media.getEpisodeTitle());
            mFeedName.setText(media.getFeedTitle());
            mProgressBar.setProgress((int) ((double) controller.getPosition() / controller.getDuration() * 100));
            Glide.with(getActivity()).load(media.getImageLocation()).placeholder(R.color.light_gray).error(R.color.light_gray).diskCacheStrategy(ApGlideSettings.AP_DISK_CACHE_STRATEGY).fitCenter().dontAnimate().into(imgvCover);
            fragmentLayout.setVisibility(View.VISIBLE);
            if (controller.isPlayingVideoLocally()) {
                butPlay.setVisibility(View.GONE);
            } else {
                butPlay.setVisibility(View.VISIBLE);
            }
            return true;
        } else {
            Log.w(TAG, "loadMediaInfo was called while the media object of playbackService was null!");
            return false;
        }
    } else {
        Log.w(TAG, "loadMediaInfo was called while playbackService was null!");
        return false;
    }
}
Also used : Playable(de.danoeh.antennapod.core.util.playback.Playable)

Aggregations

Playable (de.danoeh.antennapod.core.util.playback.Playable)40 Context (android.content.Context)15 CountDownLatch (java.util.concurrent.CountDownLatch)15 LocalPSMP (de.danoeh.antennapod.core.service.playback.LocalPSMP)11 PlaybackServiceMediaPlayer (de.danoeh.antennapod.core.service.playback.PlaybackServiceMediaPlayer)11 AssertionFailedError (junit.framework.AssertionFailedError)11 FeedMedia (de.danoeh.antennapod.core.feed.FeedMedia)8 FeedItem (de.danoeh.antennapod.core.feed.FeedItem)7 Intent (android.content.Intent)4 PlaybackServiceTaskManager (de.danoeh.antennapod.core.service.playback.PlaybackServiceTaskManager)4 Timeline (de.danoeh.antennapod.core.util.playback.Timeline)4 SharedPreferences (android.content.SharedPreferences)3 TypedArray (android.content.res.TypedArray)3 IconDrawable (com.joanzapata.iconify.IconDrawable)3 TargetApi (android.annotation.TargetApi)2 Color (android.graphics.Color)2 PixelFormat (android.graphics.PixelFormat)2 Uri (android.net.Uri)2 Build (android.os.Build)2 Bundle (android.os.Bundle)2