part-cw / lambdanative

LambdaNative is a cross-platform development environment written in Scheme, supporting Android, iOS, BlackBerry 10, OS X, Linux, Windows, OpenBSD, NetBSD, FreeBSD and OpenWrt.
http://www.lambdanative.org
Other
1.39k stars 86 forks source link

iOS(videoplayer vid) broken #411

Closed karliwalti closed 3 years ago

karliwalti commented 3 years ago

It seems that currently the video player is broken on iOS. Unfortunately, no debug information is written to the log file that would help finding the issue.

reproduce:

  1. build DemoCamera 1.0 for iOS on macOS
  2. record a video
  3. watch video with 3rd button
mgorges commented 3 years ago

Can confirm - the video is getting recorded and saved to the application folder (as it is accessible in Finder), but crash upon play - maybe some new permission requirement, will need to look into it.

mgorges commented 3 years ago

The error might be *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '<PlayerDelegate: 0x105b29b10> returned nil from -traitCollection, which is not allowed.' or _** Assertion failure in UITraitCollection _Nonnull _UIGetCurrentFallbackTraitCollection(void)(), UIFallbackEnvironment.m:91 - will need a newer XCode to get full crash logs.

karliwalti commented 3 years ago

May I ask how you are able to generate such error messages?

mgorges commented 3 years ago

These show in the Console for the respective device if you connect the device to your Mac and start the app? Search/filter by App name to make it easier to find. If the question was about the crash logs in XCode - Windows, Devices and Simulator, View Device Logs.

That said, I can't yet confirm the cause yet, but you can even crash it if you just click the 'Watch button'. Maybe some of the following are also helpful:

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Application Specific Information:
abort() called

Last Exception Backtrace:
0   CoreFoundation                  0x18d5619d8 __exceptionPreprocess + 216
1   libobjc.A.dylib                 0x1a18e7b54 objc_exception_throw + 55
2   CoreFoundation                  0x18d47050c +[NSException raise:format:arguments:] + 95
3   Foundation                      0x18e7b9238 -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 103
4   UIKitCore                       0x18fa04844 _UIGetCurrentFallbackTraitCollection + 515
5   UIKitCore                       0x18f5f9540 -[UIPresentationController initWithPresentedViewController:presentingViewController:] + 115
6   UIKitCore                       0x18f60f114 -[_UISheetPresentationController initWithPresentedViewController:presentingViewController:] + 79
7   UIKitCore                       0x18f71cfbc -[UIViewController _presentViewController:withAnimationController:completion:] + 3527
8   UIKitCore                       0x18f71e240 __63-[UIViewController _presentViewController:animated:completion:]_block_invoke + 103
9   UIKitCore                       0x18f71e550 -[UIViewController _performCoordinatedPresentOrDismiss:animated:] + 503
10  UIKitCore                       0x18f71e190 -[UIViewController _presentViewController:animated:completion:] + 187
11  UIKitCore                       0x18f71e614 -[UIViewController presentViewController:animated:completion:] + 163
12  DemoCamera                      0x1042f2d4c 0x1042e4000 + 60748
13  DemoCamera                      0x1042f2fe4 0x1042e4000 + 61412
14  DemoCamera                      0x1048fe0b8 0x1042e4000 + 6398136
[...]
mgorges commented 3 years ago
fopen failed for data file: errno = 2 (No such file or directory)
[...]
*** Assertion failure in UITraitCollection * _Nonnull _UIGetCurrentFallbackTraitCollection(void)(), _UIFallbackEnvironment.m:91
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '<PlayerDelegate: 0x105516190> returned nil from -traitCollection, which is not allowed.'
*** First throw call stack:
(0x18d5619d8 0x1a18e7b54 0x18d47050c 0x18e7b9238 0x18fa04844 0x18f5f9540 0x18f60f114 0x18f71cfbc 0x18f71e240 0x18f71e550 0x18f71e190 0x18f71e614 0x104612d4c 0x104612fe4 0x104c1e0b8 0x18fe0dbc0 0x18fe0f4e8 0x18fdeab0c 0x18fe6d078 0x18fe71818 0x18fe68afc 0x18d4e1bf0 0x18d4e1af0 0x18d4e0e38 0x18d4db3e0 0x18d4daba0 0x1a4243598 0x18fdcc2f4 0x18fdd1874 0x1046108c0 0x18d1b9568)
karliwalti commented 3 years ago

I think it is as simple as that MPMoviePlayerViewController is depreciated since IOS 9 and the function needs to be rewritten http://developer.apple.com/documentation/mediaplayer/mpmovieplayercontroller

mgorges commented 3 years ago

The problem is a missing [super init] before the [self presentMoviePlayerViewControllerAnimated:movieController]; but if I add that I only hear the audio and still see a resized version of the original app. Thus more work to bring the right frame on top is needed.