Skip to content

Commit 91247e5

Browse files
authored
Merge pull request #18 from codenameone/master
Update
2 parents f26c11a + 118064b commit 91247e5

File tree

179 files changed

+22384
-558
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

179 files changed

+22384
-558
lines changed

.gitignore

+10-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,13 @@ nightly_builds/.DS_Store
4949
node_modules
5050
/tests/core/nbproject/private/
5151
/tests/core/dist/
52-
/tests/core/build/
52+
/tests/core/build/
53+
/tests/signin-demo/nbproject/private/
54+
/Ports/J2ME/nbproject/private/
55+
/Ports/CLDC11/nbproject/private/
56+
/Ports/Android/CompatLibs/nbproject/private/
57+
/Ports/UWP/nbproject/private/
58+
/Ports/CLDC11/build/
59+
/Ports/CLDC11/dist/
60+
/Samples/SampleProjectTemplate/nbproject/private/
61+
/Samples/config

CodenameOne/src/cn1-version-numbers

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7926b8ea0dc8be24888594c06fc0c0cdc57e4ee4
1+
41704b739989b480681e24221e1289f51ace4a69

CodenameOne/src/com/codename1/capture/Capture.java

+28
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,20 @@ public static String captureVideo() {
108108
return c.url;
109109
}
110110

111+
/**
112+
* Same as {@link #captureVideo(com.codename1.capture.VideoCaptureConstraints, com.codename1.ui.events.ActionListener) } only a
113+
* blocking version that holds the EDT.
114+
* @param constraints
115+
* @return A video file location or null if the user canceled.
116+
* @since 7.0
117+
*/
118+
public static String captureVideo(VideoCaptureConstraints constraints) {
119+
CallBack c = new CallBack();
120+
captureVideo(constraints, c);
121+
Display.getInstance().invokeAndBlock(c);
122+
return c.url;
123+
}
124+
111125
/**
112126
* <p>Invokes the camera and takes a photo synchronously while blocking the EDT, the sample below
113127
* demonstrates a simple usage and applying a mask to the result</p>
@@ -165,6 +179,19 @@ public static void captureAudio(ActionListener response){
165179
Display.getInstance().captureAudio(response);
166180
}
167181

182+
/**
183+
* Captures video with some constraints, like width, height, and max length. Video constraints
184+
* may not be supported on all platforms. Use {@link VideoCaptureConstraints#isSupported() } and {@link VideoCaptureConstraints#isSizeSupported() }
185+
* to check whether constraints are supported on the current platform. If constraints are not supported, then, in the worst case, this will fall
186+
* back to just use {@link #captureVideo(com.codename1.ui.events.ActionListener) }, i.e. capture with no constraints.
187+
* @param constraints The constraints to use for the video capture.
188+
* @param response a callback Object to retrieve the file path
189+
* @since 7.0
190+
*/
191+
public static void captureVideo(VideoCaptureConstraints constraints, ActionListener response) {
192+
Display.getInstance().captureVideo(constraints, response);
193+
}
194+
168195
/**
169196
* This method tries to invoke the device native camera to capture video.
170197
* The method returns immediately and the response will be sent asynchronously
@@ -176,6 +203,7 @@ public static void captureAudio(ActionListener response){
176203
*
177204
* @param response a callback Object to retrieve the file path
178205
* @throws RuntimeException if this feature failed or unsupported on the platform
206+
* @see #captureVideo(com.codename1.capture.VideoCaptureConstraints, com.codename1.ui.events.ActionListener)
179207
*/
180208
public static void captureVideo(ActionListener response){
181209
Display.getInstance().captureVideo(response);

0 commit comments

Comments
 (0)