mirror of
https://github.com/cranci1/Sora.git
synced 2026-03-11 17:45:37 +00:00
Update VideoPlayer.swift
Some checks are pending
Build and Release IPA / Build IPA (push) Waiting to run
Some checks are pending
Build and Release IPA / Build IPA (push) Waiting to run
This commit is contained in:
parent
2d8fa4a706
commit
63d72399e0
1 changed files with 1 additions and 9 deletions
|
|
@ -33,15 +33,7 @@ class VideoPlayerViewController: UIViewController {
|
|||
return
|
||||
}
|
||||
|
||||
var request = URLRequest(url: url)
|
||||
if streamUrl.contains("ascdn") {
|
||||
request.addValue("\(module.metadata.baseUrl)", forHTTPHeaderField: "Referer")
|
||||
}
|
||||
|
||||
let asset = AVURLAsset(url: url, options: ["AVURLAssetHTTPHeaderFieldsKey": request.allHTTPHeaderFields ?? [:]])
|
||||
let playerItem = AVPlayerItem(asset: asset)
|
||||
|
||||
player = AVPlayer(playerItem: playerItem)
|
||||
player = AVPlayer(url: url)
|
||||
playerViewController = NormalPlayer()
|
||||
playerViewController?.player = player
|
||||
addPeriodicTimeObserver(fullURL: fullUrl)
|
||||
|
|
|
|||
Loading…
Reference in a new issue