Releases: swiftuiux/swiftui-loop-videoPlayer
Releases · swiftuiux/swiftui-loop-videoPlayer
SwiftUI video player
SwiftUI video player
Enhancements
- Code Optimization: Implemented several optimizations to improve the performance and responsiveness of the video player. These improvements contribute to a smoother user experience and more efficient memory management.
SwiftUI video player
Release Notes for Version 1.7.4
New Features
- Playback Commands:
- Added a new
idle
command to the playback options. This command allows the video player to start without any immediate actions, waiting for explicit user commands post-initialization. Useful in scenarios where a video should not play automatically based on specific settings, and the initial command is set to.idle
.
- Added a new
Updated Settings
- Mute: The mute setting can now be configured to play the video without sound. Default is
false
. - NotAutoPlay: Updated the not autoplay setting to ensure the video does not automatically play upon initialization, aligning with scenarios where user interaction or specific conditions should dictate playback start. This is especially relevant when using the
idle
command as the control flow for the player's initial state. Default isfalse
.
SwiftUI video player
Release Notes 1.7.3
New Features
-
Settings Update:
ErrorWidgetOff
: A new setting that allows users to disable the default inner error showcase component. This is useful if you prefer to implement your own custom error alert widget.
-
Player Events:
error(VPErrors)
: Enhanced error handling within the player. This event now provides aVPErrors
enum value, which indicates the specific type of error encountered, improving diagnostics and error tracking.
UI Tests
- Refactored existing UI tests for increased reliability and performance.
- Improved the test coverage for new settings and error handling mechanisms.
Code Refactoring
- Undertook significant code refactoring to improve readability and maintainability.
- Optimized performance through better resource management and streamlined execution paths.
SwiftUI video player
Release Notes: Version 1.7.1
New Features
- New Playback State Events: We've expanded our player events to enhance monitoring and interaction with the playback states:
paused
: Alerts when playback is paused.waitingToPlayAtSpecifiedRate
: Notifies when playback is waiting to start due to buffering or other delays.playing
: Indicates active media playback.currentItemChanged
: Reports when a new media item is loaded.currentItemRemoved
: Occurs when the current media item is removed.volumeChanged
: Reports changes to the player's volume.
Improvements
- Batch Event Processing: To manage the high volume of event notifications more efficiently, especially in environments with dynamic content, we now collect all relevant player events within a one-second window and process them as a batch. This new approach helps maintain the order of events and reduces the processing overhead in high-frequency situations.
Developer Impact
- Enhanced Event Handling: Developers can now hook into these batched events through our updated API, allowing for more controlled and scalable event management within applications. This change is crucial for applications dealing with high volumes of media interactions or in scenarios where precise synchronization between the player state and application state is critical.
SwiftUI video player
Release Notes for Version 1.7
New Features
- Loop Setting: Added a new option to configure whether the video should automatically restart when it reaches the end. This setting enhances user control over video playback, providing a seamless viewing experience for continuous loop enthusiasts. If not explicitly enabled, videos will not loop by default.
Improvements
- Performance Enhancements: Implemented significant code refactoring to optimize application performance.
Bug Fixes
SwiftUI video player
Release Notes - Version 1.6.15
Key Updates
New Features:
- Added the ability to configure the player to start emitting or publishing the current playback time of the video. This can be achieved by passing the new
TimePublishing
parameter during initialization. You can specify a custom interval or use the default setting for time publishing.
Improvements:
- Refactored the codebase to improve overall performance and efficiency. These optimizations enhance the responsiveness and stability of the player during video playback.
SwiftUI video player
Release Notes - Version 1.6.14
Key Updates
Enhanced Resource Management in Player Deinitialization
I have implemented significant refinements in the management and release of resources during the deinitialization process of the video playback components. These enhancements focus particularly on the use of Apple's AVPlayerLooper
and its management of underlying player queues, which are essential for looping media content.
Detailed Improvements
-
Refined Cleanup Logic:
- Resource Release: I have enhanced the cleanup procedure in the deinitialization phase of the media player. All resources related to media playback, especially those managed by
AVPlayerLooper
, are now thoroughly released. This approach helps prevent memory leaks and ensures that all player items are properly discarded when no longer needed. - Queue Management: I addressed specific challenges associated with the sprite queue used by
AVPlayerLooper
for seamless media looping. My updated method more effectively clears this queue upon player deinitialization, ensuring no lingering sprites consume memory unnecessarily.
- Resource Release: I have enhanced the cleanup procedure in the deinitialization phase of the media player. All resources related to media playback, especially those managed by
-
Concurrency Considerations:
- Pre-Concurrency Support: The implementation now incorporates
@preconcurrency
annotations where necessary. This ensures compatibility with both modern and older Swift environments that do not utilize the latest concurrency features, maintaining robustness across various deployment scenarios. - Thread-Safe Deinitialization: I have enhanced the thread safety of the deinitialization process. This ensures that operations related to the cleanup of AVFoundation objects are executed on the correct threads, thus avoiding any potential race conditions or crashes.
- Pre-Concurrency Support: The implementation now incorporates
SwiftUI video player
I resolved the issue where compositions were not being applied consistently to all sprites when using FVPlayerLooper.
This update includes a code refactoring to enhance readability, maintainability, and performance.
SwiftUI video player
New Video Playback Commands
1. Brightness Adjustment
- Command:
brightness(Float)
- Description: Adjusts the brightness of the video playback. The
brightness
parameter accepts aFloat
value that ranges from -1.0 (darkest) to 1.0 (brightest). Input values outside this range are automatically adjusted to the closest valid value.
2. Contrast Adjustment
- Command:
contrast(Float)
- Description: Adjusts the contrast of the video playback. The
contrast
parameter can range from 0.0 (no contrast) to 4.0 (high contrast). Values beyond this range will be clamped to ensure proper contrast levels.
3. Filter Application
- Command:
filter(CIFilter, clear: Bool)
- Description: Applies a specified Core Image filter to the video. The
clear
parameter allows users to either clear all existing filters (iftrue
) before applying the new filter or to add the new filter to the current stack (iffalse
).
4. Remove All Filters
- Command:
removeAllFilters
- Description: Removes all filters currently applied to the video, returning the playback to its original state.
5. Audio Track Selection
- Command:
audioTrack(String)
- Description: Selects a specific audio track for the video playback based on its language code. For example, passing "en" will switch the audio track to English.