You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/10/20 03:34:02 UTC
[GitHub] [cordova-plugin-media-capture] TyrannusRex opened a new issue #198: captureVideo doesn't show message to accept access to Camera, Audio, etc. in Android
TyrannusRex opened a new issue #198:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/198
# Bug Report
## Problem
### What is expected to happen?
When I try to record a new video, I never see the message to accept the app access to my camera or audio.
### What does actually happen?
I tap in button to record a new video but never show the message access. So I record a new video and then I try to upload with file transfer, but I have this response:
![image](https://user-images.githubusercontent.com/47865292/96536451-bbf95100-1259-11eb-9c1d-bb68d2ad57a9.png)
### Command or Code
import { MediaCapture, MediaFile, CaptureError, CaptureImageOptions, CaptureVideoOptions } from '@ionic-native/media-capture/ngx';
import { File } from '@ionic-native/file/ngx';
import { FileTransfer, FileTransferObject, FileUploadOptions } from '@ionic-native/file-transfer/ngx';
constructor(
private streamingMedia: StreamingMedia,
private mediaCapture: MediaCapture,
private transfer: FileTransfer,
private file: File,,
private androidPermissions: AndroidPermissions
) {}
async createVideo() {
await this.androidPermissions.checkPermission(this.androidPermissions.PERMISSION.CAMERA).then(
result => console.log('Has permission?',result.hasPermission),
err => this.androidPermissions.requestPermission(this.androidPermissions.PERMISSION.CAMERA)
);
await this.androidPermissions.requestPermissions([this.androidPermissions.PERMISSION.CAMERA, this.androidPermissions.PERMISSION.GET_ACCOUNTS]);
this.files = [];
let options: CaptureVideoOptions = {
limit: 1,
duration: 60
}
this.mediaCapture.captureVideo(options).then( (data: MediaFile[]) => {
if ( data.length > 0) {
let path;
for (let index = 0; index < data.length; index++) {
path = data[index].fullPath;
this.files.push( { file:path, mimetype: 'video/mp4', icon:'videocam-outline', thumb: 'assets/img/placeholder_video.png', name: 'video' });
console.log('file', this.files);
}
}
}, (error: CaptureError) => {
console.log(error);
})
}
async uploadVideo() {
if ( !this.files[0] ) { return; }
let fileTransfer: FileTransferObject = this.transfer.create();
const loading = await this.loadingCtrl.create({
message: 'Subiendo video'
});
await loading.present();
let options: FileUploadOptions = {
fileKey: 'video',
fileName: 'name-video' + new Date() + '.mp4',
mimeType: "video/mp4",
headers: {
'Access-Control-Allow-Origin': '*',
'Content-Type': 'application/json',
'Accept': 'multipart/form-data',
'Authorization': 'Bearer '+ this.token
}
};
let body = { video: this.files[0].file};
fileTransfer.upload(this.files[0].file, `URL`, options).then(
resp => {
loading.dismiss();
}, error => {
console.log('error', error);
loading.dismiss();
}
)
}
### Environment, Platform, Device
Cordova- Angular -Ionic
### Version information
"@angular/common": "~10.0.0",
"@angular/core": "~10.0.0",
"@angular/forms": "~10.0.0",
"@angular/platform-browser": "~10.0.0",
"@angular/platform-browser-dynamic": "~10.0.0",
"@angular/router": "~10.0.0",
"@ionic-native/android-permissions": "^5.29.0",
"@ionic-native/camera": "^5.29.0",
"@ionic-native/core": "^5.29.0",
"@ionic-native/file": "^5.28.0",
"@ionic-native/file-transfer": "^5.28.0",
"@ionic-native/media-capture": "^5.29.0",
"@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/status-bar": "^5.0.0",
"@ionic-native/streaming-media": "^5.28.0",
"@ionic/angular": "^5.0.0",
"@ionic/storage": "^2.3.1",
"cordova-android": "9.0.0",
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-media-capture] ChetanGoti commented on issue #198: captureVideo doesn't show message to accept access to Camera, Audio, etc. in Android
Posted by GitBox <gi...@apache.org>.
ChetanGoti commented on issue #198:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/198#issuecomment-849380374
Recently I observed similar issue. It would work if it tries to `captureImage` first.
Here is scenario where it doesn't work:
- Uninstall app. (So that permissions granted gets removed)
- Install app
- You try `captureVideo`
- It opens Camera to Record the Video, but once done, it throws this error.
Here is scenario where it works:
- Uninstall app. (So that permissions granted gets removed)
- Install app
- You try `captureImage`
- It asks for Camera permission.
- It opens Camera and also able to access captured image from the local storage.
- You try `captureVideo`
- As permission is already granted, it doesn't ask for permission.
- It opens Camera to record and once done, captured video **IS** accessible from local storage. And this error is not seen.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-media-capture] ath0mas commented on issue #198: captureVideo doesn't show message to accept access to Camera, Audio, etc. in Android
Posted by GitBox <gi...@apache.org>.
ath0mas commented on issue #198:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/198#issuecomment-962272321
It looks like another duplicate of other issues for Video capture permission, see Fixes/Closes in PR #192 (just merged into _master_ branch today).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-media-capture] ciccilleju commented on issue #198: captureVideo doesn't show message to accept access to Camera, Audio, etc. in Android
Posted by GitBox <gi...@apache.org>.
ciccilleju commented on issue #198:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/198#issuecomment-848757607
I have a similar problem: did you find any solution?
I cant access the saved video from the local storage.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org
[GitHub] [cordova-plugin-media-capture] ciccilleju commented on issue #198: captureVideo doesn't show message to accept access to Camera, Audio, etc. in Android
Posted by GitBox <gi...@apache.org>.
ciccilleju commented on issue #198:
URL: https://github.com/apache/cordova-plugin-media-capture/issues/198#issuecomment-849401851
I will tra and let you know
Thank you
Il Gio 27 Mag 2021, 08:54 Chetan Goti ***@***.***> ha scritto:
> Recently I observed similar issue. It would work if it tries to
> captureImage first.
>
> Here is scenario where it doesn't work:
>
> - Uninstall app. (So that permissions granted gets removed)
> - Install app
> - You try captureVideo
> - It opens Camera to Record the Video, but once done, it throws this
> error.
>
> Here is scenario where it works:
>
> - Uninstall app. (So that permissions granted gets removed)
> - Install app
> - You try captureImage
> - It asks for Camera permission.
> - It opens Camera and also able to access captured image from the
> local storage.
> - You try captureVideo
> - As permission is already granted, it doesn't ask for permission.
> - It opens Camera to record and once done, captured video *IS*
> accessible from local storage. And this error is not seen.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/apache/cordova-plugin-media-capture/issues/198#issuecomment-849380374>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AKFB5GRT43FBBNM4OZDIP63TPXUAZANCNFSM4SXM23XQ>
> .
>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org