fastpix_flutter_core_data 2.0.0
fastpix_flutter_core_data: ^2.0.0 copied to clipboard
A comprehensive Flutter SDK for video player analytics and event tracking, designed to provide detailed insights into video playback behavior and user engagement metrics.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
2.0.0 - 2026-05-22 #
A major release with significant architectural changes. This release contains breaking API changes — see the Breaking Changes section below for the migration steps.
Added #
- SQLite-backed
EventStorefor disk-persisted event queueing so events survive process death and slow networks. SubmissionPipelinethat builds and dispatches events strictly in submission order, eliminating race conditions between fast follow-up events (e.g.pause→seeking→seeked).ScalingTrackerfor time-weighted video scaling analytics (up-scale / down-scale durations and percentages).- Request-level events:
requestCompleted,requestCanceled,requestFailedfor HTTP/segment-fetch instrumentation. - App lifecycle handling: automatic background flushing and
viewCompletedemission on app kill. - Independent view and player sequence counters so cross-counter ordering matches the wire-format spec.
- Exponential backoff for failed event deliveries.
- Synchronous playhead polling pattern — hosts cache the playhead and the SDK reads it synchronously, avoiding platform-channel deadlocks during codec init.
- Enhanced
MetricsLoggerwith ANSI color coding and debug trace points (dispatch:received,process:start, etc.). - Comprehensive example app for Android and iOS demonstrating BetterPlayer integration.
- New
VariantChangedEventfield-level fallback: whenChangeTrackis missing or contains placeholder'0'/empty values (e.g. from BetterPlayer's HLS-parser defaults), the SDK now falls back to thePlayerObserverforvideoSourceWidth,videoSourceHeight,mimeType,frameRate, andbitrate. - Expanded
PlayerObserverinterface with:playerHeight,playerWidth,videoSourceWidth,videoSourceHeight,playHeadTime,mimeType,sourceFps,sourceAdvertisedBitrate,sourceAdvertiseFrameRate,sourceDuration,isPause,isAutoPlay,preLoad,isBuffering,playerCodec,sourceHostName,isLive,sourceUrl,isFullScreen,getPlayerError,getVideoCodec,getSoftwareName,getSoftwareVersion. - Expanded
VideoDatawithvideoCDN,videoDrmType,videoSeries,videoProducer,videoContentType,videoVariant,videoLanguage,fpPlaybackId,foMediaId,fpLiveStreamId.
Changed #
PlayerObserveris now anabstract interface class(formerly a mixin). Hosts mustimplementit and provide every getter.FastPixMetricsBuilderAPI: replaces the per-field setters onFastPixMetrics.builder(). The new builder takes aMetricsConfigurationobject and aPlayerObserverinstance.CustomDatais now a single object withcustomField1–customField10(formerly aList<CustomData>with avaluefield).MetricsConfiguration.customDatais nowCustomData?(singular) instead ofList<CustomData>?.- Repository and homepage URLs updated to the
fastpix.comdomain.
Breaking Changes #
Migrating from 1.x to 2.0.0:
- Implement
PlayerObserveron your host player class. Every getter must return real data from your player. See README for the full interface and a BetterPlayer reference implementation. - Replace the old builder with the new one:
// Before (1.x) final metrics = FastPixMetrics.builder() .setWorkSpaceId('ws') .setBeaconUrl('https://beacon') .setViewerId('v1') .build(); // After (2.0.0) final metrics = FastPixMetricsBuilder() .setPlayerObserver(myPlayerObserver) .setMetricsConfiguration(MetricsConfiguration( workspaceId: 'ws', beaconUrl: 'https://beacon', viewerId: 'v1', )) .build(); - Update
CustomDatausage — pass a single object with named fields:// Before (1.x) final customData = [CustomData(value: 'movie'), CustomData(value: 'action')]; // After (2.0.0) final customData = CustomData( 'movie', // customField1 'action', // customField2 // ...customField3..10 ); - Cache the playhead in your host and return it synchronously from
PlayerObserver.playHeadTime(). The SDK no longer awaits the platform channel during event dispatch.
Fixed #
_handleChangedTrackEventpreviously poisonedChangeTrackwith placeholder zeros/empty strings on the BetterPlayer init-timedefaultTrackdispatch, masking real values on subsequent events. Subsequent event builds now coalesce empty/'0'track values to the observer fallback.
1.0.1 - 2025-08-29 #
Added #
- Exposed Error model import via the library entrypoint, allowing direct access without separate imports.
1.0.0 - 2025-08-28 #
Added #
- Initial release of the Flutter Core SDK
- Core functionality:
- Video playback event tracking and analytics
- Device information utilities and platform detection
- Network connectivity monitoring and status tracking
- Session management and lifecycle handling
- Event dispatching system with buffering capabilities
- Configuration management with flexible builder pattern
- Documentation files:
- Comprehensive README.md with setup instructions
- Usage examples and integration guides
- API reference documentation
- Contributing guidelines and development setup
- Basic project structure:
- Flutter package build system and configuration
- Pubspec.yaml with dependency management
- Test framework integration and example tests
- Code quality tools (lints, analysis options)
- CI/CD pipeline configuration (Azure Pipelines)
- SonarQube integration for code quality analysis