Package limn.video

Interface Poster

All Known Implementing Classes:
Poster.At, Poster.FirstPicture, Poster.None, Poster.Still

public sealed interface Poster permits Poster.FirstPicture, Poster.At, Poster.Still, Poster.None
What a video shows before it has played: its first picture, the picture at a time, a picture of the application's, or nothing but the bar colour. A poster is a cover, not a starting point: playback begins at the start of the stream whichever one is shown.

 view.setPoster(Poster.at(Duration.ofSeconds(3)));   // a frame that says what the clip is
 view.setPoster(Poster.image(Images.fromResource("/clips/onboarding.png")));
 

Made by the four factories and no other way, so each value has one spelling; the kinds are there to be told apart (poster instanceof Poster.At at) and read, not built.

By time rather than by a picture's number: a stream is moved to an instant, and keeps no index of its pictures, so a number would cost decoding every picture before it, and on a stream whose rate varies the same number would land at different instants. At a constant rate, picture n is at n divided by the rate.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final class 
    The picture at a time, made by at(java.time.Duration).
    static final class 
    The stream's first picture.
    static final class 
    Nothing but the bar colour.
    static final class 
    A picture of the application's, made by image(limn.graphics.Image).
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static Poster
    at(Duration time)
    The picture at time, reached by an exact seek: the first at or after it.
    static Poster
    The stream's first picture: the default.
    static Poster
    image(Image image)
    A picture of the application's, fitted to the box as the video's own pictures are.
    static Poster
    Nothing: the bar colour until playback shows a picture.
  • Method Details

    • firstPicture

      static Poster firstPicture()
      The stream's first picture: the default.
    • at

      static Poster at(Duration time)
      The picture at time, reached by an exact seek: the first at or after it. A stream that cannot seek shows its first picture instead, and a time past the end shows nothing.
      Parameters:
      time - where the picture is on the stream's own timeline; not negative
      Returns:
      the poster
      Throws:
      IllegalArgumentException - if time is negative
    • image

      static Poster image(Image image)
      A picture of the application's, fitted to the box as the video's own pictures are. The stream is not read until playback starts.
      Parameters:
      image - the picture, which stays the caller's
      Returns:
      the poster
    • none

      static Poster none()
      Nothing: the bar colour until playback shows a picture. The stream is not read before.