Package limn.video
Interface Poster
- All Known Implementing Classes:
Poster.At,Poster.FirstPicture,Poster.None,Poster.Still
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 ClassesModifier and TypeInterfaceDescriptionstatic final classThe picture at a time, made byat(java.time.Duration).static final classThe stream's first picture.static final classNothing but the bar colour.static final classA picture of the application's, made byimage(limn.graphics.Image). -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic PosterThe picture attime, reached by an exact seek: the first at or after it.static PosterThe stream's first picture: the default.static PosterA picture of the application's, fitted to the box as the video's own pictures are.static Posternone()Nothing: the bar colour until playback shows a picture.
-
Method Details
-
firstPicture
The stream's first picture: the default. -
at
The picture attime, 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- iftimeis negative
-
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
Nothing: the bar colour until playback shows a picture. The stream is not read before.
-