Swiftpack.co - SergioEstevao/SVEVideoUI as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by SergioEstevao.
SergioEstevao/SVEVideoUI 0.3.2
A video component for SwiftUI
⭐️ 39
🕓 2 years ago
iOS macOS
.package(url: "https://github.com/SergioEstevao/SVEVideoUI.git", from: "0.3.2")

SVEVideoUI

SVEVideoUI provides SwiftUI view that diplays videos.

Screenshot

Installation

SVEVideoUI is available through Swift Package Manager. To install it, simply add the following line to your Package.swit:

dependencies: [
.package(url: "https://github.com/SergioEstevao/SVEVideoUI.git", from: "0.4.0")
]

Usage

To use the video player do the following:

import SVEVideoUI
struct VideoPlayerView: View {
    var videoURL = Bundle.main.url(forResource: "video", withExtension: "mp4")!    

    var body: some View {        
            Video(url: videoURL)                            
    }
}

If you want to start the video at specific seconds

Video(url: videoURL, startVideoAtSeconds: 15.5)

If you want to mute the sound on the video you just need to do

Video(url: videoURL).isMuted(true)

And to hide the video controls

Video(url: videoURL).playbackControls(true)

To loop the video

Video(url: videoURL).loop(true)

Sample Project

To run the example project, clone the repo, and open the SVEVideoUI.xcproject file

Requirements

  • AVFoundation
  • XCode 11 or above
  • iOS 13 or above
  • macOS 10.15 or above

Getting in Touch

If you have questions about getting setup or just want to say hi, just drop an issue on Github with your request.

Author

Sérgio Estêvão

License

SVEVideoUI is available under the MIT license. See the LICENSE file for more info.

GitHub

link
Stars: 39
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics