swiftui-loop-videoplayer

1.2.0

SwiftUI loop video player tips Swift looping video background iOS wallpaper hint tip tooltip
The-Igor/swiftui-loop-videoplayer

What's New

SwiftUI loop video player

2023-07-09T05:34:02Z

Added new settings for error template to customize
Added new error cases handling

SwiftUI loop video player

This package uses declarative approach to declare parameters for the video component based ob building blocks. This implementation might give you some insights how SwiftUI works under the hood. Also you can pass parameters in the common way.

How to use the package

1. Create LoopPlayerView

    LoopPlayerView(fileName: "swipe")    

or in a declarative way

   LoopPlayerView{
           Settings{
               FileName("swipe")
               Ext("mp4")
               Gravity(.resizeAspectFill)
               ErrorGroup{
                   EColor(.accentColor)
                   EFontSize(27)
               }
           }
       }   
      LoopPlayerView{
           Settings{
               FileName("swipe")
               Ext("mp4")
               Gravity(.resizeAspectFill)
               EFontSize(27)                  
           }
       } 

You can group error settings in group ErrorGroup or just pass all settings as a linear list of settings. You don't need to follow some specific order for settings, just pass in an arbitrary oder you are interested in. The only required setting is FileName.

Settings

Name Description Default
FileName("swipe") Name of the video to play -
Ext("mp4") Video extension "mp4"
Gravity(.resizeAspectFill) A structure that defines how a layer displays a player’s visual content within the layer’s bounds .resizeAspect
EColor(.accentColor) Error message text color .red
EFontSize(27) Size of the error text 17.0

SwiftUI example for the package

SwiftUI loop video player example

The concept

Documentation(API)

  • You need to have Xcode 13 installed in order to have access to Documentation Compiler (DocC)

  • Go to Product > Build Documentation or ⌃⇧⌘ D

XCode 15 beta note (iOS 17)

  • At the current time XCode 15 is in beta and in the console you might see message "A structure that defines how a layer displays a player’s visual content within the layer’s bounds" I found on Stack-overflow that many came across this message and at the time it is treated like XCode 15 beta bug

Description

  • Swift Tools 5.6.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sun Mar 17 2024 15:24:04 GMT-0900 (Hawaii-Aleutian Daylight Time)