In this video you'll learn the essentials of video playback with AVKit using AVPlayerViewController.
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4033-beginning-video-with-avfoundation/lessons/2
In this video you'll learn the essentials of video playback with AVKit using AVPlayerViewController.
I cannot get any videos to play from a URL. The AVPlayerViewController appears but without the video.
Any suggestions? I have researched the issue but have not been able to find a solution.
Just tried to do this using Xcode 9… nothing works… it’s a horrible experience
I could fix some things… but am completely flummoxed by
func previewImageFromVideo(url: NSURL) → UIImage? {
let asset = AVAsset(url: url as URL)
Throws an error…
2017-09-24 17:07:38.661784+1000 QuickPlay[6342:1352041] CredStore - performQuery - Error copying matching creds. Error=-25300, query={
class = inet;
“m_Limit” = “m_LimitAll”;
“r_Attributes” = 1;
sync = syna;
}
Following some stack overflow articles I done this on the textfields…
textField.autocorrectionType = .no
textField.spellCheckingType = .no
Still nothing…
Pity - the course looks great - but it’s a very frustrating thing at the moment
Failed to build on the first updates for playVidoeClip method.
Any plans to update course to be compatible with at least Swift 3?
ha ha, you just need add transport permisstion in infor.plist like this
NSAppTransportSecurity
NSAllowsArbitraryLoads
Hey guys I found a fix on stack overflow:
Here’s the update in Swift 3.3
You need to do 2 things:
extension ViewController {
// https://stackoverflow.com/a/47343280/1492368
func checkPhotoPermission(handler: @escaping () -> Void) {
let photoAuthorizationStatus = PHPhotoLibrary.authorizationStatus()
switch photoAuthorizationStatus {
case .authorized:
// Access is already granted by user
handler()
case .notDetermined:
PHPhotoLibrary.requestAuthorization { (newStatus) in
if newStatus == PHAuthorizationStatus.authorized {
// Access is granted by user
handler()
}
}
default:
print("Error: no access to photo album.")
}
}
}
Love this series!
The code used to generate preview from assets doesn’t work in swift. Is there a work around. Cant find one myself