diff --git a/Tweak.xm b/Tweak.xm index 0fbf79d..507c9a2 100644 --- a/Tweak.xm +++ b/Tweak.xm @@ -114,6 +114,36 @@ double delayInSeconds = 0.13; %hook AVTransportControlsView int test = 30; +// iOS 13 +-(AVTransportControlsView *)initWithFrame:(CGRect)frame styleSheet:(id)arg2{ + AVTransportControlsView *origself = %orig(frame,arg2); + CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), + (void*)myObserver, + lockButton, + CFSTR("avlock.lockButton"), + NULL, + CFNotificationSuspensionBehaviorDeliverImmediately); + CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), + (void*)myObserver, + unlockButton, + CFSTR("avlock.unlockButton"), + NULL, + CFNotificationSuspensionBehaviorDeliverImmediately); + button = [UIButton buttonWithType:UIButtonTypeCustom]; + [button addTarget:self action:@selector(orientationButtonPressed) forControlEvents:UIControlEventTouchUpInside]; + CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), CFSTR("avlock.firstUpdate"), (void*)myObserver, NULL, true); + button.contentMode = UIViewContentModeScaleAspectFit; + + button.imageEdgeInsets = UIEdgeInsetsMake(10, 10, 10, 10); + + [self addSubview:button]; + [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceOrientationDidChange) name:UIDeviceOrientationDidChangeNotification object:nil]; + + return origself; +} + + // iOS 12 -(AVTransportControlsView *)initWithFrame:(CGRect)frame styleSheet:(id)arg2 captureView:(id)arg3{ diff --git a/control b/control index 8e1b7cc..7b9b8ab 100644 --- a/control +++ b/control @@ -1,9 +1,9 @@ Package: com.gilshahar7.avlock Name: AVLock Depends: mobilesubstrate -Version: 1.0.1 +Version: 1.0.4 Architecture: iphoneos-arm -Description: Add an orientation lock button to the iOS 11 stock video player +Description: Add an orientation lock button to the stock iOS video player Maintainer: gilshahar7 Author: gilshahar7 Section: Tweaks diff --git a/packages/com.gilshahar7.avlock_1.0.4_iphoneos-arm.deb b/packages/com.gilshahar7.avlock_1.0.4_iphoneos-arm.deb new file mode 100644 index 0000000..a4cfb0c Binary files /dev/null and b/packages/com.gilshahar7.avlock_1.0.4_iphoneos-arm.deb differ