mova 0.5.2
mova: ^0.5.2 copied to clipboard
media_kit (libmpv/ffmpeg) based video player plugin with gestures, VOD/live control bar, quality switching with ABR and picture-in-picture.
0.5.2 #
- Android: the slimmed
libmpv.soinpackages/media_kit_libs_android_video_slim(all four ABIs) is now linked with 16 KB page alignment (-Wl,-z,max-page-size=16384), as Google Play requires for apps targeting Android 15+. The mpvc_link_argsoverride had dropped the flag, leaving 4 KB-aligned LOAD segments. The pub.dev archive does not includepackages/; this matters to apps that use the slim fork throughdependency_overrides.
0.5.1 #
- Docs: pubspec
homepageandrepositorynow point to the package directory on themainbranch.
0.5.0 #
-
Breaking: public API renamed across the board. Old names are removed with no
@Deprecatedaliases (lib/src/deprecated_names.dartis deleted, including the earlier*Controller/Swap*/Standby*class aliases; the member-level@Deprecatedaliases are deleted too, see the list below). Migration table:Old New MovaEngine/createMovaEngineMova/createMovaMovaEngineFactory/MovaViewEngineFactoryMovaFactory/MovaViewFactoryMovaCutoverEngine/MovaFeedEnginePoolMovaCutover/MovaFeedPoolMovaSttEngine/MovaSttSessionEngine/MovaNoopSttEngineIMovaStt/IMovaSttSession/MovaNoopSttMovaSkinIMovaUiKitMovaDefaultSkin/MovaMinimalSkin/MovaMiniSkin/MovaBilibiliSkin/MovaDouyinSkinMovaDefaultUiKit/MovaMinimalUiKit/MovaMiniUiKit/MovaBilibiliUiKit/MovaDouyinUiKitpackage:mova/skin.dartpackage:mova/ui_kit.dartMova*Config(MovaAbrConfig,MovaAdConfig,MovaAutoPauseConfig,MovaCtrlsConfig,MovaCutoverConfig,MovaDanmakuConfig,MovaGestureConfig,MovaKeepAliveConfig,MovaLiveConfig,MovaMiniConfig,MovaPlaylistConfig,MovaPreviewConfig,MovaRecoveryConfig,MovaReportConfig,MovaSttConfig)Mova*OptsMovaOrientationConfigMovaOrientOptsMovaBrightPort/MovaBrightRestoreIMovaBrightness/IMovaBrightnessRestoreMovaScreenBrightnessPort/MovaFallbackBrightnessPortMovaBrightness/MovaFallbackBrightnessMovaVolumePortIMovaVolumeMovaSystemVolumePort/MovaCallbackVolumePort/MovaFallbackVolumePortMovaSystemVolume/MovaCallbackVolume/MovaFallbackVolumeMovaPipPort/MovaPipObservableIMovaPip/IMovaPipObservableMovaChannelPipPort/MovaNoopPipPortMovaPip/MovaNoopPipMovaOrientationPortIMovaOrientMovaSystemChromeOrientationPort/MovaNoopOrientationPortMovaOrient/MovaNoopOrientMovaOrientation(enum)MovaOrientModeMovaOrientationChange/MovaOrientationButtonComponentMovaOrientChange/MovaOrientButtonComponentIMovaApi.setOrientation/MovaState.orientationsetOrient/orientpreferredOrientationsFor/resolveOrientationspreferredOrientsFor/resolveOrientsMovaCutover(capability interface)IMovaCutoverEvery other abstract interface MovaXxxIMovaXxx(e.g.MovaApi→IMovaApi,MovaKernel→IMovaKernel,MovaKeepAlive→IMovaKeepAlive,MovaThumbSource→IMovaThumbSource,MovaReporter→IMovaReporter)Parameters and members follow the same rules:
engine→mova(engineFactory→movaFactory,MovaFeedPool.engineCount→movaCount,MovaOpts.engineSectionsEqual→movaSectionsEqual),skin→uiKit,config→opts,orientation→orient(orientationConfig→orientOpts,allowedOrientations→allowedOrients), and*Portmembers drop the suffix (debugBrightnessPort→debugBrightness, etc.). On the STT side the recognizer is namedrecognizer:MovaSttOpts.engine→recognizer,hasEngine→hasRecognizer,MovaSttBlockReason.noEngine→noRecognizer. Additional migration items of this round (the former*Controllerclasses' parameters and fields, deleted member aliases, report and path names):MovaFeedPlayerController→MovaFeedPlayerCtrl;MovaFeedPlayer(controller:)→MovaFeedPlayer(ctrl:).MovaDouyinUiKit(controller:)and thecontroller:parameter of the feed components →feed:(the argument is aMovaFeed).MovaNextUpComponent.controller→playlist(the argument is aMovaPlaylist).MovaMiniWindow(ctl:)→mini:.- Deleted member aliases (they no longer exist in any form):
MovaOpts.standby/MovaOpts.swap(usekeepAlive/cutover),MovaState.standby(usekeepAlivePhase),MovaHiddenMode.standby(usekeepAlive),MovaMiniHost(ctl:)andMovaMiniHost.ctl,MovaAdOverlayComponent.controller(useads).MovaMiniHost(mini:)is nowrequired. - QoE session field
swapEnabled→cutoverEnabled. This changes the report payload, so any backend, dashboard or parser that readsswapEnabledmust be updated. The 2026-10-27 round kept this key unchanged; this version renames it. - Component path name
orientationButton→orientButton(thecomponentNameofMovaOrientButtonComponent).MovaPatchaddressing that uses the old path (for example'${MovaTopBarComponent.componentName}/orientationButton') no longer matches; useMovaOrientButtonComponent.componentName. - Internal file
src/core/cutover/ctl.dart→api.dart(only affects code that importspackage:mova/src/...directly).
-
The thumbnail cache directory prefix changes from
engine_tomova_.engine_*directories left by older versions are no longer recognized or cleaned up.
0.4.3 #
- Docs only: rewrote README wording in plain language; the HarmonyOS spike project under tool/ is no longer shipped in the package.
The full original Chinese changelog is kept in CHANGES.zh-CN.md.
0.4.2 #
Documentation and metadata only. No runtime behavior change.
pubspec.yamldescriptionrewritten in English (pub.dev requires an ASCII-friendly 60-180 character description).README.mdis now English. The previous Chinese README is kept asREADME.zh-CN.md; both link to each other at the top.CHANGELOG.mdis now English (0.4.x in full, older versions condensed, with all breaking/migration notes kept). The full Chinese text is kept asCHANGES.zh-CN.md.- Links to
doc/in the README are now absolute GitHub links (the published package excludesdoc/through.pubignore); the stalemini_window_demo.dartlink now points at an example file that exists. example/README.mdentry table rewritten against the real files underexample/lib.- Documentation revisions in
doc/SPEC.mdand the README. - Relaxed the
connectivity_plusconstraint so the latest major version (^7) can be resolved.
0.4.1 #
-
Full-review deferred P3 wrap-up (non-device part): the mini window and fullscreen/system PiP are now mutually exclusive in both directions (
setMini(true)is rejected while in PiP andMovaMini.showthen revokes the handoff; entering fullscreen collapses the mini window first). Format probing is now armed just before the real open (the END_FILE start-gate approach was shown by a real-device A/B run to make HE V9 background/foreground resume pass only 1 of 5 times, so it was reverted; B1 still waits for a native file identity). A failed keepAlive restore keeps the original value and retries next time. A mid-roll warm-up no longer swallows the end event when the content really plays to its end (end events produced as a by-product of a cutover are still swallowed). The watchdog deadline honors a source-levelnetwork-timeout.stallMsonly counts stalls accepted by the policy (jitter is given back to watch time). Sub-second preview buckets use millisecond cache keys. Residual WAV files are deleted after audio extraction fails or is cancelled. The test baseline is whatever the currentflutter testrun reports. -
Full-review P3 fixes (22 of 40 fixed, 9 no longer valid, 9 deferred): an out-of-order async
beforeSeekresult no longer overwrites a newer seek; DVR back-to-live-edge leaves no stale seek filter; an internally re-issued seek that fails is reported as a non-terminal error and releases the filter; a late initial volume no longer overrides the user's setting; cutoverdisposeimmediately releases a claimed shadow and the latest playback rate is applied before the cutover; a disposedMovaPlaylistno longer switches source on navigation; kernel per-source option transactions are serialized anddisposewaits for native preparation with an upper bound; changing the guard config while hidden takes effect immediately; QoE does not count stalls during a user pause and an injected stall policy is reset per session; STT model and subtitle caches are written atomically and the downloaded size is verified; the preview cache key distinguishes request headers (unchanged when there are none), disabled preview no longer bypasses the switch through the cache, an illegal VTT crop degrades to the whole image; drag-seek preview and commit share the same starting point; the subtitle button reflects the real running state; the mini window recomputes geometry when its player changes. -
Request-header and event-delivery fixes: when the same URL is opened by two players (content and cutover shadow, or a feed pool) or by a retry with different headers, they no longer share each other's headers (each load uses an independent media_kit cache key and the fragment is not sent to the server); a failure to parse
http-header-fieldsno longer silently clears the headers and is reported through the diagnostics stream instead; after a synchronous event listener switches source inside callbacks such asMovaDone/MovaSourceChange, the old source's remaining logic (live end, keepAlive downgrade, Ready, quality probing) no longer runs, and an open rejected bybeforeOpendoes not affect an in-flight quality switch or recovery;screenshot()also retries within a 2 second total budget while playing, with a 3 second outer fallback for cutover;MovaFeedPlayerCtrl.pause()no longer waits for activation to finish and no longer throws activation errors. -
Final-review follow-up fixes: a
play()arriving inside the cutover commit window is also forwarded to the shadow about to take over, so the post-cutover state matches the latest play intent; exceptions thrown by host ad callbacks are, besides being logged, handed to the current Zone'shandleUncaughtErrorso they can reach the host crash collector without interrupting ads or resume; URL time-shift lag keeps growing while paused, is kept after resuming and cleared on back-to-live-edge, andseekByand retries compute from the lag including pause time. -
Full source-review fixes (27 P1/P2 items): when the host calls
open()directly to switch source, the old ad session yields and does not grab the original source back;dispose()no longer hangs when the event stream has a paused subscription; a new seek during a quality-switch load is not overwritten; replay/keepAlive waits honor a pause that happened in between; a terminal error cancels a scheduled recovery retry; leaving fullscreen keeps a forced orientation (onlyautorestores the host orientation); HLS variants are sorted video-first and ABR never drops to an audio-only variant; cutover re-checks play intent before the cutover and a fatal shadow is not promoted; a feed activation failure does not block the latest page and prefetch is truncated by a byte budget; QoE respects the playerfatal/code, and a manual start is landed only by the first frame and does not report TTFF; STT model id/filename path validation; lifecycle races of the mini window, fullscreen route and frame extractor; component patches fetch children by name, the progress bar follows the seek that was actually accepted, and the mini window fling is decided per axis. -
Corrected the overall CP3 headers criterion: with
CP3_HEADERS_READYon, acceptance uses the bounded screenshot of the normal/cutover player, and the old nativepoolscreenshot is kept as a diagnostic; quality switching stores the full variant list and the native path of the selected variant, and requires the auto and 360p variants, addresses and the rejection control to be correct. A new APK must be built and re-verified; old FAILs are not rewritten. -
The headers fixture gained
CP3_HEADERS_READY: independent normal/cutover paused-pool instances use the bounded screenshot capability right after bind returns, counting authorized screenshot nulls and successful image decodes, and keeping the rejected-auth and raw screenshot controls. A new APK must be built and re-verified. -
Fixed insufficient waiting for the fifth-round paused-pool screenshot: the total budget of
IMovaFrameCapture.screenshot()is unified at 2 seconds for normal and cutover players (including native capture and encoding), and screenshots are no longer gated onrendered; an empty result calls the kernel again at intervals starting at 50ms and growing to 250ms, and only an actually non-empty image counts as success. Timeout/failure still returns null; theCP3_HEADERS_READYcriteria (null=0/30, decode success=30/30) are unchanged and need a new APK to re-verify. -
Added the optional
IMovaFrameCapture.screenshot(), supported by normal and cutover players. Pause warm-up completes only after a non-empty screenshot within 2 seconds in total; a timeout/failure returns null, and stale results after a source switch, dispose or cutover are discarded. It does not play or seek,IMovaApigains no members, and pool bind/ready and the original first-frame event keep their semantics. -
Preview frame extraction: after the first seek-landing wait times out it re-sends one seek and re-confirms the landing point; a second timeout still returns null and no unconfirmed frame is captured. A duration-ready timeout and a screenshot failure still return null.
-
The pool warm-up probe now records non-empty screenshot evidence of the paused picture and the first-frame signal source, so size/grace fallbacks are not mistaken for real decoding success.
-
The headers frame-extraction fixture keeps the first empty frame / byte count / elapsed time and exception classification, and keeps positive/negative auth ownership, without covering sporadic failures with automatic retries.
-
The resource fixture no longer follows dynamic fd links; it reads thread/fd/CPU independently and records errors; it adds phase sampling for concurrent page flips and for 0/1/5 seconds after release, and a logical pool dropping to zero is not taken as proof that native resources were reclaimed.
-
The receipt fixture no longer compares the Seeked payload with the independently throttled progress stream for strict equality; it stores three position readings separately and states that this is not a native landing acceptance; the Size/Quality state consistency criterion is kept.
-
The normal
Movadelivers state events synchronously after updating state, fixing event payloads that disagreed with the receiver'sstateafter consecutive size notifications or a manual quality pick right after quality probing; nested events are queued, and error and recovery-failure notifications keep an async boundary. -
The headers pool warm-up fixture now mounts a real picture and waits for the exact first frame / media metadata or an error, keeps the accepted and decode results and the native read-back, and fetches the HTTP receipts only after both the positive and negative controls complete.
-
Added the missing SRT asset declaration to the example; all four subtitle format fixtures use in-package assets. A rebuilt APK must be re-verified.
-
Fixed the source request headers being lost in the media_kit load hook while playing media, and clear the previous source's headers after a source switch.
-
Fixed feed page-flip activation finalization resuming playback and overriding a host controller pause.
-
Corrected the matrix evidence gate: unrelated command errors no longer pollute every row, but an error in the integrity of the whole run still blocks a pass; the first failure of an old BLOCKED row is distinguished from a PASS fallback.
-
Corrected the playback-rate same-value dedup and the actual player-pool count criteria.
-
Fixed fixtures for CP3 subtitle assets, feed pool count, bottom bar live/DVR mounting prerequisites and silent-stream pause policy, STT start prerequisites and event-related field receipts; a new APK must be re-verified.
-
Clarified the CP2 acceptance contract (no product behavior change): a pod waiting-type ad requires a cutover and a renderEpoch increment; nowait opens directly on the current player. Ad slot timing is based on effective wall-clock time after the first frame and freezes on playing edges; the last media position cannot stand in for the remaining duration. See the offline triage for the rationale and fixture fixes.
-
Fixed a waiting-type mid-roll discarding the still-playing content progress during warm-up, which made the content repeat the warm-up wait period after the ad; the MP4/HLS resume point now follows the content until the cutover.
-
Fixed a stale proxy snapshot on an immediate insert right after
setRatecompleted, which lost the user's rate after the ad; it is still 1x during the ad. -
When a feed open fails, the current page and the retry entry are kept; an explicit host pause during a built-in guard pause cancels the automatic resume, and a later play is still handled by the visibility policy.
-
For VOD, automatic retries before the first frame and same-content alternative addresses keep
source.start; after a picture appeared the failure resume point is still used. -
With
fullscreenRouteon, the inline side yields its subtree while the route is mounted, avoiding duplicate GlobalKey mounting of the host surface/poster; the default (off) path is unchanged.
The following are behavior and migration notes after 0.4.0 (released with 0.4.1). They are merged by feature and keep the final contract; per-commit test numbers are in the unified orchestration master plan and CLAUDE.md and are not accumulated here.
Breaking / Deprecated migration summary #
state.errorholds terminal errors only; for full diagnostics listen toMovaErrorEvent.fatal/code, and look atMovaPlayFailurefor recovery decisions.MovaAds.load/loadDeferredreturnFuture<bool>; callers that onlyawaitare unchanged, overriders must update the signature; completion microtask timing is unchanged, andFuture<bool>can be used whereFuture<void>was.IMovaApi.openalready becameFuture<bool>in 0.3.1, so custom APIs must be updated too;falsemeans rejected/stale/disposed and must not be treated as a playback failure.- (Superseded by the 0.5.0 section: these aliases and the old-name typedefs have since been deleted.) Old-name typedefs plus
MovaMiniHost.ctlandMovaAdOverlayComponent.controllerare kept as@Deprecatedaliases; verbs and named parameters without an alias must be migrated with the rename table below. - Deprecations announced for the next release (no member-level annotations in this one): the old UI verbs/mirrors move to MovaChrome, the old style fields move to MovaPlayerStyle,
MovaAbrOpts.policymoves topolicyFactory. The STT re-export from the main entry is kept for one version only, so change imports tostt.dart; export-level internal helpers will be hidden next release, andIMovaApi.sttstays.
Sessions, ads and cutover #
-
Added the
movaCapabilityOf<T>(api)capability lookup. It prefers the proxy's own capability, otherwise looks through multiple cutover layers for the currently effective player, and does not modifyIMovaApi. -
When the host grabs the source and the session yields, one
MovaNodeEnd(superseded)is re-emitted for the node that had already started, keeping its original epoch, without reporting a node failure and without abandoning the host's new shadow. -
When a session reloads, calls
jumpTo/setItemsor is disposed, it cancels the warm-up credentials it holds; even a claimed transaction waiting for the old player to pause releases the shadow and forbids the cutover. The host's own new shadow is not affected. -
When a shadow cutover re-emits lifecycle events and a host callback grabs the source, the old re-emission stops immediately, the credential commit returns superseded and the session yields; the old player is still released normally.
-
The session landing window caches terminal failures by media ownership; even if
openreturns normally after a recovery giveUp, ad failure or contentcontentError,MovaNodeFailare still settled and the session returns to idle. -
The NextUp of
MovaPlaylist(ads:)is shown only on content session nodes and the old card is hidden immediately when entering/leaving ads and during transitions; the old direct playlist keeps its original criterion. The ad overlay reads the canSkip/skipIn of the ads orchestrator (MovaAds) directly, so stale progress in the pod landing window cannot show the skip button early; the countdown is rounded up at microsecond precision. -
Added
MovaAdOpts.midRollSnapback: when one progress tick crosses several distinct mid-roll points, it can replay all of them (defaultall), replay only the full pod of the last insertion point (last), or skip all and mark them as played (none); a single due insertion point and pods at the same point play as normal. -
The cutover proxy keeps the old player's playback observation during the cutover window and suppresses internal pause events; after the cutover it re-emits shadow-period SourceChange, Ready and FirstFrame in order, and on abandon restores the real state.
MovaCutoverChangegained an optionalreason. Proxy state and events are delivered through the same queue carrying the render epoch, so the state at receive time matches the payload, fixing the buffering state lag of H77. -
Every waiting-type ad in an ad pod now goes through prepare + credential commit with a unified ad-direction plan (default 1x, stop at first frame once ready, adReadyTimeout); when superseded by a new host open the session yields, and when a slot is replaced it only falls back as not-ready. The landing window discards the old media's end, error and progress, and content warm-up accounts for both the ad slot and the remaining asset time. The public
cutoverTois kept. -
A session settles a failure of the same epoch, node and attempt only once: ads are still handled by the ad failure policy, and with recovery on, non-terminal diagnostics go to the player; a terminal content error (waiting for giveUp when recovery is on) emits
MovaNodeFail(failItem),contentError, and returns to idle without auto-advancing.contentErrorcovers resolve failures, content open/switch exceptions and terminal failures. Fix: exceptions from an ad'scutoverTo, prepare and commit and direct ad open exceptions all enter the ad failure policy; a direct ad open rejected by the host is skipped without retry. Content open/switch exceptions are reported throughMovaAds.contentErrorand return to idle; host rejection and stale loads do not report errors and no contentEnded is sent. -
Session auto-advance validates the epoch when consuming the end notification, so a manual episode change is not overridden by an old notification; replacing the list invalidates in-flight jumps, and the ad-shared list index and indexChanges follow session navigation. When a pre-roll still loading is skipped, the load result waits for the resume request of the same epoch to settle.
-
MovaPlaylist(api, ads:)shares a session, episode changes carry per-episode ads and auto-advance waits for all post-rolls; this path obeysplaylist.enabled, and the old direct constructor keeps its behavior. -
Added
MovaSessionwith multiple items, per-episode ads and load outcomes; direct construction auto-detects the enabled cutover capability;MovaPlaylistItem.adBreakscan override the schedule andMovaAds.sessionoffers shared access. -
Fixed internal pauses superseded by a successor switch polluting play intent; waiting-type ads pass an explicit start intent through an in-package capability. After an ad's first open fails in a hook, the retry keeps this load's intent and yields to later user play or pause commands.
-
Cutover and ad resume inherit the user's play intent, so skipping an ad after a pause does not start playback automatically; custom movaFactory players must maintain playbackIntent, and if the intent is always false the player stays paused after the cutover.
-
Ad slots and mid-roll countdowns use a pausable clock: time during an observed pause is not charged to the ad duration;
delayRemainingis computed on the same clock, while the first-frame load deadline still uses an independent wall clock. -
The ad failure policy and shadow warm-up abandonment react only to
MovaErrorEvent.fatal == true; non-terminal kernel logs no longer interrupt ads or warm-up, and the existing attempt dedup and cutover acceptance contract are unchanged. -
Fix: after the player is ready it probes HLS variants by itself by default (
MovaAbrOpts.probeVariants: true). Automatic and explicit probes in the same session share one request, a late result updates the list but does not override a manually chosen variant; automatic probing can be turned off so the host calls it explicitly. Auto ABR takeover is still not enabled. -
Fix: later ad failures within an ad pod keep advancing. Resume and failure are deduped per attempt, so a Timer and the asset ending do not advance twice; cutover distinguishes host rejection through an in-package optional capability, a rejected shadow is released immediately, a rejected ad is skipped without entering retry, and the old content picture is no longer taken as the ad's first frame.
-
Fix: the cutover commit transaction owns the cutover exclusively. Concurrent commits re-validate the slot after queuing,
cutoverTocommits only the slot it warmed itself; a failure to hold the target frame does not block commit and release, and a slot cleanup exception still guarantees the effective player is released and streams are closed. -
Fix: returning to content uses a separate transition phase, so old ad progress, end events and immediate inserts no longer wrongly trigger content scheduling or rewrite the resume position.
-
Fix: cutover isolates source switches, reloads and concurrent cutovers with an internal operation generation; commit releases only the claimed warm slot, keeping the resources and phase of a newer prepare, and a stale cutover no longer falls back to grab the source.
-
Fix: live shadow warm-up no longer requires catching up with the content position (the longer the content played, the more likely it degraded into a non-seamless cutover). A live shadow starts from the live edge and never seeks, so its position starts at 0, while
MovaBufferWarmrequired shadow position >= target position - tolerance, making readiness time about startup latency + content position already played; the variant where content played 7s first gave up warm-up 10/10 at the 8sreadyTimeout(measured on real device STG-AL00). NowMovaWarmSignalgainedlive(default false, custom criteria unaffected) andMovaBufferWarmtreats live as reached, still requiring no stall + lookahead buffer >=lookahead+stableTicksconsecutive checks; VOD and signals withoutlivebehave as before. On device: content played first for 500ms/3s/7s/15s/30s all pass (B/C 5-10 runs each), shadow ready time stays at about 3-4s and no longer grows with the content position, andreadyTimeoutis still 8s; see q13-live-warm-fix-verification. -
Fix: after
dispose()verbs are no longer forwarded to a disposed kernel. Previouslypause/setVolume/setRate/switchQualityetc. still called the kernel after dispose, and the real media_kit throwsAssertionError('has been disposed')(the uncaught[Player] has been disposedexception in device re-test logs may share this cause). Now all public verbs ofMova/MovaCutoversilently return once disposed (no throw, no event, no kernel or port access), async verbs re-check after awaiting, andprepare/cutoverToof a disposedMovaCutoverno longer create a new shadow player. -
Docs/verification page: fixed the resume-window anchor of the HE V6 verification script (the old form always matched the first frame of the session and once misjudged "V6 resume failed" as a library defect); Android device V6 re-test passed 5/5 with resume error 0-40ms. Coverage test results are in
doc/plans/2026-10-27-device-coverage-results.md.
Views, styles and host components #
-
MovaPlayergainedfullscreenRoute(default false): when on, the app root route shows fullscreen, the back key leaves fullscreen first, and when locked it usesMovaStrs.unlockto prompt unlocking. The route borrows the same API, builds its own independent chrome, does not re-probe quality, and returning shows the inline controls; styles inheritMovaPlayerStyleand the old config fallback, while orientation restore and PiP/mini are still managed by the player. The fullscreen route carries the background guard ownership so its own occlusion does not trigger a pause; custom surfaces of both the inline and route sides on Windows also go through MovaSnapshotGuard. When off, the original player tree and behavior are kept. -
MovaViewrebuilds only when a config section actually consumed by the player changes; changes of theme, strings, gesture, controls and danmaku sections go through view updates, keeping the player, open count and playback state. The latest options are passed down as a compatibility fallback, and inline string closures and danmaku lists no longer trigger a rebuild.MovaViewcompares the constructed config throughMovaOpts.movaSectionsEqual, ignoring host changes in the ads/playlist/mini sections; the UI style section goes through view updates since C06; in debug, if the actual config differs for 10 consecutive frames, it warns once per view. -
Added
MovaIconsandMovaPlayerStyle.icons/iconsOf, allowing the 20 control-UI icons (excluding feed social buttons) to be replaced per view or per theme extension; accessibility labels continue to be provided explicitly by the strings.MovaTheme.progressColorconfigures the progress highlight and thumb color; the default null follows the host SliderTheme, and default icons are unchanged. The quality auto/unknown compatibility labels are promoted to kMovaAutoQualityLabel/kMovaUnknownQualityLabel, keeping the old values, and it is announced that the next version changes them to neutral values. AddedMovaPlayerStyle(ThemeExtension) andMovaDanmakuStyle;MovaPlayer/MovaViewsupportstyle. Theme, strings, gesture, controls behavior and danmaku style are looked up per section in order: view parameter > theme extension > old options > default. Switching theme updates the cached UI kit and controls config without rebuilding the player; the danmaku switch and items still come from options. Button accessibility names, tooltips and the quality "auto/unknown" display now read fromMovaStrs, with new replaceable action strings and a labelWithValue format function; built-in buttons pass labels explicitly and default strings are unchanged. The old Chinese labels ofMovaQualityare kept in this version and the next version plans to change them to neutral values. -
Deprecated (announcement, annotations next version):
MovaOpts.theme/strings/gesture/controlsand the danmaku style fields are planned to be deprecated in favor ofMovaPlayerStyle; the old fields continue to act as fallbacks in this version and no member-level@Deprecatedis added. -
Deprecated (announcement, annotations next version):
IMovaApi.showControls/hideControls/showHud/setDragging/uiState/uiStatesare planned to be deprecated next version in favor ofMovaChrome; the old verbs broadcast to all mounted views and the old mirror takes the last changed view. Lock, zoom, fit and otherMovaStateremain shared by the player. -
Rename wrap-up:
MovaMiniHost.minireplaces the oldctlparameter/field andMovaAdOverlayComponent.adsreplaces the oldcontrollerfield; the old entries are kept as@Deprecatedaliases and construction and rendering behavior are unchanged. (The aliases were deleted in the 0.5.0 section.) In-package calls and examples migrated to the new names. Verified that factories already shareMovaFactoryand existing type aliases are all marked deprecated; fixed the outdated doc statement that "enum values cannot be accessed through a typedef". -
Fixed nested
MovaAutoPauseof different APIs shadowing the outer guard;MovaPlayerlooks up the full ancestor chain by API and honors the outer config's background continue-playing. -
The video background pause of
MovaPlayernow goes through the player, so hooks, play intent and the ad clock can observe it, and imperative keepAlive is also ended by the player; by default going to background still pauses and returning to foreground does not auto-resume. audioOnly without a render surface is unaffected; for background playback wrap the player withMovaAutoPause(opts: MovaAutoPauseOpts(background: false))on the same API. -
Fix:
probeVariants: falseturns off all automatic probing of the player and the defaultMovaPlayer/MovaView. The UI automatic entry requires bothautoLoadQualities && api.options.abr.probeVariants;autoLoadQualities: falseturns off only that UI entry, and an explicitapi.loadQualities()is unaffected by either. -
Feat/Fix: buttons are focusable by default with semantics, tooltip and focus indication; mouse hover shows the controls.
MovaCtrlsOpts.shortcutsdefaults to false; when enabled, a focused player supports Space for play/pause, Left/Right to jump ten seconds, Up/Down for volume, F/Esc for fullscreen; lock, PiP/mini and text input do not handle player shortcuts. -
Perf: the position label updates per second,
MovaPlayercaches static components and built subtrees; duplicate scalar state mirrors no longer emit events, and dispose cancels the HUD and controls timers before the first await. -
Fix: vertical swipe sensitivity takes effect, patch path errors assert in debug; the lock button enters the component tree and follows controls show/hide (the unlock entry is kept while locked), and option popups can scroll.
-
Fix: the auto-pause guard exempts fullscreen; system PiP state broadcasts flow back only to the player that initiated entering, and the receiving eligibility is revoked after a failure.
-
Breaking (naming): dropped the
*Controllersuffix, renamed standby to keepAlive and swap to cutover (pure renames, behavior unchanged).- Classes:
MovaAdController->MovaAds,MovaFeedController->MovaFeed,MovaPlaylistController->MovaPlaylist,MovaMiniController->MovaMini,MovaSwapController->IMovaCutover,MovaStandbyController->IMovaKeepAlive. Swap*->Cutover*(MovaSwapEngine/Config/Change/Phaseetc.),Standby*->KeepAlive*(MovaStandbyConfig/Phase/Mode/Reason/Change/Resume,MovaSilentStandbyetc.).- Members:
MovaState.standby->keepAlivePhase(typeMovaKeepAlivePhase),MovaOpts.standby->keepAlive,MovaOpts.swap->cutover,MovaHiddenMode.standby->keepAlive,setStandby->setKeepAlive,swapTo->cutoverTo,MovaAdController(swap:)->MovaAds(cutover:). - Files/directories:
core/standby/->core/keep_alive/,core/swap/->core/cutover/,ad_controller.dart->ads.dartetc. (only affects code importingpackage:mova/src/...directly; imports throughpackage:mova/mova.dartare unaffected). - Compatibility layer: old class names are kept as
@Deprecatedtypedefs for one version (lib/src/deprecated_names.dart), andMovaState.standby,MovaOpts.standby/swap,MovaHiddenMode.standbyalso keep@Deprecatedaliases. (All of these aliases were removed in the 0.5.0 section.) Without aliases: renamed methods/named parameters (setStandby,swapTo,MovaOpts(swap:/standby:),copyWith(swap:/standby:),MovaAdController(swap:)) - these must be migrated using the mapping above. - The key
swapEnabledin the report payload (QoE session field) is kept as is and not renamed. (Changed in the 0.5.0 section: the key is nowcutoverEnabled.)
- Classes:
-
Fix: the in-app mini window was not collapsed after entering system PiP (device coverage re-run A15/F5).
enterPip()setsMovaState.miniback to false, butMovaMinidid not know and the mini window stayed on screen. NowMovaMinilistens to the borrowed api's state and removes the mini window when the api leaves the mini state by itself.
Preview, feed and resource ownership #
-
Added the sub-entries ui_kit.dart, ads.dart, feed.dart, mini.dart, extend.dart and a separate stt.dart; mova.dart still exports all original symbols in this version. The STT re-export from the main entry is kept for one version only and
IMovaApi.sttstays; model download is still an experimental implementation. Internal helpers are announced to be hidden at export level next version, no member-level@Deprecatedis added in this version, and runtime behavior is unchanged. -
MovaFeedPlayergained the host-ownedMovaFeedPlayerCtrl, which can query the feed/current index/current player, jump pages and play/pause, and unbinds when the controller is replaced or on unmount; the players are still released by the widget. The whole-feed MovaAutoPause is built in, with configurable autoPause (null disables the guard) and routeObservers, and page-flip exclusivity is still handled by the pool. A per-page feed loader throw, open rejection/throw and terminal errors during playback are now a visible failure UI, using the theme's error/retry strings by default and customizable through errorBuilder; a failure does not retry endlessly on ordinary rebuilds and an explicit retry affects only that page. A load failure of the current page stops the previous page's sound while other pages can still be browsed; the end placeholder when the loader returns null is unchanged. -
MovaSourcegained headers/userAgent/start: playback options, quality probing, VTT/sprite sheets, frame extraction and feed prefetch share the source request headers with an explicit UA taking precedence; the VOD start position is delivered through the existing seek register chain and ignored for live. The signatures ofIMovaApi.openandIMovaHttpFetch.get(Uri)are unchanged; the new optional capabilityIMovaHeaderedHttpFetchlets old fetchers degrade to no headers with a debug hint once per instance; frame extraction is likewise compatible with old ports through the optionalIMovaHeaderedFramePuller. -
Preview resource gating passes the request generation and a cancel signal and re-checks after the async network probe returns and before HTTP/frame extraction starts; cancel, source switch and dispose invalidate old calls, dispose does not wait for the probe, and the wrapper still does not dispose host ports. A preview network policy rejection is passed through VTT and the service layer by a dedicated signal; it no longer counts toward the VTT fetch-failure cooldown nor continues into ordinary failure fallback, and switching back to Wi-Fi can retry immediately. Tightened the on-demand boundary of C12: custom preview sources may only read memory, so without an explicitly injected probe the default connectivity is no longer queried from the remote media address; built-in sources still query only at actual remote resource requests, and custom sources with an explicitly injected probe keep entry gating; never/always policies are unchanged. Reversed the earlier decision not to wire a network probe by default:
createMovacreates a connectivity probe on demand for wifiOnly preview; it queries only when actually requesting a remote VTT, sprite sheet or frame extraction, and does not query for caches, VTT cooldown, disabled sources and local resources. The test seam still does not wire platform plugins. -
After the last view unbinds, the not-yet-expired HUD/controls timer responsibility is handed back to the player or the old mirror, keeping the remaining deadline and always-visible state and cleaning up drag and preview; this applies to normal players and the cutover proxy. The HUD registers its timer before synchronously notifying listeners, so reentrancy and a subsequent dispose no longer leave a stale timer.
-
The built-in preview service builds an independent session per view, sharing the cache and serialized source resolution, and each view receives only its own results and cancels only its own requests. Custom previews can implement IMovaPreviewSessions for the same isolation. When the bottom bar or horizontal-swipe drag is unmounted because of locking, it releases its own drag state, clears the preview and resumes auto-hide.
-
While dragging the progress bar or horizontal-swipe seeking, the view's controls and preview stay visible and the auto-hide timer restarts after release; pressing the controls, and pointer/keyboard/semantic activation of buttons renew it and the always-visible state is kept. Applies to views that support the bridge or are given an explicit chrome; non-bridge old paths keep their behavior.
-
Every
MovaPlayerview that supports the bridge owns its own MovaChrome (which the host may pass in), so controls, HUD, drag and preview do not interfere with each other; cutover cutovers and shadow Ready replay keep the view interaction state and timing. With no views the old behavior is unchanged; a custom IMovaApi keeps the old interface by default and can pass chrome explicitly to enable independent interaction state. When a view exists, ready show/hide is handled by the view, and the old reader of a normal player sees the mirror one microtask after MovaReady. -
The testing entry gained
MovaTestKernel.scriptedandMovaTestStep: scriptable ready, buffering, progress, failure and end; ready automatically composes the first-frame signal, and a source switch or dispose cancels old steps. The normal constructor stays passive by default and does not auto-play or emit signals. -
Injected kernels, preview cache/probe/source/frame extractor, HTTP and STT recognizers are disposed by the host; self-created resources are still released with the player. Use
ownsKernel: trueto hand over a kernel; kernels created by the default factory are automatically owned by the player. An STT start failure only rolls back and no longer throws into the playback chain. AddedMovaAbrOpts.policyFactory, which creates an independent policy per player and takes precedence over the oldpolicy; the old instance field is to be deprecated next version and only announced in this one. -
MovaMini.showobeys mini.enabled consistently with showInPage; a disabled cutover warm-up and an STT start without a recognizer warn once per instance in debug, andcutoverEnabledandoptions.stt.hasRecognizercan be read respectively. -
Fix: quality probing is deduped by session and effective source address index. After a failover the new master can be probed explicitly, and a late result from an old address is still discarded; quality switches and retries at the same address keep sharing the request. On player dispose the self-created fetcher is closed and in-flight probes are cancelled even when VTT is disabled or a custom preview source is used; a host-injected fetcher (including the default VTT borrowing) is closed by the host.
-
Fix: an ad episode change cancels old timers and shadows synchronously, so a post-roll no longer warms an already ended content; async ad operations discard late results by load generation, preventing an old ad from resuming timing, rate or STT.
Errors, recovery, loading and platform #
-
The delayed ready of the scripted test kernel uses the latest play intent, keeping the last decision of pause/play before ready; the normal passive kernel still only records commands and does not signal automatically.
-
createMovawarns in debug about default kernel parameters ignored when a kernel is injected; on Android with the default kernel and tlsVerify on, it asserts that a non-empty tlsCaFile must be provided. The frame extractor still defaults to null and the docs state it must be injected explicitly. -
README app examples consistently use createMova, the first example awaits and catches open failures; a bare Mova with default platform ports warns once in debug.
-
Restored the terminal state for main-file open failure when there is no END_FILE event pump: it confirms at error arrival that the pump is unavailable and enables the fallback only if the stream/cplayer/ffmpeg error text contains the current main file address; external subtitle, external audio track and HLS segment errors stay diagnostics, and when the pump is available END_FILE still decides.
-
Fixed END_FILE ownership and termination handling: before each actual load the old weak-client queue is drained synchronously, and end notifications carry an attempt number; termination goes through a single entry, one fatal per attempt, with duplicate logs kept as diagnostics. A keepAlive failure silently degrades and reopens on wake, and notifications during open are handled after it returns.
-
state.errornow means only errors that terminate playback. Non-terminal kernel logs no longer write this field nor show the default error overlay;MovaErrorEvent(fatal: false)andMovaHook.onErrorstill notify as usual. Hosts that need to diagnose all errors should listen toMovaErrorEventinapi.eventsand decide byfatalwhether to show a failure; hosts that need to track recovery decisions listen toMovaPlayFailure. END_FILE(error), recovery give-up, known terminal text and open throws are still written to state; without a pump the open-error fallback containing the main file address is restored and reuses the recovery or termination decision. -
The error overlay uses the
MovaStrs.playbackError/retrystrings (defaults are Chinese: "playback failed, please retry" / "retry"); the raw error is shown only in debug mode. -
Added the experimental
MovaAbrOpts.manageAuto(default false): when explicitly enabled, on an auto stall mova drops to the second-highest variant of the list and then continues with the specific-variant downshift logic; it obeys the ABR master switch and the seek/switch lease. CP0 device measurement (STG-AL00, default config, throttled fixture, 90 second window): mpv's auto variant stayed at the highest variant without downshifting and rebuffered repeatedly under throttling; with this switch on, mova's ABR takes over the downshift. Still experimental and off by default. -
Failure detection no longer depends on recovery: the first open lazily starts the END_FILE weak client; a terminal error clears buffering and pauses, and enables RESTART when a poster exists. alternatives requires recovery enabled (debug assert).
-
With recovery off, an open failure still throws and also writes a terminal state.error; it is announced that the next version no longer throws, so migrate to error-event handling.
-
Added: playback error event grading.
MovaErrorEvent.classifiedcarriesfatal/code, and the old constructor signature and default semantics are kept. mpv keeps the subsystem from logs through an optional error capability, the player subscribes to this entry first and old kernels can still use the error stream. Logs are non-terminal by default;Failed to initialize a decoder,Failed to recognize file format.and recovery give-up are terminal, and code and the QoE mapping are consistent. Only terminal errors are written tostate.error; END_FILE is wired and the QoE settlement criterion is unchanged. -
Fix: the ABR lease of live quality switches and time-shift seeks is released after this buffering true -> false. The leading false from the internal stop in open is ignored so the load itself is not counted as a stall; without a buffering signal it is still released after 10 seconds, and VOD resume validation and source switch/dispose cleanup are unchanged. Fix: ABR masking is now a lease carrying the load attempt number. A late finish of an old switch cannot release the masking of a new switch or seek; buffering caused by a user seek is not counted as an ABR stall, and the 10 second fallback cap is unchanged.
-
Fix: a new user seek clears the superseded old registered/pending-settlement target; when duration is known but the first variant has not landed and another switch happens, the latest seek (including 0 seconds) is used, and after the target echo settles it does not fall back to the old load spec. When duration is unknown it is still registered and re-sent after ready.
-
Fix: keepAlive wake and back-to-edge reopen replays obey the current keepAlive phase; entering keepAlive again immediately invalidates an in-flight wake and sends no old resume event. With recovery off, a background wake reopen failure is reported through state.error, MovaErrorEvent and hook.onError and ends the recovery measurement, no longer falsely reporting recovery success after a timeout.
-
Fix: internal retries replay the effective load spec, keeping the manually chosen quality; time-shift retries rebuild the address from the original fixed lag and the current time, a failover clears time-shift and the old variant list. Back-to-edge keeps the current variant and duration and starts playing by the latest play intent after reopening. Consecutive switches inherit the not-yet-landed resume target, and a user seek during the wait for the first frame of recovery supersedes the old failure point.
-
Fix: keepAlive wake measurement uses an independent first-frame gate; a source switch, quality switch or recovery reload ends the old measurement as reloaded without sending MovaKeepAliveResume, and an old resume timeout no longer interferes with the new source's first frame.
-
Fix/timing change: the back-to-edge and reopen of a keepAlive wake no longer occupy the keepAlive queue;
setKeepAlive(false)completes on entering resuming and does not wait for the network reopen or the first frame. After the network returns, only the current attempt starts playing by the latest play intent, and a pause in the meantime is not overridden. -
Fix: an open rejected by the host no longer invalidates an in-flight play/seek; a play intent during a paused load is re-sent after the load completes, while a keepAlive request still keeps the paused load.
-
Fix: a successful software-decoding fallback after hardware decoding failure no longer falsely reports a playback error. mpv's
Could not open codec.attempt log is filtered precisely, keeping the terminal errors of decoder exhaustion and format recognition failure, so real failures can still be reported when recovery is off by default. -
Fix: a negative
seek/seekBywith unknown duration no longer leaks the lower bound. When duration had not arrived,seek(-5s)was registered as is, progress reported a negative number first, and after duration arrived -5s was also sent to the kernel (the known-duration path used to clamp to 0). Now the entry clamps the lower bound to 0 first and clamps again by the duration upper bound when re-sent. -
Fix: the progress bar froze forever after a user-initiated
seekwas dropped by mpv (H17). Previously only the resume seek after a quality switch had the verify + re-send chain; after an ordinary seek was dropped_pendingSeekTargetstayed armed and all later real positions were swallowed as stale echoes until the next seek. Now VOD seek reuses the same verify/re-send chain (at most 3 times); after giving up it releases echo suppression and progress follows the real position again; if a new seek arrives during re-sending the old chain is invalidated, the rule that live does not seek is unchanged, and it also holds while paused. -
Fix: the resume position was lost after a quality switch (
switchQuality/ABR downshift). During consecutive manual HLS variant switches the resume seek was sent the moment the new variant reported its duration, when mpv had not yet finished playback initialization, so the seek was silently dropped and playback restarted from the beginning (only 1 of 5 local HLS switches on an Android device resumed). Now the registered resume seek waits for the new variant to land (first frame / native RESTART) before being re-sent; if it has not landed within 4s it is re-sent as before, and if landing precedes duration it waits for duration. On Android device (STG-AL00) 15/15 landings across normal/cutover proxy/paused states, 5 each, had 0ms error. -
Fix:
setRateentry clamping. The rate is clamped to 0.25-4.0 (kMovaMinRate/kMovaMaxRate, NaN treated as 1.0), and the kernel, state andMovaRateChangesee the same value (previously 0/negative/NaN went straight to the kernel and state and event copied it). -
Fix: an exception thrown by the host report callback no longer interrupts the player. Exceptions thrown by
IMovaReporter.onReport(both call sites,IMovaApi.reportand the QoE collector) are isolated and only notify each hook'sMovaHook.onError, leaving playback state and later reports unaffected (previously the exception propagated into the event subscription callback and became an uncaught async error). -
Fix: out-of-range
setVolume/setBrightnessvalues. The entry clamps to 0-100 / 0-1 first, so state, events and ports see the same value (previously state stored the out-of-range value, the system volume was clamped by the port and brightness was rejected by the platform plugin withRangeErrorand swallowed, so the HUD and the actual device disagreed). -
Fix: repeated
dispose()threw an exception (A23).dispose()ofMova/MovaCutoveris now idempotent and the second call returns immediately. -
Fix: low
setZoomvalues collapsed the picture (A12). Values below 1.0 or NaN are treated as 1.0; there is still no upper limit (maxZoomonly constrains the pinch gesture).
0.4.0 #
- New: unified timeout config
MovaTimeouts(MovaRecoveryOpts.timeouts, exported throughpackage:mova/mova.dart). Fieldsnetwork(-> mpvnetwork-timeout, whole seconds),whepHandshake/whepFirstFrame/whepMedia(->handshake_timeout/first_frame_timeout/media_timeout, microseconds,whep...addresses only), delivered to mpv through the existing source-option mechanism before each open; all default tonull(mpv defaults untouched); explicit settings ofMovaSource.mpvOptions/demuxerOptions/whepMediaTimeouttake precedence.MovaSource.mpvOptionsForgained the optional parametertimeouts; new public constants such askMovaWatchdogMargin(5s). - Behavior change: the Dart watchdog is demoted to a fallback and its deadline is derived from the mpv window (visible only when
recovery.enabled). Reconnection is driven mainly by mpv'sEND_FILE(error)/error events; the defaults ofstartTimeout/stallTimeoutchange from a fixed 10s tonull(derived = longest mpv window + 5s): withouttimeoutsconfigured, non-WHEP start/stall are both 65s, WHEP start is 85s and stall 10s; explicit settings still use the user's value. Without configuration, failure detection for a black-hole host is much slower than before (10s), so settingtimeouts.networkas well is recommended. - Behavior change (API): the type of
MovaRecoveryOpts.startTimeout/stallTimeoutbecomesDuration?; the oldstallTimeout: null(turn off the stall watchdog) is replaced by the new fieldstallWatchdog: false, andnullnow means "derive";copyWith(clearStallTimeout: true)now means "reset to derived". AddedstartTimeoutFor(uri)/stallTimeoutFor(uri). - Behavior change: the default of
MovaLiveReconnect.maxDelaychanges from 30s to 15s (backoff sequence 1, 2, 4, 8, 15, 15...). - Docs: the README recovery section gained "reconnect responsibilities" (live does not enable
reconnect_streamed, VOD keeps mpv's default reconnect, mpv main path / Dart fallback) andMovaTimeoutsusage.
0.3.2 #
-
Fix: two issues from device re-testing of the recovery layer.
- Deterministic failures such as 404 still waited the full
startTimeoutbefore retrying under the default config: the nativeEND_FILEsubscription was opened only with a reporter orpreciseFirstFrame: true, andrecovery.enableddid not open it. NowcreateMovasubscribesEND_FILEautomatically whenrecovery.enabled;MovaMpvKernelgainedobserveRestarts(defaulttrue), so recovery opens only END_FILE and does not forwardPLAYBACK_RESTART, keeping the first-frame criterion the same as without recovery (when RESTART is not forwardednativeRestartAvailableisfalseand the first-frame gate does not wait the grace period for nothing).movaObserveFlagsgained therecoveryparameter and therestartfield. whepMediaTimeout/demuxerOptionsoverwrotedemuxer-lavf-oas a whole and restoring then failed: the whole string was set, wiping media_kit defaults such asseg_max_retry/allowed_extensions/protocol_whitelist; on restore the read-back string was written back as is, but the value ofprotocol_whitelistcontains commas and could not be parsed again, so mpv reportedExpected '=' and a value., the error went tostate.errorandMovaErrorEvent, and later VOD sources still carriedmedia_timeout. Nowchange-list addmerges only this source's keys, restore usesremovefor those keys andappendto bring back original values displaced by same-named keys, and no longer reads back the whole string; entries that fail to write or have invalid syntax are skipped as a whole.MovaMpvKerneluses this path for key-value list options such asdemuxer-lavf-o/stream-lavf-o, while othermpvOptionsare still written as whole values and restored to the value read.
- Deterministic failures such as 404 still waited the full
-
Fix: six issues in the recovery layer (
MovaOpts.recovery) (from Android device runs pulling WebRTC/WHEP live streams with the publisher going offline and recovering):state.errorwas not cleared after recovery succeeded:MovaRecoverednow clears the kernel error left during the failure (previously onlyopen()cleared it, so a normal picture still carried the old "Failed to recognize file format").state.bufferingstayed true after give-up:giveUpresetsbufferingto false and emits oneMovaBufferChange(false)(not repeated if it was not buffering), so the spinner no longer hangs forever.- A failed retry waited the full
startTimeoutbefore the next one: the root cause was thatEND_FILE(error)(e.g. 404) arriving while a load was in flight (_kernelOpening) was simply dropped and only the 10s start timeout covered it. Now it is recorded and handled by the policy right afteropen()returns; a session superseded by a neweropen()is discarded. - Live only retried once by default: added
MovaLiveReconnect(exponential backoff, default starting at 1s, x2, capped at 30s, never gives up,maxAttemptscan set a limit; with multiple addresses earlier addresses retryretriesPerAddresstimes before switching and the last one reconnects continuously) andMovaDefaultRecovery(VODMovaRetryThenFailover, liveMovaLiveReconnect), effective whenMovaRecoveryOpts.policyisnull; added the switchMovaRecoveryOpts.liveReconnect(defaulttrue;falsebrings live back to the old retry-once);MovaPlayFailgainedisLive. Behavior change: a live source no longer gives up after the second failure when recovery is on and no custompolicyis passed; VOD default behavior is unchanged. The default type ofMovaRecoveryOpts.effectivePolicychanged fromMovaRetryThenFailovertoMovaDefaultRecovery. - The public API could not pass source-level libmpv/ffmpeg options:
MovaSourcegainedmpvOptions(arbitrary mpv options),demuxerOptions(composesdemuxer-lavf-o),whepMediaTimeout(WHEPmedia_timeout, converted to microseconds automatically, effective only forwhep...addresses) andmpvOptionsFor(address);MovaSource.pick/sameAssupport them too. On the kernel side the new optional capabilityIMovaSourceOptionsKernel(implemented byMovaMpvKernelandMovaTestKernel): the player stages the address's options before each kernelopen, the kernel applies them before open and the next open first restores the original values, so nothing leaks to the next source.MovaTestKernel.stagedSourceOptionslets host tests assert. - Live
MovaDurationChangewas too frequent: addedMovaLiveOpts.durationStep(default 2s); live duration changes smaller than a step are not reported (both state and event skip; the first non-zero value, a fall back to 0 and the first value after re-open/reload always pass),Duration.zeroturns throttling off; VOD is unchanged. - Added 48 regression tests (
recovery_fixes_test/live_reconnect_test/duration_throttle_test/source_options_test/mova_source_options_test/mpv_kernel_source_options_testetc.); the full suite of 1472 passes.
0.3.1 #
-
Breaking (public signature):
IMovaApi.open()changes fromFuture<void>toFuture<bool>;truemeans the source was accepted as the current source; it isfalsewhen abeforeOpenhook rejects, when superseded by a lateropen()and when the player is disposed. A load failure is notfalse(it is still reported through events/recovery and thrown if unhandled). Code that onlyawaits/unawaiteds the call needs no change; classes implementingIMovaApithemselves (including test doubles) must change the return type ofopentoFuture<bool>.MovaPlaylist.jumpToaccordingly no longer advances the index whenopenis rejected, so the list and the actual source no longer drift apart. -
Fix: three edges of host async hooks, preview queue and gesture reconfiguration. (1)
play()/seek()re-check after the host's asyncbeforePlay/beforeSeekreturns: a late play/seek no longer overrides a userpause()or source switch in between (previously it flipped pause back to play or applied an old jump to the new source). (2) A single resolve throw in the preview service queue no longer makes all later requests skipped, and thedisposesteps are isolated from each other (a throwing host-injected cache/probe no longer drags dispose down). (3) After gesture actions are reconfigured, displacement is taken from the axis that selected the mode:horizontal: volume/brightnessincreases to the right,leftVertical/rightVertical: seekfast-forwards upward (previously the wrong axis was read and displacement was about 0); default config behavior is unchanged. -
Fix: three small issues.
MovaDanmakuOptsgainedassert(trackCount > 0)(previously 0 caused a modulo by zero),MovaGestureOptsgainedassert(maxZoom >= 1)(previously a value below 1 madeclampthrowArgumentErrormid-pinch), andMovaSttService.start()rolls backisRunningwhen the playerstartfails so it can be retried directly withoutstop()first. Also completed the public member docs ofMovaPatch*andMovaPlatform. -
Refactor: rate for seamless cutover is now declared by the warm-up plan.
MovaWarmPlangainedrate(null inherits the old player, behavior unchanged) andIMovaCutover.cutoverTogained the optionalrate; the ad direction (built-ineffectiveWarmPlanand podcutoverTo) declares 1x and the back-to-content direction declares the rate before the ad, written directly onto the successor at cutover time, so there is no window where the ad briefly runs at the user's rate between the cutover and the reset taking effect. The originalsetRatereset inMovaAdsis kept as a fallback only for the paths that fall back to an ordinaryopen()or where a host customadWarmPlancarries norate. Android device V12/V13a(2x)/V13b(1.5x) passed. -
Fix: the second ad's
cutoverToin an ad pod was silently downgraded to an ordinaryopen(). Two races: (1)MovaCutover.abandon()reset_warmPlan/subscriptions, set the phase back toidleand woke the ready completer only after the firstawait, so acutoverToright afterunawaited(abandon())wiped the new warm-up; shared state is now reset synchronously before theawait; (2) whilecutoverTowas waiting, the old player's progress tick triggered "warm content behind the ad" inMovaAds, pushing out the ad shadowcutoverTowas waiting for; now content is not warmed whilecutoverTois in flight. Android device (STG-AL00) V12/V12b: the second ad took a real cutover (renderEpochincremented), slot duration 5970-5999ms (configured 6000ms). -
Fix:
state.pipwas not reset after the user expanded/closed system PiP. Added the optional port capabilityIMovaPipObservable.changes(the player probes it withis, so existingIMovaPipimplementations need no change); the Android plugin listens to Activity configuration changes and pushespipChanged(on exit the PiP flag flips after the configuration change, hence the delayed re-check and dedup); the player updatesstate.pipand emitsMovaPipChangeaccordingly. On Android device (STG-AL00) theam startexpand path was verifiedtrue -> false; the close-by-X path could not inject a tap and was not tested. -
Fix: full review (Codex + manual final review) fixed a batch of async staleness / resource ownership issues, adding about 45 regression tests, with Android device (STG-AL00) re-tests item by item against the pre-fix baseline:
- Seamless cutover: the warm-up timeout is now covered by an independent timer rather than progress events (
readyTimeoutpreviously did not take effect when the shadow had no progress at all); a failing shadowopen/seekis cleaned up and falls back to an ordinary open and no longer sendsMovaErrorEventto the main event stream (which would misjudge a healthy playing ad as failed); when a shadow already exists andcutoverTochanges the source it is discarded before warming and the old shadow is no longer committed; adisposein the middle of commit destroys the shadow; at commit rate/fit/zoom/volume/lock/fullscreen/mini/orientation are handed to the successor, the old player is marked retired viaIMovaHandoffRetirable, and disposing a retired player no longer resets the global orientation. Mova: validatesdisposeafterbeforeOpen; no longeradds to a closed event stream afterdispose; under fullscreen/forced orientationdisposeresets the device orientation and immersive mode;MovaMpvKernel.open()re-checks the sequence number after async recovery so old requests no longer override the new source; theMovaVolumeChange.valuecomment corrected to 0-100.- Ads: added a session number and a disposed flag, so a stale deferred resolve result no longer reopens the old content; ad load timeout and slot timing are based on the real first frame (
rendered/MovaFirstFrame, falling back to two consecutive increasing non-zero positions) and are no longer cancelled early by a zero position/leftover progress; on the cutover path 1x is reset during the ad and the user's rate is restored afterwards. - Others: the feed pool releases the old player first when the same index switches source; the QoE session accumulator is cleared on each
open(); a playlistjumpTodiscards stale results when interleaved; preview thumbnails with a crop are not cached (otherwise a hit would show the whole sprite sheet), results of old requests are discarded after a source switch, and after a cutover commit the bubble resubscribes withrenderEpoch. - Known unfixed items are in
CLAUDE.md"full review leftovers" (PiP exit state not reset etc.).
- Seamless cutover: the warm-up timeout is now covered by an independent timer rather than progress events (
-
Fix: process native crash on Windows when pushing an opaque route (HE V10): the root cause is not in mova but a Flutter 3.47.0/3.47.1 engine bug - with Windows + Impeller, the default
ZoomPageTransitionsBuilderofMaterialPageRoutesnapshots the page (SnapshotWidget), and when the snapshot carries an external GPU texture (media_kit's DXGI shared handle texture) the player dereferences a null context inLayerTree::Flattenand the process exits with0xC0000005influtter_windows.dll(flutter/flutter#190774, fixed in Flutter 3.47.2). Pure media_kitVideowithout mova reproduces it too. mova-side workaround: on Windows the render surface ofMovaPlayeris wrapped inMovaSnapshotGuard(adds a layer withsupportsRasterization()==false, so a lenient snapshot falls back to ordinary painting); other platforms are unchanged. Release measurements: 6/6 crashes before the fix and the probe always crashed within 2 rounds; after the fix verification page V10A 20/20, V10 10/10, probe 20/20/20/30 rounds without crash. The real fix is for the host to upgrade to Flutter >= 3.47.2; alternatively turn off snapshotting for the transition in the theme (ZoomPageTransitionsBuilder(allowSnapshotting: false)). Added 8 regression tests (test/ui/snapshot_guard_test.dart). See the V10 section of the plan docdoc/plans/2026-10-23-host-ergonomics.md. -
Fix: VOD recovery retry lost the resume position (HE V6): retries after a stall timeout, an
open()exception and nativeEND_FILE(error)recovery now send the resume seek only after the first frame of this attempt lands, avoiding the seek being dropped when the load command has returned but the file is not ready. Same-content alternative addresses reuse the resume point and keep it across failures; live does not seek. Code regressions passed; Windows/Android re-tests pending. -
Fix: seamless-cutover warm-up changed the system volume by mistake (keepAlive plan Q13):
muteWhileWarmnow uses the optional player mute capability, and mpv only saves, rewrites and restores its ownmute; warm-up and commit never write the system volume port. Kernels that do not support the capability do not mute; when combined with keepAlive mute each restores exactly by its own ownership. A failed mute restore goes through the abandon-cutover policy and emits an error event. Code regressions passed; device audio confirmation pending. -
Host ergonomics (batch 1,
doc/plans/2026-10-23-host-ergonomics.mdTask 1-8) - all off by default or identical to old behavior:- "Picture shown" signal: added
MovaState.rendered(the current source has presented its first frame / first audio, reset on eachopen()) and theMovaFirstFrame(sinceOpen, signal)event (once peropen(), repeatable); the criterion is pure logic inMovaFirstFrameGate/MovaFirstFrameSignal(native RESTART is authoritative, fallbacks are the buffering falling edge / consecutive increasing positions / first size while paused; when native is working and a fallback signal arrives first it waits up to a 1.5s grace). Internal reloads (quality switch, back to live edge, time shift) do not resetrendered. Minor behavior change:open()now synchronously zeroesstate.width/height(previously it waited for the kernel to send null asynchronously), so the old picture's aspect ratio no longer leaks into the new source. - Native event subscription decoupled from QoE:
MovaMpvKernel(observeNativeEvents:)(followsobserveQoeSignalsby default, existing call sites unchanged);createMova(preciseFirstFrame:)(defaultfalse; whentrueit subscribes to native RESTART even without a reporter for a more precise first frame, at the cost of one mpv weak client per player). - Declarative fit mode:
Mova/createMovagained the initial-value parameterfit;MovaPlayer(fit:)applies it once on mount and afterwards only when the value changes (orapiis replaced), so a value chosen with the fit button is not overridden by unrelated rebuilds. - Built-in poster:
MovaPlayer(poster:, posterFade:); the poster sits inside thevideohanded to the UI kit (buffering spinner/error layer/controls draw above it), fades out oncerenderedand the picture size is known, covers again the moment the source changes; audio-only sources keep it permanently.MovaFeedPlayer(posterUntilFirstFrame:)(defaultfalse) covers the placeholder as a poster until the first frame. - Minimal UI kit
MovaMinimalUiKit(showBuffering:, showError:): only the picture with an optional spinner/error layer, no gesture layer and no bars;MovaThemegained nullablebufferingSize/bufferingStrokeWidth/bufferingColor(defaultnull= same as the old look). - Declarative widget
MovaView: just passsource; it creates/reuses/rebuilds (whenoptionschange)/disposes the player itself, pauses when the source becomesnull, open failures go toonOpenError(default handed toFlutterError.reportError); with aposterit enables the native first-frame subscription by default. AddedMovaSource.sameAs()(compares uri and type, ignores title);MovaSourcedeliberately does not override==. - Breaking change (compile time):
MovaEventissealed, so the new subclassMovaFirstFramemakes exhaustiveswitchstatements without adefaultbranch in host code fail to compile; add a branch ordefault. mova's own event translation already has adefaultand is unaffected.
- "Picture shown" signal: added
-
Host ergonomics (batch 2, same plan Task 9-15) - all off by default:
- Start/stall timeout and recovery
MovaOpts.recovery(MovaRecoveryOpts, defaultenabled: false): start timeout (default 10s), stall timeout (default 10s,nullturns it off),open()throws, nativeEND_FILE(error), live reaching its end (liveEndIsFailure). Decisions come from the injectableIMovaRecoveryPolicy(defaultMovaRetryThenFailover: retry once after 1s per address then switch to alternatives, give up when exhausted; alsoMovaFailoverOnly), producingMovaRecoveryDecision.retry/failover/giveUp. New eventsMovaPlayFailure(fail, action),MovaRecovered(attempts); on give-up it writesstate.error = MovaGiveUpError, emitsMovaErrorEventand pauses the kernel. Retry/switch is a kernel reload, not a new session (no interceptors, noMovaSourceChange, QoE session untouched). When off, no Timer is created and no new stream is subscribed, and anopen()failure is still thrown to the caller as before (MovaAdsrelies on it to distinguishopenThrew). - Multi-address fallback:
MovaSource(alternatives:),MovaSource.uris,MovaSource.pick()(cleans and dedups keeping order),MovaState.sourceIndex, theMovaFailover(from, to, uri)event.sameAs()now also compares alternative addresses (including order). Alternatives are used only whenrecovery.enabledand ignored when off. mova provides no sort/filter hook; the host sorts them. - Auto-pause guard
MovaAutoPauseand the pure logicMovaAutoPauseGate/MovaAutoPauseOpts(MovaHideReason/MovaLiveResume/MovaGuardAction);MovaView(autoPause:, routeObservers:). Covers scrolling out of the viewport, inactive tabs (TickerMode), covered by a route, and going to background;inactivedoes not pause but first snapshots the play intent; no pause in PiP/mini; live hidden for >= 3s goes back to the edge and plays. Uses only the Flutter SDK, no new dependencies. Note:routeObserversis a list, one observer per navigator - aNavigatorObservercannot be attached to two navigators at once. - Host test doubles
package:mova/testing.dart:MovaTestKernel,MovaTesting.useTestKernels()/reset()/lastKernel; once installedcreateMova()uses a programmable kernel with all platform ports as no-ops, so widget tests no longer needMediaKit.ensureInitialized. Not in the main barrel. - Breaking change (compile time):
MovaEventgained three more subclassesMovaPlayFailure,MovaRecovered,MovaFailover(4 in total with the previous batch'sMovaFirstFrame); exhaustiveswitchstatements without adefaultbranch in host code need a new branch.MovaOptsgained therecoverysection (with a default, so existing call sites are unaffected). - Verification page:
example/lib/main_host_ergonomics_verify.dart(for device verification, not yet run on a device).
- Start/stall timeout and recovery
-
Review fixes (11 items):
MovaState.playbackIntentis independent of the kernelplaying, so internal reloads and the watchdog follow the latest play intent; recovery binds to the accepted session and the failed attempt and keeps the resume point across failures; the auto-pause guard subscribes to state and rebinds the player, keeping the hidden period from before a config update; live resume, view loading and quality requests all validate async staleness. See the "Review fixes" section ofdoc/plans/2026-10-23-host-ergonomics.mdfor item-by-item notes. -
Low-power keepAlive (keepAlive,
doc/plans/2026-10-23-keep-alive-mode.mdTask 1-9) - off by default, and no line of it runs unless called:- Entry:
MovaAutoPauseOpts(hiddenMode: MovaHiddenMode.keepAlive)(handled automatically by the guard, defaultpause) and the imperativeIMovaKeepAlive.setKeepAlive(bool)(implemented byMova/MovaCutover;IMovaApiandIMovaKernelgain zero members, probe withis). Tuning inMovaOpts.keepAlive(MovaKeepAliveOpts:maxDurationdefault 30s,silentStreams,allowHlsdefault false,resumeTimeoutdefault 5s,liveResumeGracedefault 3s). - Mechanism: live with audio -> turn off video decoding and mute (
mute/vid, saved and restored as is, never touchingvolume/vo/wid/VideoController); no audio -> keep decoding and only mute; VOD, going to background, unknown media info, HLS (default) -> ordinary pause; falls back to pause automatically atmaxDuration. No network is saved; what is saved is decoding/rendering/battery. - State and events:
MovaState.keepAlivePhase(MovaKeepAlivePhase:off/holding/fallback/resuming),MovaKeepAliveChange(phase, reason, mode),MovaKeepAliveResume(elapsed, signal, from);MovaKeepAliveMode/MovaKeepAliveReason/MovaSilentKeepAlivebecome public along with them. - Resume timing:
MovaFirstFrameGate.arm(resume: true)accepts only native RESTART and a non-zero size and lands immediately;rendereddoes not move at all and noMovaFirstFrameis emitted. - Interaction with existing features: during keepAlive the watchdog does not run, ABR and automatic back-to-edge do not trigger, and a failure is deferred to a forced reopen on wake; an
open()source switch during a keepAlive request loads paused and tries keepAlive again after the first frame lands;setMini(true)/enterPip()wake first;MovaCutoverpasses through and applies keepAlive to the new player at commit; the poster covers instantly during keepAlive and resume;MovaTestKernelsupports keepAlive (hasAudio/fileFormat). - Breaking change (compile time):
MovaEventgainedMovaKeepAliveChangeandMovaKeepAliveResume, andMovaGuardActiongainedkeepAlive/wake; exhaustiveswitchstatements without adefaultbranch in host code need new branches. - Verification page:
example/lib/main_keep_alive_verify.dart(for device verification, not yet run on a device).
- Entry:
0.3.0 #
- QoE reporting enhancement:
IMovaReportercovers the four QoE metrics TTFF first-frame time, stall count and duration, fatal/non-fatal playback failure distinction, and session start/end (with four end reasons); addedMovaReportOpts(MovaOpts.report, defaultqoe: false, with the off-state event stream byte-identical to before). Signals prefer native libmpv capabilities (paused-for-cache/video-bitrate/cache-speed/dropped-frame count/log-prefix error classification), and two real bugs were fixed along the way: a session-boundary timing race inMova.open()and a native resource race inMovaMpvKernel.dispose().- Breaking changes:
MovaReportNamechanges from anenumto a const value class - there is no moreMovaReportName.values.byName();.indexis gone; call sites thatswitchon the name must switch on.value(String) instead, because Dart does not allow constant patterns on a type that overrides==.==/hashCodeare computed from.value,Map/Setkey usage and theIMovaApi.report(name, ...)signature are unchanged, and ordinary comparison call sites need no change.MovaErrorEventproduction moves fromtranslator.darttoMovaQoeCollector; withqoe: trueparamsgrows from{'error'}to{'error', 'fatal', 'code'}and non-fatal errors are downgraded tobatched(old behavior unchanged withqoe: false).
- Native mpv events (
PLAYBACK_RESTARTprecise first frame,END_FILEsession end reason) are subscribed by a self-builtdart:ffiweak client (mpv_create_weak_client); themedia_kitdependency stays at the pub.dev^1.2.6and no longer depends on a git commit, so it can be published normally. In debug it polls every 100ms and in release it uses native callbacks. Verified on Android and Windows; iOS/macOS not verified (silent fallback when the subscription fails). - QoE fixes (found after running on an Android device): the initial
falseofbufferingafter open is no longer taken as the first frame (atrue -> falsefalling edge plus a "two consecutive increasing position samples" fallback is needed);sessionEnd.stallMsis no longer accumulated twice (it was 2x the real value);watchedMsis not counted before the first frame lands. When the native RESTART subscription is working (newIMovaStatsProbe.nativeRestartAvailable), the first frame trusts only RESTART and ignores earlier but coarser buffering/position fallbacks.
- Breaking changes:
VideoControlleris now lazily created:MovaMpvKernelgainedlazyVideo(defaultfalse);createMova()and the defaultMovakernel uselazyVideo: trueand create theVideoControlleronly the first timerenderHandleis read (whenMovaPlayeris mounted). A controller that is created but never attached to the UI makes media_kit'sPlayer.dispose()wait forever (3/6 on Windows and 4/5 on Android hit the 8 second timeout on devices); with lazy creation, disposing an player that was created but never shown takes only a dozen milliseconds. The shadow player of seamless cutover readsrenderHandleonce after creation, so the picture pipeline still exists during warm-up. If the caller creates and injects aVideoControlleritself, it must ensure it is attached to the UI before disposing (see README "Known limitations").- Truncated-end judgment: with
qoe: true, a VOD session ending at EOF with a completion rate belowMovaReportOpts.truncatedBelow(default0.9,<=0turns it off) is no longer recorded asendedbut first emits a fatalMovaErrorEvent(code: truncated) and then recordsfailed; live has no duration and is judged truncated only when there are ffmpeg error logs within the 5 seconds beforeMovaDone. Fixes a network drop after the first frame / the server cutting the stream midway being misrecorded asended(Android device mid-stream cut re-test passed). - TLS strict verification switch:
createMova()/MovaMpvKernelgainedtlsVerify(defaultfalse, behavior unchanged) andtlsCaFile. When on, HTTPS streams with an expired/self-signed/hostname-mismatched certificate are rejected (stream error, sessionfailed), and HLS segments and AES keys are verified too. Android's slim libmpv uses mbedtls with no system trust store, so when enabling it you must also passtlsCaFile(PEM), otherwise all HTTPS fails; putting a self-signed certificate intotlsCaFiletrusts that certificate. Direct IP connections (such as127.0.0.1) do not compare the certificate hostname. The Android device local HTTPS matrix of 144 runs all matched expectations; iOS/macOS not verified. - Preview frame extractor fix:
MovaFrameExtractorno longer creates aVideoController(its initialization can never complete without a UI, andextracttimed out 5/5 on Android), and instead decodes withvid=auto+vo=null; before the first seek it waits for the duration to be ready, then pollsseeking/time-posto determine that the seek has landed before capturing.- Behavior change:
settleDelaychanges meaning from "a fixed wait after the seek" to "an extra wait after the seek lands", and its default drops from 250ms to 60ms; if you pass your own value explicitly, re-evaluate it under the new meaning.
- Behavior change:
0.2.0 #
- Slim libmpv integration: a lightweight binary replacement scheme (Android / Windows / iOS / macOS) that cuts size by about 50%.
- Feed immersive stream player enhancements: short-video swiping, preloading and Douyin-style UI kit customization.
- Fixed the
ensure()async callback type inference warning inMovaFeedPlayer. - Improved docs and integration patterns.
0.1.0 #
First release.
A Flutter video player plugin built on media_kit (libmpv/ffmpeg) with a self-built gesture and control layer, supporting VOD and live; it can be used as a standalone UI and deeply customized through the Plugin / Component / UiKit three-layer contract.
Core playback #
- Playback kernel wrapping:
IMovaApi(capability surface abstraction) +Mova(production implementation) +IMovaKernel(kernel abstraction; the only media_kit-dependent detail is contained inMovaMpvKernel). - Construct players with
createMova()(lib/src/platform_impl/wiring.dart), which wires the real brightness / PiP / orientation platform adapters; the bareMova()constructor defaults its platform ports to no-ops and is only meant for injecting fake ports in unit tests. - Quality: HLS master parsing, manual switching (position-preserving resume), automatic downshift on stalls (ABR).
- Fit modes
contain/cover/fill; lock/unlock against accidental touches + immersive; fullscreen picks landscape/portrait by the video aspect ratio, andIMovaApi.setOrientcan force landscape/portrait (independent of fullscreen). - Audio-only mode (
audioOnly):createMova(audioOnly: true)skips the video decoding pipeline entirely (noVideoController, no GPU texture registration), sorenderHandle/sizebecomenull/0x0and the UI layer needs no change (pass cover/lyrics etc. as a custom picture throughMovaPlayer.surface). Measured memory savings of about 2-2.7x (depending on the scenario).
Gestures and UI #
- Gesture layer: horizontal swipe for progress / double-tap seek / two-finger zoom with a HUD; left/right vertical swipes default to brightness / volume (aligned with mainstream players such as bilibili), freely remappable through the side-to-action mapping of
MovaGestureOpts(MovaGestureAction) or disabled for a side withMovaGestureAction.none. - Component tree / UI kit / patch three-layer contract: the
MovaComponenttree is produced byIMovaUiKit(defaultMovaDefaultUiKit) fromMovaState, with structure-level customization throughMovaPatch(replace/remove/insertAfter/add) without subclassing;MovaDefaultUiKit.assemblecan also be half-overridden through the three layersbuildPlaybackLayer/buildOperableLayer/buildPersistentLayer. MovaPlugincapability mixin: gives stateful componentsapi(a stable handle) andbind()(subscribe and auto-reclaim ondispose).- Strings and theme:
MovaStrs(default Simplified Chinese strings) andMovaTheme(default colors/sizes) are injected throughMovaOptsand can be replaced wholesale. - System volume port
IMovaVolume: right-side swipe can drive the system media volume instead of only the player volume; Android wires the nativeMovaSystemVolumeby default and other platforms can passMovaCallbackVolumeto take over. - Rendering performance: the playback / operable / persistent layers are each isolated by a
RepaintBoundaryso they do not repaint each other.
Live features #
- The VOD and live control bars adapt and are merged into
MovaBottomBarComponent. - Live time shift: two draggable modes
MovaLiveSeekMode.dvr/.timeshift, configurable throughMovaLiveOpts.urlBuilder/backToLive/autoBackToLiveOnStall/windowResolver;MovaState.timeshiftBehindworks with theMovaTimeShiftChange/MovaLiveEdgeReachevents, andIMovaApi.backToLiveEdge()executes by policy. IMovaApi.pipSupported/MovaState.pipSupported: the PiP button hides automatically on unsupported platforms.
Picture-in-picture / in-app mini window #
- Android system PiP (
IMovaApi.enterPip()); iOS/desktop not yet supported (with libmpv texture rendering, system PiP depends on an AVPlayer path that is not implemented, andpipSupportedreturnsfalse). - In-app mini window
MovaMini: no system PiP API needed, the picture shrinks from the page into a draggable floating mini window without re-decoding or black frames. Off by default (zero behavior change on the whole path whileMovaMiniOpts.enabledisfalse). Two mounting styles coexist:MovaMini.showInPage(floating inside the page) andMovaMini.show+MovaMiniHost(persistent across routes). Supports edge snapping / clamping / safe-area avoidance and fling-to-close with inertia. Mutually exclusive with system PiP (entering the mini window first leaves system PiP and vice versa).
Scrub preview thumbnails #
- While dragging the progress bar or horizontal-swipe seeking, a thumbnail bubble of the target moment is shown above the progress bar (
MovaPreviewComponent). - Thumbnail sources in order: server-side WebVTT sprite sheet (
<video-url>.vtt, supports#xywhcropping) -> libmpv hiddenPlayerframe-extraction fallback; the source chain can be replaced wholesale throughMovaPreviewOpts.sources. - Two-level memory + disk cache; the network policy defaults to
wifiOnly(decided by aconnectivity_plusprobe; unknown connections and desktop are always allowed), and when blocked it silently makes no request and emits aMovaPreviewBlockevent. - The defaults of
extractor/probeincreateMova()arenull(to avoid statically reachingmedia_kit_video/connectivity_plusby default, which helps tree-shaking). To enable the frame-extraction fallback and thewifiOnlynetwork policy, passextractor: MovaFrameExtractor()/probe: MovaConnectivityNetProbe()explicitly; withoutprobethe kernel falls back to the pure-DartMovaAlwaysAllowNetProbe()and thewifiOnlypolicy is not enforced (other network policies are unaffected).
Ad orchestration #
MovaAdsplays ads with real business timing: the content source can be resolved lazily (loadDeferred(MovaSourceResolver)), and ad slotduration/delayare decoupled from the asset timeline (driven uniformly by aTimer, without querying/depending onstate.durationand without tail seeks).- Whether to wait for readiness is decided by ad slot kind (
IMovaAdWaitPolicy, built-inMovaAdWaitByKinddefaulting topreno /midyes /postno), with three override layers collected inMovaAdOpts.waitsFor(). - Ad load failure fallback:
IMovaAdFailPolicy(built-inMovaAdRetrySkip/MovaAdAbandonPod) handles open failures, player errors, no-first-frame timeouts and warm-up-not-ready uniformly. - Waiting/seamless cutover requires the host to also wire the
MovaCutoverof the next section and enableMovaCutoverOpts.enabled, otherwise it degrades to the traditional "cut at the due time" behavior.
Seamless cutover (optional) #
MovaCutover: a proxy layer that itself implementsIMovaApi, holding the effective player and a warming shadow player and switching the pointer atomically once ready, turning "back to content after the ad" from a black screen/loading into a frame-seamless cutover. DefaultMovaCutoverOpts.enabled: false, and when off it is a pure pass-through proxy with the same behavior as not wiring it.MovaState.renderEpochincrements after a cutover to trigger the render surface to re-readrenderHandle.- Two pluggable layers: warm-up trigger strategy (
IMovaWarmTrigger:MovaLeadWarm/MovaEagerWarm) and readiness criterion (IMovaWarmPolicy:MovaBufferWarm);MovaWarmPlancan be configured per warm-up direction. - Known limitations: quality switching (
switchQuality) and the feed player pool are not wired into seamless cutover - the former already goes through the safe registered-resume path but has not been verified through seamless cutover itself, and the latter is structurally not applicable (it needs two pictures coexisting).
Dependencies #
media_kit/media_kit_video/media_kit_libs_video: playback kernel.path_provider: disk cache directory for scrub preview.connectivity_plus: probe for thewifiOnlynetwork policy of scrub preview.screen_brightness: system brightness port for the brightness gesture.
Known limitations #
- iOS system PiP is not implemented (see above).
switchQualityis not yet wired into seamless cutover (see the "Seamless cutover" section above).MovaAudioUiKit(a UI kit dedicated to cover/lyrics/waveform) is not provided; for audio-only scenarios pass a placeholder picture yourself throughMovaPlayer.surface.
0.0.1 #
- Initial scaffold.