Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
The changes documented here do not include those from the original repository.

## [Unreleased]

## [4.2.0-OS41]

### Features
- [Android] Ask for gallery permissions for RecordVideo (https://outsystemsrd.atlassian.net/browse/RMET-2472).
- [Android] Update Error Codes and Error Messages (https://outsystemsrd.atlassian.net/browse/RMET-2400).
- [Android] Add compression to big images (https://outsystemsrd.atlassian.net/browse/RMET-2409).
- [iOS] Update Error Codes and Error Messages (https://outsystemsrd.atlassian.net/browse/RMET-2400).
- [iOS] Add return of Metadata to `Choose from Gallery` and `Record Video` (https://outsystemsrd.atlassian.net/browse/RMET-2349).
- [Bridge] Add `include Metadata` client action input parameter (https://outsystemsrd.atlassian.net/browse/RMET-2346).

### Features
- [iOS] Add `Play Video` client action (https://outsystemsrd.atlassian.net/browse/RMET-2360).
- [Android] Play Video for Android (https://outsystemsrd.atlassian.net/browse/RMET-2359)
- [Bridge] Add `Play Video` client action (https://outsystemsrd.atlassian.net/browse/RMET-2361).
Expand Down
2 changes: 1 addition & 1 deletion build/ci/azure-pipeline-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ stages:
- template: build/ci/refresh-sampleapp.yaml@MobilePluginsODCPipeline
parameters:
secretFileName: "eng-osrd-mobile-neo1-StampsInformation.json"
SAMPLEAPP_APP_KEY: "3c0451ef-0d99-4e09-adb5-718e009deb9d"
SAMPLEAPP_APP_KEY: "15d54f75-779d-4cae-948f-1bc119a7e813"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key needs to be replaced in other places in this file also

workingDirectory: $(System.DefaultWorkingDirectory)/MobilePluginsODCPipeline
- script: |
echo "##vso[task.setvariable variable=apkPath]$(cat /tmp/3c0451ef-0d99-4e09-adb5-718e009deb9d.apk-path)"
Expand Down
2 changes: 1 addition & 1 deletion libs/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ apply plugin: 'kotlin-kapt'
dependencies {
implementation("com.github.outsystems:oscore-android:1.1.0@aar")
implementation("com.github.outsystems:oscordova-android:1.1.0@aar")
implementation("com.github.outsystems:oscamera-android:0.0.21@aar")
implementation("com.github.outsystems:oscamera-android:1.0.0@aar")
}

// Defer the definition of the dependencies to the end
Expand Down
45 changes: 43 additions & 2 deletions src/android/CameraLauncher.kt
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ class CameraLauncher : CordovaPlugin() {
OSCAMRImageHelper()
)

camController?.deleteVideoFilesFromCache(cordova.activity)

}

override fun onDestroy() {
Expand Down Expand Up @@ -360,10 +362,49 @@ class CameraLauncher : CordovaPlugin() {

fun callCaptureVideo(saveVideoToGallery: Boolean) {

if (!PermissionHelper.hasPermission(this, Manifest.permission.CAMERA)) {
PermissionHelper.requestPermission(this, CAPTURE_VIDEO_SEC, Manifest.permission.CAMERA)
val cameraPermissionNeeded = !PermissionHelper.hasPermission(this, Manifest.permission.CAMERA)

val galleryPermissionNeeded = saveVideoToGallery && !((Build.VERSION.SDK_INT < 33 &&
PermissionHelper.hasPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE) &&
PermissionHelper.hasPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)) ||
(Build.VERSION.SDK_INT >= 33 &&
PermissionHelper.hasPermission(this, READ_MEDIA_VIDEO) &&
PermissionHelper.hasPermission(this, READ_MEDIA_IMAGES)))

if (cameraPermissionNeeded && galleryPermissionNeeded) {
PermissionHelper.requestPermissions(this, CAPTURE_VIDEO_SEC, permissions)
return
}

else if (cameraPermissionNeeded) {
PermissionHelper.requestPermission(
this,
CAPTURE_VIDEO_SEC,
Manifest.permission.CAMERA
)
return
}
else if (galleryPermissionNeeded) {
if (Build.VERSION.SDK_INT < 33) {
PermissionHelper.requestPermissions(
this,
CAPTURE_VIDEO_SEC,
arrayOf(
Manifest.permission.READ_EXTERNAL_STORAGE,
Manifest.permission.WRITE_EXTERNAL_STORAGE
)
)
}
else {
PermissionHelper.requestPermissions(
this,
CAPTURE_VIDEO_SEC,
arrayOf(READ_MEDIA_VIDEO, READ_MEDIA_IMAGES)
)
}
return
}

cordova.setActivityResultCallback(this)
camController?.captureVideo(cordova.activity, saveVideoToGallery) {
sendError(it)
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</data>
<key>Modules/OSCameraLib.swiftmodule/arm64-apple-ios.swiftmodule</key>
<data>
c3+Iy/Fbdb37R5rG4AksgsoDbTY=
pn+UN5evVesW+Pl93WwhFwevnD4=
</data>
<key>Modules/module.modulemap</key>
<data>
Expand Down Expand Up @@ -67,7 +67,7 @@
<dict>
<key>hash2</key>
<data>
CfDFxBOVjspmPiI3P/nCqOvLPJiDH3BT/3t4Gsf8tPU=
/x7zGKOvi/mrZQS8m+Y8Sp7uQxRafq2sgXgJ0UcUZ6Y=
</data>
</dict>
<key>Modules/module.modulemap</key>
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
</data>
<key>Modules/OSCameraLib.swiftmodule/arm64-apple-ios-simulator.swiftmodule</key>
<data>
otYLFh5+TbwzPqtakHdAGL5G9ks=
wiiPuVv+tcuYZvtsuedmoMBjnWE=
</data>
<key>Modules/OSCameraLib.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
<data>
Expand All @@ -38,7 +38,7 @@
</data>
<key>Modules/OSCameraLib.swiftmodule/x86_64-apple-ios-simulator.swiftmodule</key>
<data>
BMLVbXAQGb+KGk7Czk7JpE//FdI=
WAby1/0p0H72/PtKAP+hKIB7ZSU=
</data>
<key>Modules/module.modulemap</key>
<data>
Expand Down Expand Up @@ -79,7 +79,7 @@
<dict>
<key>hash2</key>
<data>
2QCPp7boRVM7FSNs/WLbstRuPPzvf0qN7hqXp4gbdK4=
DSYFCTaNfGWdpKBIxQaAaaCkoRpNmkdDqvjQSUZOY9A=
</data>
</dict>
<key>Modules/OSCameraLib.swiftmodule/x86_64-apple-ios-simulator.swiftdoc</key>
Expand All @@ -100,7 +100,7 @@
<dict>
<key>hash2</key>
<data>
sJ6JVd6DQ46oHmrRaOUvdY8Dp4fu8Sdmo+hKWGFHW3I=
9iZDDd1++tlqjGWvirhI+IMZlYcDxTLk7R++gx0JodU=
</data>
</dict>
<key>Modules/module.modulemap</key>
Expand Down