[vlc-commits] [Git][videolan/vlc][master] iosvlc: add support for visionOS

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Mon Jun 3 10:27:03 UTC 2024



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
fd6fa7ac by Felix Paul Kühne at 2024-06-03T09:36:48+00:00
iosvlc: add support for visionOS

This enables the pinch gesture and solves a problem with UIScreen being
unavailable on this platform

- - - - -


2 changed files:

- test/Makefile.am
- test/iosvlc.m


Changes:

=====================================
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


=====================================
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];



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/fd6fa7ac1514821a96a34d455756ff5da1157702

-- 
This project does not include diff previews in email notifications.
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/fd6fa7ac1514821a96a34d455756ff5da1157702
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list