diff --git a/library/core/src/main/java/com/google/android/exoplayer2/Renderer.java b/library/core/src/main/java/com/google/android/exoplayer2/Renderer.java index af07ce4525..494d672045 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/Renderer.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/Renderer.java @@ -208,7 +208,7 @@ public interface Renderer extends PlayerMessage.Target { /** * The type of a message that can be passed to a video renderer to set the desired output * resolution. The message payload should be a {@link Size} of the desired output width and - * height. Use this method only when playing with video {@link Effect}. + * height. Use this method only when playing with video {@linkplain Effect effects}. */ int MSG_SET_VIDEO_OUTPUT_RESOLUTION = 13; /** diff --git a/library/effect/src/main/java/com/google/android/exoplayer2/effect/DrawableOverlay.java b/library/effect/src/main/java/com/google/android/exoplayer2/effect/DrawableOverlay.java index 9ca29f3cb1..4ad7f05898 100644 --- a/library/effect/src/main/java/com/google/android/exoplayer2/effect/DrawableOverlay.java +++ b/library/effect/src/main/java/com/google/android/exoplayer2/effect/DrawableOverlay.java @@ -35,7 +35,7 @@ public abstract class DrawableOverlay extends BitmapOverlay { /** * Returns the overlay {@link Drawable} displayed at the specified timestamp. * - *

The drawable must have it's bounds set via {@link Drawable#setBounds} for drawable to be + *

The drawable must have its bounds set via {@link Drawable#setBounds} for drawable to be * displayed on the frame. * * @param presentationTimeUs The presentation timestamp of the current frame, in microseconds. diff --git a/library/effect/src/main/java/com/google/android/exoplayer2/effect/TextOverlay.java b/library/effect/src/main/java/com/google/android/exoplayer2/effect/TextOverlay.java index 2e7da9c578..cfe4d4168a 100644 --- a/library/effect/src/main/java/com/google/android/exoplayer2/effect/TextOverlay.java +++ b/library/effect/src/main/java/com/google/android/exoplayer2/effect/TextOverlay.java @@ -32,9 +32,46 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; /** * Creates a {@link TextureOverlay} from text. * - *

Uses a {@link SpannableString} store the text and support advanced per-character text styling. + *

Uses a {@link SpannableString} to store the text and support advanced per-character text + * styling. */ public abstract class TextOverlay extends BitmapOverlay { + + /** + * Creates a {@link TextOverlay} that shows the {@code overlayText} with the same default settings + * in {@link OverlaySettings} throughout the whole video. + */ + public static TextOverlay createStaticTextOverlay(SpannableString overlayText) { + return new TextOverlay() { + @Override + public SpannableString getText(long presentationTimeUs) { + return overlayText; + } + }; + } + + /** + * Creates a {@link TextOverlay} that shows the {@code overlayText} with the same {@link + * OverlaySettings} throughout the whole video. + * + * @param overlaySettings The {@link OverlaySettings} configuring how the overlay is displayed on + * the frames. + */ + public static TextOverlay createStaticTextOverlay( + SpannableString overlayText, OverlaySettings overlaySettings) { + return new TextOverlay() { + @Override + public SpannableString getText(long presentationTimeUs) { + return overlayText; + } + + @Override + public OverlaySettings getOverlaySettings(long presentationTimeUs) { + return overlaySettings; + } + }; + } + public static final int TEXT_SIZE_PIXELS = 100; private @MonotonicNonNull Bitmap lastBitmap; @@ -79,41 +116,6 @@ public abstract class TextOverlay extends BitmapOverlay { return checkNotNull(lastBitmap); } - /** - * Creates a {@link TextOverlay} that shows the {@code overlayText} with the same default settings - * in {@link OverlaySettings} throughout the whole video. - */ - public static TextOverlay createStaticTextOverlay(SpannableString overlayText) { - return new TextOverlay() { - @Override - public SpannableString getText(long presentationTimeUs) { - return overlayText; - } - }; - } - - /** - * Creates a {@link TextOverlay} that shows the {@code overlayText} with the same {@link - * OverlaySettings} throughout the whole video. - * - * @param overlaySettings The {@link OverlaySettings} configuring how the overlay is displayed on - * the frames. - */ - public static TextOverlay createStaticTextOverlay( - SpannableString overlayText, OverlaySettings overlaySettings) { - return new TextOverlay() { - @Override - public SpannableString getText(long presentationTimeUs) { - return overlayText; - } - - @Override - public OverlaySettings getOverlaySettings(long presentationTimeUs) { - return overlaySettings; - } - }; - } - @RequiresApi(23) private static final class Api23 { @DoNotInline