-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Related to issue number #39 #44
Comments
Sorry now I'm able to update the pod using |
Could you paste that youtube link? |
@marty-suzuki Hi Sorry for the late reply. And thanks for your reply :)
This is how I'm using your |
Would you try to add |
Added after removing the view but no change with it. but it was sometimes working in iPhone 5, not in other devices. |
that is wrong addtion. for view in cell.urlPreviewViewOutlet.subviews {
if let embeddedView = view as? URLEmbeddedView {
embeddedView.cancelLoad()
embeddedView.removeFromSuperview()
}
} |
Just now i tried that as well but not working :(
The code change is posted above. and I tried with the exact same code what u pasted also. Only for Youtube links we are facing this problem other than that most of the links are returning thumbnails and working fine |
embeddedView and view is not same instance in the code posted above, therefore that code is wrong. |
Not single URL. All youtube URL's are not loading its thumbnails. |
Sorry, i can not investigate without information such as url sample. |
@marty-suzuki thanks for your valuable time and replies. But the problem I'm facing is I have tried many of youtube links and no youtube links returned thumbnails for me. But these same returned once in iPhone 5 but not working always. Attaching some of the screenshots and URLs for your reference, please check and let me know what I'm doing wrong here. The attached screenshots are from the iPhone 6s plus and from the iPad Air. https://www.youtube.com/watch?v=C0DPdy98e4c |
I've recognized what is wrong. let extractedUrls = sosReplyComment.comment.extractURLs()
for extractedUrl in extractedUrls {
let url: URL
if extractedUrl.host?.contains("m.youtube.com") == true {
var components = URLComponents(string: extractedUrl.absoluteString)
components?.host = "www.youtube.com"
if let _url = components?.url {
url = _url
} else {
url = extractedUrl
}
} else {
url = extractedUrl
}
for view in cell.urlPreviewViewOutlet.subviews {
if let ev = view as? URLEmbeddedView {
ev.cancelLoad()
ev.removeFromSuperview()
}
}
let embeddedView = URLEmbeddedView()
embeddedView.loadURL(url.absoluteString)
embeddedView.borderColor = .clear
embeddedView.cornerRaidus = 0
embeddedView.frame = CGRect(x: 0, y:0, width: cell.frame.width - 20, height: 60)
embeddedView.didTapHandler = { [weak self] _, url in
guard let url = url else { return }
self?.present(SFSafariViewController(url: url), animated: true, completion: nil)
}
cell.urlPreviewViewOutlet.addSubview(embeddedView)
cell.urlViewHeightConstarint.constant = 61
break
} |
Thank you very much @marty-suzuki. I will update the code and let you know if its going somewhere wrong |
@marty-suzuki Thank you very much brother, for your library and support now its working awesome :) 💯 |
Hi, Suzuki Sorry to bother you again, How can I update to the specific version of the pod you specified in that bug number #39.
I tried updating to the latest version (0.12.0).
But it won't help for me because I'm using 8.3.3 and the pod is upgraded for Swift 4
The text was updated successfully, but these errors were encountered: