Files
react-native-video/ios/hybrids/VideoPlayerSource/HybridVideoPlayerSourceFactory.swift
2025-10-12 17:21:22 +02:00

30 lines
703 B
Swift

//
// HybridVideoPlayerSourceFactory.swift
// ReactNativeVideo
//
// Created by Krzysztof Moch on 23/09/2024.
//
import Foundation
class HybridVideoPlayerSourceFactory: HybridVideoPlayerSourceFactorySpec {
func fromVideoConfig(config: NativeVideoConfig) throws
-> any HybridVideoPlayerSourceSpec
{
return try HybridVideoPlayerSource(config: config)
}
func fromUri(uri: String) throws -> HybridVideoPlayerSourceSpec {
let config = NativeVideoConfig(
uri: uri,
externalSubtitles: nil,
drm: nil,
headers: nil,
bufferConfig: nil,
metadata: nil,
initializeOnCreation: true
)
return try HybridVideoPlayerSource(config: config)
}
}