diff --git a/AirView-Info.plist b/AirView-Info.plist index e4d317e..6258956 100644 --- a/AirView-Info.plist +++ b/AirView-Info.plist @@ -31,7 +31,7 @@ CFBundleURLTypes CFBundleVersion - 0.9.1 + 0.9.2 LSRequiresIPhoneOS NSMainNibFile diff --git a/AirView-main.m b/AirView-main.m index 5273890..78db785 100644 --- a/AirView-main.m +++ b/AirView-main.m @@ -10,7 +10,7 @@ int main(int argc, char *argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - int retVal = UIApplicationMain(argc, argv, nil, nil); + int retVal = UIApplicationMain(argc, argv, nil, @"AirViewAppDelegate"); [pool release]; return retVal; } diff --git a/AirView.xcodeproj/project.pbxproj b/AirView.xcodeproj/project.pbxproj index 0aba748..3bf3d2e 100644 --- a/AirView.xcodeproj/project.pbxproj +++ b/AirView.xcodeproj/project.pbxproj @@ -359,6 +359,9 @@ /* Begin PBXProject section */ 2830270212BD3AFD00247F8C /* Project object */ = { isa = PBXProject; + attributes = { + LastUpgradeCheck = 0430; + }; buildConfigurationList = 2830270512BD3AFD00247F8C /* Build configuration list for PBXProject "AirView" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; @@ -470,7 +473,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 4.0; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; - PREBINDING = NO; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "7E41CF06-2727-44F8-BBA0-D7B4D11E39A6"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -488,6 +490,7 @@ ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AirView-Prefix.pch"; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INFOPLIST_FILE = "AirView-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 4.2; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -508,7 +511,6 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 4.0; - PREBINDING = NO; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -525,7 +527,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 4.0; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; - PREBINDING = NO; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "D3DC2D31-675A-4D8C-8E19-50DB7B1164D3"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -544,6 +545,7 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AirView-Prefix.pch"; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INFOPLIST_FILE = "AirView-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 4.2; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -562,6 +564,7 @@ ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AirView-Prefix.pch"; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INFOPLIST_FILE = "AirView-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 4.2; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -581,7 +584,6 @@ GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 4.0; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; - PREBINDING = NO; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "D3DC2D31-675A-4D8C-8E19-50DB7B1164D3"; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -599,6 +601,7 @@ ); GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "AirView-Prefix.pch"; + GCC_VERSION = com.apple.compilers.llvm.clang.1_0; INFOPLIST_FILE = "AirView-Info.plist"; IPHONEOS_DEPLOYMENT_TARGET = 4.2; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Classes/AirPlayController.m b/Classes/AirPlayController.m index f2152a5..3fe7f74 100644 --- a/Classes/AirPlayController.m +++ b/Classes/AirPlayController.m @@ -45,7 +45,10 @@ - (id)initWithWindow:(UIWindow *)uiWindow playerView = [[MPMoviePlayerViewController alloc] initWithContentURL:nil]; player = playerView.moviePlayer; - } + if([player respondsToSelector:@selector(setAllowsAirPlay:)]) { + player.allowsAirPlay = NO; + } + } return self; } @@ -76,6 +79,9 @@ - (void)play:(NSURL *)location atRelativePosition:(float)position if (playerView == nil) { playerView = [[MPMoviePlayerViewController alloc] initWithContentURL:location]; player = playerView.moviePlayer; + if([player respondsToSelector:@selector(setAllowsAirPlay:)]) { + player.allowsAirPlay = NO; + } } else { [player setContentURL:location]; } diff --git a/Classes/AirPlayHTTPConnection.m b/Classes/AirPlayHTTPConnection.m index 8d07d11..b130aa1 100644 --- a/Classes/AirPlayHTTPConnection.m +++ b/Classes/AirPlayHTTPConnection.m @@ -84,7 +84,9 @@ - (BOOL)supportsMethod:(NSString *)method atPath:(NSString *)path [path isEqualToString:@"/play"] || [path isEqualToString:@"/stop"] || [path hasPrefix:@"/scrub?position="] || - [path hasPrefix:@"/rate?value="]) + [path hasPrefix:@"/rate?value="]|| + [path hasPrefix:@"/getProperty?playbackAccessLog"]|| + [path hasPrefix:@"/getProperty?playbackErrorLog"]) return YES; } @@ -92,7 +94,9 @@ - (BOOL)supportsMethod:(NSString *)method atPath:(NSString *)path if ([method isEqualToString:@"PUT"]) { - if ([path isEqualToString:@"/photo"]) + if ([path isEqualToString:@"/photo"]|| + [path hasPrefix:@"/setProperty?forwardEndTime"]|| + [path hasPrefix:@"/setProperty?reverseEndTime"]) return YES; } @@ -161,14 +165,56 @@ - (void)processDataChunk:(NSData *)postDataChunk return [res autorelease]; } - - if ([method isEqualToString:@"PUT"] && [path isEqualToString:@"/photo"]) - { - HTTPLogVerbose(@"%@[%p]: PUT (%qu) %@", THIS_FILE, self, requestContentLength, path); - - return [[[HTTPDataResponse alloc] initWithData:nil] autorelease]; - } - + if ([method isEqualToString:@"PUT"]) + { + if ([path isEqualToString:@"/photo"]) + { + HTTPLogVerbose(@"%@[%p]: PUT (%qu) %@", THIS_FILE, self, requestContentLength, path); + + return [[[HTTPDataResponse alloc] initWithData:nil] autorelease]; + } + else if ([path isEqualToString:@"/setProperty?forwardEndTime"]) + { + // In iOS 5 this command is accompanied by a dictionary + //{ + // value = { + // epoch = 0; + // flags = 0; + // timescale = 0; + // value = 0; + //};} + + NSString *error; + NSDictionary *dict = (NSDictionary *)[NSPropertyListSerialization + propertyListFromData:[request body] + mutabilityOption:NSPropertyListImmutable + format:NULL + errorDescription:&error ]; + HTTPLogVerbose(@"%@[%p]: PUT (%qu) %@\n%@\n%@\n", THIS_FILE, self, requestContentLength, path, [dict description], error); + return [[[HTTPDataResponse alloc] initWithData:nil] autorelease]; + } + else if ([path isEqualToString:@"/setProperty?reverseEndTime"]) + { + // In iOS 5 this command is accompanied by a dictionary + //{ + // value = { + // epoch = 0; + // flags = 0; + // timescale = 0; + // value = 0; + //};} + + NSString *error; + NSDictionary *dict = (NSDictionary *)[NSPropertyListSerialization + propertyListFromData:[request body] + mutabilityOption:NSPropertyListImmutable + format:NULL + errorDescription:&error ]; + HTTPLogVerbose(@"%@[%p]: PUT (%qu) %@\n%@\n%@\n", THIS_FILE, self, requestContentLength, path, [dict description], error); + return [[[HTTPDataResponse alloc] initWithData:nil] autorelease]; + } + + } if (![method isEqualToString:@"POST"]) return [super httpResponseForMethod:method URI:path]; @@ -193,6 +239,16 @@ - (void)processDataChunk:(NSData *)postDataChunk return [[[HTTPDataResponse alloc] initWithData:nil] autorelease]; } + else if ([path isEqualToString:@"/getProperty?playbackAccessLog"]) + { + HTTPLogVerbose(@"%@[%p]: POST (%qu) %@", THIS_FILE, self, requestContentLength, path); + return [[[HTTPDataResponse alloc] initWithData:nil] autorelease]; + } + else if ([path isEqualToString:@"/getProperty?playbackErrorLog"]) + { + HTTPLogVerbose(@"%@[%p]: POST (%qu) %@", THIS_FILE, self, requestContentLength, path); + return [[[HTTPDataResponse alloc] initWithData:nil] autorelease]; + } else if ([path isEqualToString:@"/stop"]) { [airplay stop];