Browse Source

iosvlc: add support for visionOS

This enables the pinch gesture and solves a problem with UIScreen being
unavailable on this platform
pull/162/head
Felix Paul Kühne 2 years ago
committed by Steve Lhomme
parent
commit
fd6fa7ac15
  1. 4
      test/Makefile.am
  2. 11
      test/iosvlc.m

4
test/Makefile.am

@ -449,6 +449,10 @@ if HAVE_TVOS
noinst_PROGRAMS += vlccoreios
endif
if HAVE_XROS
noinst_PROGRAMS += vlccoreios
endif
vlc_window_SOURCES = vlc-window.c
vlc_window_CPPFLAGS = $(AM_CPPFLAGS) -I../include/
vlc_window_LDADD = ../lib/libvlc.la ../src/libvlccore.la ../compat/libcompat.la

11
test/iosvlc.m

@ -46,7 +46,7 @@
UIWindow *window;
UIView *subview;
#if TARGET_OS_IOS
#if !TARGET_OS_TV
UIPinchGestureRecognizer *_pinchRecognizer;
#endif
@ -58,7 +58,7 @@
@implementation AppDelegate
#if TARGET_OS_IOS
#if !TARGET_OS_TV
- (void)pinchRecognized:(UIPinchGestureRecognizer *)pinchRecognizer
{
UIGestureRecognizerState state = [pinchRecognizer state];
@ -113,7 +113,12 @@
return NO;
/* Initialize main window */
#if TARGET_OS_VISION
/* UIScreen is unavailable so we need create a size on our own */
window = [[UIWindow alloc] initWithFrame:CGRectMake(0., 0., 1200., 800.)];
#else
window = [[UIWindow alloc] initWithFrame:UIScreen.mainScreen.bounds];
#endif
window.rootViewController = [[UIViewController alloc] init];
window.backgroundColor = [UIColor whiteColor];
@ -122,7 +127,7 @@
[window addSubview:subview];
[window makeKeyAndVisible];
#if TARGET_OS_IOS
#if !TARGET_OS_TV
_pinchRecognizer = [[UIPinchGestureRecognizer alloc]
initWithTarget:self action:@selector(pinchRecognized:)];
[window addGestureRecognizer:_pinchRecognizer];

Loading…
Cancel
Save