Releases: swiftuiux/swiftui-loop-videoPlayer
SwiftUI video player
New Features and Enhancements:
-
Volume Control:
- Introduced the
volume(Float)
command to adjust the video playback volume. The volume parameter is aFloat
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.
- Introduced the
-
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, ornil
to disable them, enhancing the accessibility of video playback.
- Added the
-
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.
- Implemented the
-
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.
- Introduced the
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
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
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
Code improvements
SwiftUI loop video player
Video from URL or Local file
SwiftUI loop video player
Fixed: Cannot dynamically update FileName
SwiftUI loop video player
Code improvements
SwiftUI loop video player
Added support for macOS and tvOS
SwiftUI loop video player
Added new settings for error template to customize
Added new error cases handling
SwiftUI loop video player
Adding settings in a declarative way