Skip to content

v1.6.3

Choose a tag to compare

@DaniKemper010 DaniKemper010 released this 13 Oct 23:05
· 111 commits to master since this release
5476f20

A stability release. Android players now keep working in apps that run a second Flutter engine, iOS FairPlay is fixed, and fullscreen changes, autoplay state and the event channels report correctly again. The Dart API is unchanged.

Thanks to @xirf (#60), @ElKood-Sol (#57) and @sam-musicx (#55) for their contributions.

Upgrade notes

  • iOS apps that use Swift Package Manager need Flutter 3.44 or later. CocoaPods builds are not affected.
  • Android: SharedPlayerManager is now created per engine. This only matters for native app code that called the plugin's internal classes directly.

Added

  • FairPlay provider formats (#55): optional Base64 certificate/CKC
    decoding and a form-encoded SPC request, for providers such as
    DoveRunner. Binary stays the default.

Fixed

  • iOS: no more crash in VideoPlayerView.sendEvent
    (objc_release ← swift_release ← _Block_release). A queued event block
    retained the view, and a block created while the view was deallocating
    crashed when it was released. Events now hold a small sink instead of the
    view, player and notification callbacks run on the main thread, and a
    removed player no longer keeps calling into freed views (their KVO and
    time observers are removed first).
  • No more MissingPluginException or "No active stream to cancel" from
    the event channels.
    A listen or cancel on a per-view channel whose
    native handler is already gone (the view was disposed first) is now
    handled quietly instead of being reported to FlutterError.onError, and
    no subscription is made for a view that is already gone. Controllers that
    share an ID (the same video on two screens) share one controller-level
    event channel; only the last one to leave tears it down.
  • Android: players keep working when the app runs a second Flutter
    engine
    (#59, #60). firebase_messaging starts one as soon as
    onBackgroundMessage is set. Every controller then logged
    MissingPluginException for listen and cancel on
    native_video_player_controller_<id>, and when that engine was destroyed,
    it released the app's players, so playback stopped and every later
    controller's channel stayed broken. Controller channels, players and
    texture views now belong to the engine that created them.
  • Android: activityState stays playing after an autoplay load().
    load() overwrote the playing that native had already reported with
    loaded. Android sends no further play event, so the state read loaded
    for seconds while the video played.
  • Android: tapping the player's own fullscreen button no longer leaves a
    black screen
    (#57). Dart mirrored the native fullscreenChange by
    sending the command back, so one tap ran the transition twice and left a
    second, orphaned fullscreen dialog behind that only the back button could
    close. A fullscreen change the native player made itself (its fullscreen
    button, or Done on iOS) is now only mirrored in Dart, and control
    listeners receive it once.
  • iOS: a controller keeps reporting after one of its views goes away.
    Only the view that loaded the video observed the player. When a controller
    had several views and that one was removed, the others kept playing but
    sent no more position, buffering or play/pause updates to Dart. A
    remaining view now takes over observing the player.
  • iOS: enterFullScreen() / exitFullScreen() report the change once.
    The present/dismiss completion and the AVPlayerViewController delegate
    both sent fullscreenChange, so control listeners got every
    fullscreenEntered and fullscreenExited twice.
  • No more Error calling pause/dispose: NO_VIEW on dispose. The widget
    usually unmounts before its controller is disposed, and dispose() still
    sent pause and dispose to the view that was gone. Those calls are now
    only made while a view is alive; disposeController releases the native
    player either way.
  • iOS: FairPlay generates a real SPC (#55). It is now built from the
    application certificate and the HLS skd:// content identifier, so
    content key requests no longer fail when
    AVContentKeyRequest.initializationData is absent, and requests that
    arrive while the certificate is loading are queued.
  • iOS: a FairPlay configuration error fails load() right away. A
    missing license or certificate URL, or an unknown format option, now ends
    the load with that message and the error state, instead of loading until
    the load watchdog fires. In the iOS Simulator, which has no FairPlay, this
    replaces a crash (AVContentKeySession threw an Objective-C exception).

Changed

  • iOS Swift Package Manager: the package now depends on
    FlutterFramework
    , as Flutter 3.44+ asks of plugins (this removes the
    "missing a dependency on FlutterFramework" warning). Apps that use SwiftPM
    need Flutter 3.44 or later, where SwiftPM is on by default; before 3.44
    SwiftPM was opt-in, and CocoaPods builds are not affected.
  • Android: the plugin's native classes are per Flutter engine.
    SharedPlayerManager is no longer a process-wide object but one instance
    per plugin (engine), and the constructors of the internal view, backend
    and handler classes changed. The Dart API is unchanged; only app code
    that called these native internals directly (for example
    SharedPlayerManager.clearAll from a MainActivity) needs updating.