VoodooSpatialPlayer
is a Swift package for video streaming playback,.
Add VoodooSpatialPlayer
to your project via Swift Package Manager.
dependencies: [
.package(url: "https://github.com/StreamVoodoo/voodoo-spatial-player-sdk", from: "1.0.0")
]
Create a VoodooPlayer
instance and load a Stream
:
import VoodooSpatialPlayer
let player = VoodooPlayer(configuration: .default)
Use the .voodooPlayer()
modifier in your SwiftUI view:
import SwiftUI
struct ContentView: View {
@State private var player = VoodooPlayer()
var body: some View {
Button("Play Stream") {
try? player.load(userId: "UserId", streamId: "StreamId", showPreview: true)
}
.voodooPlayer(player)
}
}
player.play()
player.pause()