Discussion Forums  >  Audio, Video, Playing, Recording

Replies: 4    Views: 175

Rad Doc
Apple Fan
Profile
Posts: 653
Reg: Oct 08, 2010
USA, NYC
8,580
04/12/12 03:44 AM (12 years ago)

How do I loop a Video? IOS v1.5

Does anyone know how to perform a video loop? Ive searched endlessly and can not find anything in the forum. I need the video to continuously play until the user manually stops it. Can this be done. Please help.
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
04/12/12 12:35 PM (12 years ago)
Hi, can you email me your BT_viewControllerManager.m file, need to make some changes, if it works I'll post a tutorial :) Edit : posted code below, let me know how it goes :)
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
04/12/12 12:41 PM (12 years ago)
This loop seems to be working fine in simulator, here is the code Starts around line 330 in your BT_viewControllerManager.m you can see I commented around the code Start and End that I added to repeat the video // iPhone 3.2 > requires adding the movie players view as a subView as described here... //developer.apple.com/iphone/library/releasenotes/General/RN-iPhoneSDK-4_0/index.html if(escapedUrl != nil){ if([[[UIDevice currentDevice] systemVersion] doubleValue] >= 3.2) { //NSLog(@"Embedding video WITH subView.."); [BT_debugger showIt:self:[NSString stringWithFormat:@"Embedding video WITH subView..%@", @""]]; MPMoviePlayerViewController *moviePlayerController = [[MPMoviePlayerViewController alloc] initWithContentURL:escapedUrl]; //START THE REPEAT CODE moviePlayerController.moviePlayer.repeatMode = MPMovieRepeatModeOne; // END REPEAT CODE [moviePlayerController setModalTransitionStyle:UIModalTransitionStyleCrossDissolve]; [theNavController presentModalViewController:moviePlayerController animated:YES]; }else{ [BT_debugger showIt:self:[NSString stringWithFormat:@"Embedding video WITHOUT subView..%@", @""]]; //init moviePlayer...with iPhone OS 3.2 or earlier player MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:escapedUrl]; [theNavController.visibleViewController.view addSubview:[moviePlayer view]]; [moviePlayer play]; } } //bail return; }//end if video
 
Rad Doc
Apple Fan
Profile
Posts: 653
Reg: Oct 08, 2010
USA, NYC
8,580
like
04/12/12 01:08 PM (12 years ago)
Ian, You are a savior. Thank you so much. It worked perfectly. AM
 
ianJamesPiano
Code is Art
Profile
Posts: 2661
Reg: Feb 13, 2011
Palm Springs, C...
37,010
like
04/12/12 01:09 PM (12 years ago)
my pleasure, u have been very kind :)
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.