Skip to content

1.7.2

Choose a tag to compare

@DaniKemper010 DaniKemper010 released this 20 Oct 00:39
· 29 commits to master since this release

Added

  • Chapters, like YouTube. NativeVideoPlayerChapter (start + title,
    optional thumbnail), set with controller.setChapters(...) or
    load(chapters: ...). NativeVideoPlayerChapters.parseText reads the
    "0:00 Intro" list from a video description, parseVtt / fromVttUrl a
    WebVTT chapters track. The controller reports currentChapter and
    currentChapterStream, and seekToNextChapter() / seekToPreviousChapter()
    skip between them. Chapters are ignored for live streams; loading another
    URL clears them.
  • NativeVideoPlayerProgressBar, a seek bar for custom overlays: buffered
    range, chapter segments with small gaps, the touched segment grows, drags
    snap to a chapter start within snapDistance (8 px) with a haptic tick,
    and an animated scrub preview with the storyboard frame, chapter title and
    time. Everything is styleable (NativeVideoPlayerProgressBarStyle,
    NativeVideoPlayerScrubPreviewStyle, or a previewBuilder), showPreview
    turns the bubble off, and position / duration / onSeek overrides let
    it run without a controller (casting, audio). Storyboard images take
    storyboardHeaders or a custom image provider, are precached around the
    playing position (storyboardPrecacheLimit), and a failed load just leaves
    the frame out. NativeVideoPlayerScrubPreview is the bubble on its own;
    NativeVideoPlayerChapters.segments / snapTarget the math for a bar of
    your own.
  • Chapter events: PlayerControlState.chapterChanged (with index, title,
    startMs) and chaptersChanged reach control listeners, next to
    currentChapterStream / chaptersStream and currentChapterIndex. They
    don't restart the overlay's hide timer. The progress bar adds
    onScrubChapterChanged, onSnap and onPreviewChanged (which also fires
    with showPreview: false, to draw the preview elsewhere).
  • controller.holdOverlay() keeps the custom overlay visible until the
    returned callback runs, without touching lockOverlay().
    NativeVideoPlayerProgressBar holds it while the viewer scrubs, so the
    controls never hide mid-drag.
  • Scrub previews fit the player: the bubble is bounded by the room above
    the bar (up to the top of the NativeVideoPlayer) and the bar's width,
    scaled down when it doesn't fit, and left out when there is no room;
    previewMaxHeight caps it. Frames keep their real aspect ratio
    (thumbnailMaxHeight bounds portrait ones), failed images are retried on
    a later scrub, and the bar's default height fits the bar (24 px).
  • Bunny storyboards without an aspectRatio measure the frame height from
    each loaded sheet (StoryboardThumbnail.regionIn, gridCell; sheets are
    padded to the full 6 × 6 grid), so portrait videos show the right frame.
  • The progress bar keeps the storyboard sheets around the position loaded
    (at most storyboardPrecacheLimit), so a busy image cache can't drop them
    before the first scrub; while a sheet loads the bubble shows the time only.
  • StoryboardThumbnails.bunnyFromPlaylistUrl(playlistUrl, duration:), which
    keeps a signed URL's token, and headers: on StoryboardThumbnails.fromUrl.