Skip to content

Commit 056e006

Browse files
committed
update to 399a10f
1 parent e6cfdbc commit 056e006

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

Source/Ejecta/EJJavaScriptView.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ -(void)setupWithAppFolder:(NSString*)folder {
100100
displayLink.preferredFramesPerSecond = 60;
101101
}
102102

103-
[displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
103+
[displayLink addToRunLoop:NSRunLoop.currentRunLoop forMode:NSDefaultRunLoopMode];
104104

105105
// Create the global JS context in its own group, so it can be released properly
106106
jsGlobalContext = JSGlobalContextCreateInGroup(NULL, NULL);
@@ -401,7 +401,7 @@ - (void)pause {
401401
if( isPaused ) { return; }
402402

403403
[windowEventsDelegate pause];
404-
[displayLink removeFromRunLoop:NSRunLoop.currentRunLoop forMode:NSDefaultRunLoopMode];
404+
displayLink.paused = YES;
405405
[screenRenderingContext finish];
406406

407407
[AVAudioSession.sharedInstance setActive:NO error:NULL];
@@ -415,7 +415,7 @@ - (void)resume {
415415

416416
[windowEventsDelegate resume];
417417
[EAGLContext setCurrentContext:glCurrentContext];
418-
[displayLink addToRunLoop:NSRunLoop.currentRunLoop forMode:NSDefaultRunLoopMode];
418+
displayLink.paused = NO;
419419

420420
[AVAudioSession.sharedInstance setActive:YES error:NULL];
421421
[openALManager endInterruption];

Source/Ejecta/EJUtils/EJBindingImagePicker.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,23 @@
55
// The image is returned as EJBindingImage instance to JavaScript and can be
66
// directly drawn onto a Canvas or loaded as a WebGL texture.
77

8+
// The Image Picker is disabled by default, because Apple will reject your
9+
// app from the appstore if this functionality is compiled in, but an
10+
// `NSPhotoLibraryUsageDescription` key is missing from the app's plist,
11+
// explaining what it's used for.
12+
13+
14+
15+
// To enable the image picker, change the following `EJ_PICKER_ENABLED` to
16+
// true and add the `NSPhotoLibraryUsageDescription` key to your info.plist.
17+
18+
#define EJ_PICKER_ENABLED false
19+
20+
21+
22+
23+
#if EJ_PICKER_ENABLED
24+
825
#import "EJBindingBase.h"
926

1027
#define EJ_PICKER_TYPE_FULLSCREEN 1
@@ -35,3 +52,5 @@ typedef enum {
3552
+ (BOOL)isSourceTypeAvailable:(NSString *) sourceType;
3653

3754
@end
55+
56+
#endif

Source/Ejecta/EJUtils/EJBindingImagePicker.m

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
#import <MobileCoreServices/UTCoreTypes.h> // for media filtering
21
#import "EJBindingImagePicker.h"
2+
3+
#if EJ_PICKER_ENABLED
4+
5+
#import <MobileCoreServices/UTCoreTypes.h> // for media filtering
36
#import "EJJavaScriptView.h"
47
#import "EJTexture.h"
58
#import "EJBindingImage.h"
@@ -218,3 +221,5 @@ + (UIImagePickerControllerSourceType)getSourceTypeClass:(NSString *) sourceType
218221
}
219222

220223
@end
224+
225+
#endif

0 commit comments

Comments
 (0)