Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

iphone - Save Video to iPad Videos app -


i have been trying use uisavevideoatpathtosavedphotosalbum save video (stored locally within application). when try save it, error saying "operation failed because video file invalid , cannot played." file minute long , .mp4 file. don't have problem playing mpmovieplayer, won't save. here code:

nsstring *path = [[nsbundle mainbundle] pathforresource:@"videofile" oftype:@"mp4"]; uisavevideoatpathtosavedphotosalbum(path, self, @selector(status:didfinishsavingwitherror:contextinfo), nil); 

is method not designed work ipad? says "savedphotosalbum". mean have go through photos app view it, or name of method , in videos app? if me work out, appreciate it.

it should work long uivideoatpathiscompatiblewithsavedphotosalbum() returns true. however, i've had issue before , seemed have better luck creating , alassetslibrary object , using method:

- (void)writevideoatpathtosavedphotosalbum:(nsurl *)videopathurl completionblock:(alassetslibrarywritevideocompletionblock)completionblock 

i didn't try edit generic or 100% portable. grabbed code wrote saving videos give starting point using alassetlibrary instead:

- (void) savevideofile:(nsstring *)fullpathvideofile completiontarget:(id)thecompletiontarget action:(sel)thecompletionaction context:(id)thecontext     {     writefailed = no;      completiontarget = thecompletiontarget;     completionaction = thecompletionaction;     completioncontext = thecontext;      //  alassetslibrarywritevideocompletionblock     //     void (^completionblock)(nsurl *, nserror *) = ^(nsurl *asseturl, nserror *error)         {         if ( error != nil )             {             writefailed = yes;             }          writingtolibrary = no;          [self notifycompletiontarget];         };       // clean previous calls     //       if ( asseturl != nil )         {         [asseturl release];         asseturl = nil;         }      if ( assetfullpathname != nil )         {         [assetfullpathname release];         assetfullpathname = nil;         }      writingtolibrary = yes;       // make sure have file     //     if ( [[nsfilemanager defaultmanager] fileexistsatpath:fullpathvideofile] == no)         {         writingtolibrary = no;         writefailed = yes;         [self notifycompletiontarget];         return;         }       // set asseturl sending library     //     assetfullpathname = [[nsmutablestring alloc] initwithcapacity:(nsuinteger)1024];     [assetfullpathname setstring:fullpathvideofile];      asseturl = [[nsurl alloc] initfileurlwithpath:assetfullpathname isdirectory:no];       // use possible alternative method if method doesn't want work     //     if ( [library videoatpathiscompatiblewithsavedphotosalbum:asseturl]==no )         {         if ( uivideoatpathiscompatiblewithsavedphotosalbum( assetfullpathname ) )             {             uisavevideoatpathtosavedphotosalbum( assetfullpathname, self, @selector(video:didfinishsavingwitherror:contextinfo:), nil );             }         else             {             writingtolibrary = no;             writefailed = yes;             [self notifycompletiontarget];             }          return;         }       // write video library     //     [library writevideoatpathtosavedphotosalbum:asseturl completionblock:completionblock];     } 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -