gif & video with swiftui

Hi everyone how are you ?

i am have project and i want add video and Gif how can that ?

My main goal is to embed a GIF/MP4 file in my project

i search in here and google but not see any thing

my code

import SwiftUI

struct ContentView: View {
    
    let allData = VideoAndGif()
    
    var body: some View {

        NavigationView {
            VStack {
                Text("This video1 \(allData.video1)")
                Text("This video2 \(allData.video2)")
                Text("This gif1 \(allData.gif1)")
                Text("This gif2 \(allData.gif2)")
  
            }
        }
    }
}

struct VideoAndGif {
    let video1 = "v1.mp4"
    let video2 = "v2.mp4"
    let gif1 = "g1.gif"
    let gif2 = "g2.gif"
}

struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
        ContentView()
    }
}

thank you

Sometimes asking the correct question gets you the correct result. The link above might help you.

Hi dracosveen
thank you for Response
i see it but is from link i want use it like this

var body: some View {
PlayerView(“video1.mp4”)
PlayerView(“video2.mp4”)
}

how can that ?

thank you :*

You need to add your videos as assets to your apop, same as adding an image.