AWS의 이미지 URL 또는 AWS의 비디오 URL에서 생성 된 미리보기 이미지를 포함하도록 UIImage를 설정하는 tableview가 있습니다. 비디오 URL이 내 tableview에 표시하는 것을 거부하고 디버거에서이 오류를 발생시킵니다. 스위프트 4 - AVPlayerViewController의 백엔드에서 AWS 비디오 URL을 표시하려고 시도 중입니다. 이상한 오류가 발생합니다.
2017-12-29 12:20:37.053337-0800 VideoFit[3541:1366125] CredStore - performQuery - Error copying matching creds. Error=-25300, query={
class = inet;
"m_Limit" = "m_LimitAll";
"r_Attributes" = 1;
sync = syna;
}
나도 이미지 또는 비디오의 URL이 올바르게 비디오 플레이어에 segues 후 나는 다시 오류 및 삼각 시작 버튼이 아니오 있다는 것을 의미하지 그것을 통해 선이 표시 셀을 클릭
재생할 비디오.하지만 그게 문제가되지 않습니다 그래서 성공적으로 통과 한 URL을 인쇄 할 때, 문제는 AVPlayer를 어떤 이유로 내 AWS 동영상 URL을 처리 할 수있다. 그게 안전해야 함을 의미하지만 난 이미 사실
다음<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
내 임의의 부하를 설정 일부 한 VideoPlayer VC에서 내 동영상을 표시하는 코드와 썸네일 생성 기능, 그래서 그것은 아마도, HTTPS 링크입니다 이것들과 관련하여 어떤 문제가 있습니까?
import UIKit
import AVKit
import MediaPlayer
class VideoPlayerVC: AVPlayerViewController {
var urlToPlay: String?
override func viewDidLoad() {
super.viewDidLoad()
print("Here is the url ---> \(String(describing: urlToPlay))")
playVideo()
}
private func playVideo() {
guard let urlFromString = urlToPlay else { print("No url to play") ;return }
let url = URL(string: urlFromString)
print("Here is the url to play ---> \(String(describing: url))")
let asset: AVURLAsset = AVURLAsset(url: url!)
let item: AVPlayerItem = AVPlayerItem(asset: asset)
let player: AVPlayer = AVPlayer(playerItem: item)
self.player = player
self.showsPlaybackControls = true
self.player?.play()
}
}
이 내 cellforRow의 atIndexPath 방법이가있는 tableview의 모든 비디오 개체에 대해이 오류가 발생합니다 실행할 때 나는 축소판을 만드는 방법이다.
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if let cell = tableView.dequeueReusableCell(withIdentifier: "sortedExerciseCell") as? SortedExerciseCell! {
// Do if check for videoURI and imageURI
if selectedExerciseArray[indexPath.row].imageURI != nil {
if let imageURI = URL(string: selectedExerciseArray[indexPath.row].imageURI!) {
print("It's a photo!")
// Using DispatchQueue.global(qos: .background).async loads cells in background
DispatchQueue.global(qos: .background).async {
let data = try? Data(contentsOf: imageURI)
DispatchQueue.main.async {
cell.exerciseImg.image = UIImage(data: data!)
}
}
}
} else {
if let videoURI = URL(string: selectedExerciseArray[indexPath.row].videoURI!) {
print("It's a video!")
print(videoURI)
DispatchQueue.global(qos: .background).async {
DispatchQueue.main.async {
cell.exerciseImg.image = self.thumbnailForVideoAtURL(url: videoURI)
// for every video object the above error is thrown!!!
}
}
}
}
cell.exerciseName.text = selectedExerciseArray[indexPath.row].name
return cell
} else {
return UITableViewCell()
}
}
// Used to just display the video thumbnail in cell, when clicked on will display video as needed
private func thumbnailForVideoAtURL(url: URL) -> UIImage? {
let asset = AVAsset(url: url)
let assetImageGenerator = AVAssetImageGenerator(asset: asset)
do {
print("Doing the video thumbnail from backend")
let imageRef = try assetImageGenerator.copyCGImage(at: CMTimeMake(1, 60) , actualTime: nil)
return UIImage(cgImage: imageRef)
} catch {
print("This is failing for some reason")
print("error")
return nil
}
}
대부분은 고정 또는 할 수없는 아이폰 OS (11) 버그가 그것을 백분, 나는 이것에 대해 스택 오버 플로우에 비슷한 질문을 검토 한하지만 아무도이 문제를 해결하는 방법에 대한 완전한 해답을 제공하기 위해 보이지 않는다 전송 보안 (이미 임의의로드가있어 문제가 될 수는 없습니다.) 다른 누구나 접근 할 수있는 접근법이 있습니까?
중요 - 내 백엔드 개발자는, 웹 페이지에서 비디오 URL을 볼 수 있습니다 즉 그는 웹에서 다운로드 후 비디오를 표시하는 기본 웹 사이트를해야합니다. 이것이 AWS에서 비디오 URL을 처리하는 표준 절차인지 확실하지 않지만 WKUIDelegate를 준수하는 사용자 정의 UIViewController에서 "loadHTMLString"이라는 URL을로드하려고 결정했지만 비디오는 볼 수 있지만 삼각형 시작 버튼이 넘어져 비디오를 재생할 수 없음을 의미합니다. 나는이 순간에 내가 시도 할 수있는 것이 무엇인지 잘 모르겠다. 어떤 도움도 감사 할 만하다.
내 백엔드에서 가져온 링크 중 하나입니다. 는 https://videofitapptestbucket.s3.us-west-2.amazonaws.com/100001427750
실제 동영상 링크를 게시하는 것이 좋습니다. –
나는 나의 포스트를 편집했다, 여기에 URL이있다 : https://videofitapptestbucket.s3.us-west-2.amazonaws.com/100001427750 – Jumpman987
URL은 확장자가 없다 –