Skip to the content

Showreel player

A video player mounted by one attribute on a thumbnail: a link to an mp4 around its picture, or a block that holds a video element.

Become a member to unlock the full effect today.

Join now

Already a member? Sign in

Documentation

  1. Copy to Webflow

    Add Geist and Geist Mono to your site's fonts (Site settings, Fonts, Google Fonts) before pasting: Webflow removes any font your site has not installed.

  2. Add custom CSS

    The look of the preview is the showreel-player-* classes of the paste. The code is longer than one Webflow Embed holds, so the paste brings two: this stylesheet and the settings are the first, the script of the next step the second. The first Embed holds the look of the word and of the player, and reads five variables, --showreel-player-ground, --showreel-player-ink, --showreel-player-accent, --showreel-player-pad and --showreel-player-word-size: set them on the thumbnail, or on anything above it, in a rule of your own. The words take the typeface of the thumbnail.
  3. Add custom JS

  4. Use it on your own elements

    Custom attributes
    Select the element on the canvas and open the Settings panel. Under Custom attributes, add a pair: the name on the left, the value on the right.
    Custom attributeWhat it does
    data-showreel-player Marks the thumbnail: a link to a video file around its picture, or a block that holds a video. It takes no value: leave the value field empty. The engine lays the film over the picture, adds the word, and builds the player at the first click. The settings below go on the same element.
    data-showreel-player-src On the thumbnail, with the address of the film as its value, when the thumbnail is neither a link to the file nor the holder of a video element. [ Optional ]
    data-showreel-player-title On the thumbnail, with a few words as its value: the name shown at the head of the player. Without it the name is the alt of the picture. [ Optional ]
    data-showreel-player-ready Written by the engine on the thumbnail once it is mounted, with data-showreel-player-hover while a mouse is over it and data-showreel-player-away while its film is in the player; the player carries data-showreel-player-state (opening, open, dragging, closing), data-showreel-player-ui while its words are shown and data-showreel-player-idle once they have stepped back. Never written by hand; the stylesheet reads them, and so can a rule of yours. [ Optional ]
    Settings
    Every setting is a custom attribute too, added the same way and on the same element. An attribute always wins over the defaults written in the code.
    AttributeDefaultWhat it is
    data-showreel-player-duration 1.15 The time the film takes to go from its thumbnail to the full screen, in seconds. The way back takes the same.
    data-showreel-player-follow 0.14 How closely the word keeps up with the pointer over the thumbnail, the share of the gap it closes each frame.
    data-showreel-player-fit auto How the film fills the screen once open. Options: auto, the film fills the screen when that cuts no more than an eighth of it, and is shown whole otherwise; contain, always whole, on the ground; cover, always edge to edge, cut where it must be.
    data-showreel-player-preview on Whether the thumbnail plays the film, muted and in a loop, while it is on screen. Options: on; off, the thumbnail shows the waiting picture until the click, and the file is not loaded before.
    data-showreel-player-sound on Whether the film opens with its sound. Options: on, the sound rises as the film opens; off, the film opens muted and the button offers the sound.
    data-showreel-player-restart off Whether opening sends the film back to its first frame. Options: off, the film goes on from the frame the thumbnail was showing, with no cut; on, it starts again from the beginning.
    data-showreel-player-loop off Whether the open film plays again when it ends. Options: off, at its end the film goes back to its thumbnail by itself; on, it plays again until it is closed.
    data-showreel-player-play Play The word on the thumbnail, and of the button while the film is paused. Options: any short word, in the language of the page: Lire, Abspielen.
    data-showreel-player-pause Pause The word of the button while the film plays. Options: any short word: Pause.
    data-showreel-player-mute Mute The word of the button that cuts the sound. Options: any short word: Couper.
    data-showreel-player-unmute Unmute The word of the button that gives the sound back. Options: any short word: Son.
    data-showreel-player-close Close The word of the button that closes the player. Options: any short word: Fermer.

What it does

Showreel player is a site utility component for Webflow and vanilla JavaScript, with no library. Also called video lightbox, showreel video player or play cursor video.

A video player mounted by one attribute on a thumbnail: a link to an mp4 around its picture, or a block that holds a video element. The thumbnail plays muted, in a loop, only while it is on screen, and carries one word, Play, at rest in its corner. Under a mouse the word leaves the corner and trails the pointer with a little lag; on a touch screen it stays where it is and a tap opens. On a click the very same video element leaves the page for the player without a cut or a reload: it first widens across the page as a band, at the height of the thumbnail, then the band opens up and down to the full screen and the crop of the thumbnail opens to the whole film, while the sound rises with it when the film has one. The word travels with the film: it flies from the pointer to the foot of the screen, shrinks, turns from Play to Pause and lands as the button. The controls are words, Pause, Mute, the time and Close, over one thin line that shows the time and can be dragged; they step back after a moment without a move. Closing plays it all backwards from wherever it is, a drag up or down closes by hand, and the film ends by going home on its own. A native dialog: focus kept inside, Escape, Space, arrows, M, the page held still, the focus given back to the thumbnail. Any film ratio, any thumbnail crop, several players on a page. Reduced motion respected. No library. Pattern type video lightbox, showreel, video modal.

Updated

Questions

Paste the section, select the Link Block of the thumbnail and give its link the address of your mp4. The Image inside is the picture that waits for the film. The attribute data-showreel-player is already on the link, and the code arrives as two Embeds with the paste.

Anywhere that serves the file directly and answers byte ranges, which every real host does: a CDN, Cloudflare R2, S3, or the direct file link of a paid Vimeo plan. The link of the thumbnail points at that address. If the time line does nothing under your pointer, the host is not answering byte ranges, and the console says so.

No. The player moves the very same video element from the page to the top of the screen, so the film goes on from the frame the thumbnail was showing. Set data-showreel-player-restart to on to start it again from the beginning instead.

The word rests in a corner of the thumbnail. Under a mouse it leaves the corner and trails the pointer with a little lag, set by data-showreel-player-follow. On a touch screen there is no pointer to trail: the word stays in its corner and a tap opens the film.

The thumbnail plays muted, in a loop, and only while it is on screen, which browsers allow. The sound comes in with the click that opens the film, rising as it opens. A film with no sound track has no Mute button, and data-showreel-player-sound set to off opens any film muted.

Yes. It opens in a native dialog: Enter opens it from the thumbnail, the focus stays among Pause, Mute, the time line and Close, Space and K pause, M mutes, Left and Right move five seconds, Escape closes, and the focus returns to the thumbnail. Under reduced motion the thumbnail does not play by itself and the film opens at once.

Yes, any shape, and the thumbnail can be any crop of it. The film fills the screen when that cuts no more than an eighth of it and is shown whole on a dark ground otherwise; data-showreel-player-fit set to contain or cover forces one or the other.