Skip to content

Releases: swiftuiux/swiftui-loop-videoPlayer

SwiftUI video player

18 Aug 06:18
Compare
Choose a tag to compare

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

15 Aug 13:11
Compare
Choose a tag to compare

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

14 Aug 10:57
Compare
Choose a tag to compare

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

  1. 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.
  2. 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.

SwiftUI video player

13 Aug 09:02
Compare
Choose a tag to compare

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

10 Aug 11:23
Compare
Choose a tag to compare

New Video Playback Commands

1. Brightness Adjustment

  • Command: brightness(Float)
  • Description: Adjusts the brightness of the video playback. The brightness parameter accepts a Float 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 (if true) before applying the new filter or to add the new filter to the current stack (if false).

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.

SwiftUI video player

09 Aug 09:18
Compare
Choose a tag to compare

New Features and Enhancements:

  • Volume Control:

    • Introduced the volume(Float) command to adjust the video playback volume. The volume parameter is a Float value ranging from 0.0 (mute) to 1.0 (full volume). If the value is outside this range, it will be clamped to the nearest valid value, ensuring consistent audio levels.
  • Subtitles Support:

    • Added the subtitles(String?) command, allowing users to set subtitles to a specified language or turn them off. Pass a language code (e.g., "en" for English) to activate subtitles, or nil to disable them, enhancing the accessibility of video playback.
  • Playback Speed Adjustment:

    • Implemented the playbackSpeed(Float) command to control the speed of video playback. The speed parameter can range from 0.5 (half speed) to 2.0 (double speed). Negative values are clamped to 0.0, ensuring smooth playback control.
  • Looping Control:

    • Introduced the loop command to enable looping of the video playback. Looping is enabled by default, so this command will have no effect if looping is already active.
    • Added the unloop command to disable looping of the video playback. This command will only take effect if the video is currently being looped, providing precise control over playback behavior.

Performance Improvements and Bug Fixes:

  • Enhanced Performance: Refactored the internal logic to optimize the handling of playback commands, improving overall responsiveness and reducing unnecessary operations.
  • Command Handling: Improved command processing by checking whether commands have changed before applying them, ensuring more efficient updates and minimizing redundant state changes.
  • Bug Fixes: Addressed several minor bugs to enhance the stability.

SwiftUI video player

08 Aug 09:30
Compare
Choose a tag to compare

In the latest release, I have implemented significant code optimizations to enhance the performance and functionality of the player. Previously, changing the video file would cause the entire player to de-initialize, leading to potential interruptions in playback. With the new update, the player now seamlessly updates the asset without de-initializing. This allows for a smoother transition and immediate playback of the new video source.

Additionally, I added support for VisionOS. This new feature enables our player to integrate seamlessly with VisionOS, providing an enhanced user experience on supported devices.

SwiftUI video player

07 Aug 16:01
Compare
Choose a tag to compare

Release Notes

In this release, playback commands have been added to enhance the control and functionality of the video player. Below is a summary of the new commands and their descriptions:

  • play: Command to play the video.
  • pause: Command to pause the video.
  • seek(to: Double): Command to seek to a specific time in the video.
  • begin: Command to position the video at the beginning.
  • end: Command to position the video at the end.
  • mute: Command to mute the video.
  • unmute: Command to unmute the video.

SwiftUI loop video player

07 Aug 07:55
Compare
Choose a tag to compare

Code improvements

SwiftUI loop video player

06 Aug 11:14
Compare
Choose a tag to compare

Video from URL or Local file