Import Video into iOS simulator

Source: Internet
Author: User

In the development of a project, because the project needs to import video, this test in the Simulater encountered trouble, because in Simulater, there is no video, only a few pictures, but on the real machine test, I was idle trouble, so, Directly write a simple video into the demo in Simulater.

The source code is as follows:

#import "ViewController.h" @interface Viewcontroller () @end @implementation viewcontroller-(void) viewdidload {    [ Super Viewdidload];        Nsarray *videos = [[NSBundle mainbundle] pathsforresourcesoftype:@ "M4V" indirectory:nil];    For (ID item in videos) {        uisavevideoatpathtosavedphotosalbum (item, Self, @selector (video: Didfinishsavingwitherror:contextinfo:), nil);}    } -(void) Video: (NSString *) Videopath didfinishsavingwitherror: (nserror *) error ContextInfo: (void *) ContextInfo {    if (Error! = nil) {        NSLog (@ "%@", error);    } else {        NSLog (@ "copy video succeeded");}    } -(void) didreceivememorywarning {    [Super didreceivememorywarning];} @end

Demo's github address: Https://github.com/are1/CopyVideoToSimulater

Import Video into iOS simulator

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.