Repository navigation
v1.6.3
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:
SharedPlayerManageris 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
MissingPluginExceptionor "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 toFlutterError.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_messagingstarts one as soon as
onBackgroundMessageis set. Every controller then logged
MissingPluginExceptionforlistenandcancelon
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:
activityStatestaysplayingafter an autoplayload().
load()overwrote theplayingthat native had already reported with
loaded. Android sends no further play event, so the state readloaded
for seconds while the video played. - Android: tapping the player's own fullscreen button no longer leaves a
black screen (#57). Dart mirrored the nativefullscreenChangeby
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 theAVPlayerViewControllerdelegate
both sentfullscreenChange, so control listeners got every
fullscreenEnteredandfullscreenExitedtwice. - No more
Error calling pause/dispose: NO_VIEWon dispose. The widget
usually unmounts before its controller is disposed, anddispose()still
sentpauseanddisposeto the view that was gone. Those calls are now
only made while a view is alive;disposeControllerreleases the native
player either way. - iOS: FairPlay generates a real SPC (#55). It is now built from the
application certificate and the HLSskd://content identifier, so
content key requests no longer fail when
AVContentKeyRequest.initializationDatais 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 theerrorstate, instead of loading until
the load watchdog fires. In the iOS Simulator, which has no FairPlay, this
replaces a crash (AVContentKeySessionthrew 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.
SharedPlayerManageris no longer a process-wideobjectbut 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.clearAllfrom aMainActivity) needs updating.