Post not yet marked as solved
Hello,
I want to save the video file into a specific USER Album named "Cambox Album".
Actually only works into the default Album in recent assets with the true new name nameX.mov.
Below the code for define the PathDirectory :
func getDirectoryPath() -> String {
let nsDocumentDirectory = FileManager.SearchPathDirectory.documentDirectory
let paths = NSSearchPathForDirectoriesInDomains(nsDocumentDirectory, .userDomainMask, true)
let documentsDirectory = paths[0]
return documentsDirectory
}
with this code below, the video is automatically saved in the default user album.
func downloadVideo(urlVideo : URL! ) {
DispatchQueue.global(qos: .background).async {
if let url = urlVideo, let urlData = NSData(contentsOf: url) {
let galleryPath = self.getDirectoryPath()
let filePath = galleryPath + "/nameX.mov"
DispatchQueue.main.async {
urlData.write(toFile: filePath, atomically: true)
PHPhotoLibrary.shared().performChanges({
PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL:
URL(fileURLWithPath: filePath))
}) {success, error in
if success {
let alertController = UIAlertController(title: "Your video was successfully saved", message: nil, preferredStyle: .alert)
let defaultAction = UIAlertAction(title: "OK", style: .default, handler: nil )
alertController.addAction(defaultAction)
self.present(alertController, animated: true, completion: nil)
} else {
let alertController = UIAlertController(title: error?.localizedDescription, message: nil, preferredStyle: .alert)
let defaultAction = UIAlertAction(title: "ERROR !", style: .default, handler: nil)
alertController.addAction(defaultAction)
self.present(alertController, animated: true, completion: nil)
}
}
}
}
}
}
if I replace the line with the name of the album by :
let filePath = galleryPath + "/Cambox Album/nameX.mov"
nothing happened, I can't see the video anywhere !
is there anybody who can help me to resolve this issue please ?
Regards
Post not yet marked as solved
hey,
severals hours for searching a solution without success...
i want to save a URL video into a specific User Album and unfortunatly nothing happen !
if I define only the new name of the video (without the urlpath), I can find the video in the recent album !
anybody have an idea what 's happen ?
please see below example of my code
let galleryPath = self.getDirectoryPath()
print ("######### value of galleryPath : (String(describing: galleryPath))")
let filePath = galleryPath + "/nameX.mov"
print ("######### value of filePath : (String(describing: filePath))")
DispatchQueue.main.async {
urlData.write(toFile: filePath, atomically: true)
PHPhotoLibrary.shared().performChanges({
PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL:
URL(fileURLWithPath: filePath))
}) {
success, error in
if success {
print("Succesfully Saved")
} else {
print(error?.localizedDescription)
}
}
}
Many thanks for your help !
JM
Post not yet marked as solved
Hello,
I have a problem with my iOS application which displays video streaming via MobileVlcKit. this function has been available on my application for many months but, for a few days, I can't see the video stream in my application !
when I use the xCode simulator, the video stream is displayed correctly.
but, when i launch a local version or a version in testflight i get a black screen without my video stream flux !
when I run a local version via the USB cord, I see this message **** in the debugging console :
"Unable to determine our source address: This computer has an invalid IP address: 0.0.0.0"
can someone please help me?
Post not yet marked as solved
HI
My app use the UDP for Streaming Video from an action cam device.
After installing the new version 14.5, it's impossible to viewing the video into our APP.
we get this message
"Unable to determine our source address: This computer has an invalid IP address: 0.0.0.0"
and when we saw the Network Report, we can see that we received Bytes on the UDP but the local address and remote address are stil at 0.0.0.0
Any ideas what's happen please ?
best regards
Post not yet marked as solved
Hello !
i have some issues for extract datas from an HTTP request, please can you help me ??
1)I send a request for asking the datas from a local device :
language
http://192.168.2.1/data/
2) below the device send this result in xml
language
?xml version="1.0" encoding="UTF-8" ?
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
head
titleIndex of /data/100CAMBX//title
/head
body
h2Index of /data/100CAMBX//h2
div class="list"
table summary="Directory Listing" cellpadding="0" cellspacing="0"
thead
tr
th class="n"Name/th
th class="m"Last Modified/th
th class="s"Size/th
th class="t"Type/th
/tr
/thead
tbody
tr class="d"
td class="n"
a href="../"Parent Directory/a//td
td class="m" /td
td class="s"-  /td
td class="t"Directory/td
/tr
tr
td class="n"
a href="Video1.MOV"CMBX0007.MOV/a
/td
td class="m"2000-Jan-01 22:46:48/td
td class="s"1.5G/td
td class="t"video/quicktime/td
/tr
tr
td class="n"
a href="CMBX0009.MOV"CMBX0009.MOV/a
/td
td class="m"2000-Jan-13 08:28:24/td
td class="s"92.4M/td
td class="t"video/quicktime/td
/tr
tr
td class="n"
a href="CMBX0010.MOV"CMBX0010.MOV/a
/td
td class="m"2021-Mar-10 16:53:18/td
td class="s"1.8M/td
td class="t"video/quicktime/td
/tr
/tbody
/table
/div
div class="foot"lighttpd/1.4.41/div
/body
/html
3) i want to extract in this file theses 5 values integrate in the body
language
th class="n"Video1.MOV/th. //title of the video
th class="n"CMBX0007.MOV/th. // filename video
th class="m"2000-Jan-01 22:46:48/th //date&time
th class="s"1.5G/th // video size
th class="t"Type/th // video type
I need also to create an loop function for getting these 5 parameters for each videos files and store them in a structure.
everybody can help me please ?
Post not yet marked as solved
Hello,
we are sports action camera manufacturer, we have just successfully released our first iPhone app, cool !
we would now like to integrate a solution to make it easier for our customers to update the firmware of our camera.
the idea would be to integrate in the application a zipped document (containing 5 to 6 installation files for the new firmware of the camera).
I have no idea whether Apple accepts to embed files in the application with .bin .par and .dat extensions?
do you think this is possible?
do you think this is accepted when the application is submitted by apple?
Post not yet marked as solved
Hi,
i have some issues to get the values result of a CGI request GET from a camera device.
actually in safari when I paste the local link to my camera with this http request :
://X.X.X.X/cgi-bin/modelreqcgi?action=get
I get this result in safari :
version=1.1.8;model=cbv4pro;
so now I want to get the result and theses fields with her values, but unfortunately with my URL request I never see the values.
please see below my code :
struct ResponseScan: Decodable {
let versionScan: String
let modelScan: String
}
import UIKit
class ViewController: UIViewController {
		
		@IBOutlet weak var messageLabel: UILabel!
		
		@IBOutlet weak var UpdateProgress: UIProgressView!
		
		@IBOutlet weak var Radar: UIButton!
		
		@IBOutlet var UpdateProgressCollection: [UIProgressView]!
		
		
		//:: Action sur le bouton Scan :://
		@IBAction func RadarScan(_ sender: Any) {
		
				let urlScanType = "http://192.168.2.1/cgi-bin/model_req_cgi?action=get"
				
				if let urlScan = URL (string: urlScanType)
				{
						
			 var requestScan = URLRequest (url: urlScan)
						requestScan.httpMethod = "GET"
						
				URLSession.shared.dataTask(with: requestScan) { data, response, error in
						if let data = data {
								print("value de data -> \(String.data)")
								print("value de response -> \(response)")
								do{
										//let jsonData = data.data(using: .utf8)!
								let decoder = JSONDecoder ()
										let jsonData:	ResponseScan = try decoder.decode(ResponseScan.self, from: data)
								print("Version -> \(jsonData.versionScan)")
								print("Modèle -> \(jsonData.modelScan)")
								}
								catch{}
						}
				}.resume()
				print("Finish !!!!!!!!")
				
		}
}
	
is there anybody who can help me please ??
best regards