Skip to content

Releases: swiftuiux/swiftui-loop-videoPlayer

SwiftUI video player

12 Feb 11:31
Compare
Choose a tag to compare

Release Notes for 1.8.7

  • Configurable Event Mechanism
    You can now selectively enable or disable player events through the settings: VideoSettings parameter.

    • If Events is not passed in the settings: VideoSettings, the event mechanism is disabled, improving performance by preventing unnecessary @State updates.
    • If you need to handle events, specify only the ones you need Events([.durationAny, .itemStatusChangedAny]) or pass Events() to receive every available event.
  • Performance Enhancements
    By allowing granular control over which events are emitted, apps that don’t require real-time event handling will see fewer view updates and potentially lower CPU usage.

  • Example Implementation
    Refer to Video8.swift in the example app to see how to configure and handle this new, more efficient event system.

SwiftUI video player

07 Feb 09:38
Compare
Choose a tag to compare

Code improvements
Documentation

SwiftUI video player

06 Feb 16:40
Compare
Choose a tag to compare

Release Notes - Version 1.8.2

✅ Added Observation for AVPlayerItem.status

  • Now tracking media loading state in real-time.
  • Improved handling of playback readiness and errors.

✅ New Events for Improved Playback Tracking

  • itemStatusChanged(AVPlayerItem.Status)

    • Notifies when the AVPlayerItem status changes.
    • Possible statuses:
      • .unknown: The item is still loading or not yet determined.
      • .readyToPlay: The item is fully loaded and ready to play.
      • .failed: The item failed to load due to an error.
  • duration(CMTime)

    • Provides the total duration of the media item when it is ready to play.
    • Ensures the duration value is available before use.

Settings Update

Setting Description
PictureInPicture Enable Picture-in-Picture (PiP) support. If not passed, commands like startPiP and stopPiP will have no effect. Check the example app Video11.swift. Not supported on the simulator—requires a real device.

New Commands

Command Description
startPiP Initiates Picture-in-Picture (PiP) mode for video playback. If already active, this command has no effect. Make sure to enable PictureInPicture() in settings.
stopPiP Terminates Picture-in-Picture (PiP) mode, returning the video to inline playback. If PiP is not active, this command has no effect. Make sure to enable PictureInPicture() in settings.

New Events

Event Description
startedPiP Event triggered when Picture-in-Picture (PiP) mode starts.
stoppedPiP Event triggered when Picture-in-Picture (PiP) mode stops.
itemStatusChanged(AVPlayerItem.Status) Indicates that the AVPlayerItem's status has changed. Possible statuses: .unknown, .readyToPlay, .failed.
duration(CMTime) Provides the duration of the AVPlayerItem when it is ready to play. The duration is given in CMTime.

SwiftUI video player

10 Jan 11:28
Compare
Choose a tag to compare

Documentation
Code refactoring
Performance improvement

SwiftUI video player

09 Jan 08:59
Compare
Choose a tag to compare

Release Notes: Subtitles Feature

Here’s everything you need to know about the feature:


🎯 Settings

  • Subtitles File Support
    You can now merge subtitles into your video using a WebVTT (.vtt) file via the `Settings.
    • Provide the URL or local filename of the WebVTT file to integrate subtitles seamlessly.
    • Subtitles are processed through an AVMutableComposition approach, ensuring reliable integration.

📚 Example

Refer to the implementation in the example app file Video8.swift to understand how to utilize this functionality.


🔧 Command

  • subtitles(String?)
    • Use this command to set subtitles to a specific language or disable them entirely.
    • Pass a language code (e.g., "en" for English) to set subtitles.
    • Pass nil to turn subtitles off.

SwiftUI video player

28 Nov 13:20
Compare
Choose a tag to compare

Miner improvements
Documentation

SwiftUI video player

14 Sep 07:33
Compare
Choose a tag to compare

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

10 Sep 10:11
Compare
Choose a tag to compare

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.

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 is false.

SwiftUI video player

04 Sep 08:32
Compare
Choose a tag to compare

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 a VPErrors 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

19 Aug 17:04
Compare
Choose a tag to compare

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.