This repository has been archived by the owner. It is now read-only.
Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (27 sloc) 1.29 KB
#include <MediaPlayer/MediaPlayer.h>
#include "MovDelegate.h"
#include <UIKit/UIKit.h>
%hook SpringBoard
- (void)applicationDidFinishLaunching:(id)x {
%orig;
NSFileManager *fm=[NSFileManager defaultManager];
MovDelegate *ololo = [MovDelegate alloc];
if([fm fileExistsAtPath:@"/var/mobile/startup.mov"]){
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:@"/var/mobile/startup.mov"]];
player.view.frame = [[UIScreen mainScreen]bounds];
if ([player respondsToSelector:@selector(setControlStyle:)]) {
player.controlStyle = MPMovieControlStyleNone;
}
//player.scalingMode = MPMovieScalingModeAspectFill;
[[NSNotificationCenter defaultCenter]addObserver:ololo selector:@selector(myMovieFinishedCallback:) name:@"MPMoviePlayerPlaybackDidFinishNotification" object:player];
player.view.userInteractionEnabled = NO;
Class _SBAwayController = NSClassFromString(@"SBAwayController");
[[[_SBAwayController sharedAwayController]awayView] setFullscreen:true duration:1 force:true];
[[[_SBAwayController sharedAwayController]awayView] addSubview:player.view];
[[_SBAwayController sharedAwayController]cancelDimTimer];
[player play];
NSLog(@"Movie playing now");
}
[fm release];
}
%end