mirror of
https://github.com/zoriya/react-native-video.git
synced 2025-12-06 07:16:12 +00:00
30 lines
703 B
Swift
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)
|
|
}
|
|
}
|