How videos add to the camera roll
I know how images add to the camera roll,using
However, I don’t know how videos add to it.
I cannot search anymore.Please teach me!
I'm really estonished but this script works as I hoped 😂
# add a local video file to IOS photos from objc_util import * import threading PHPhotoLibrary = ObjCClass('PHPhotoLibrary') PHAssetChangeRequest = ObjCClass('PHAssetChangeRequest') def add_video(): lib = PHPhotoLibrary.sharedPhotoLibrary() url = nsurl('IMG_6294.MOV') # path to local video file def change_block(): req = PHAssetChangeRequest.creationRequestForAssetFromVideoAtFileURL_(url) def perform_changes(): lib.performChangesAndWait_error_(change_block, None) t = threading.Thread(target=perform_changes) t.start() t.join() if __name__ == '__main__': add_video()
Greaaat!Thanks a lot!😆
@yutashx Is it not what you asked?
@cvp I’m sorry. I’m not still used to using this forum. 😞
I resolved the problem thanks to you.
Thank you for giving me a great advice!😆