Merge pull request #2943 from dpalou/MOBILE-3844
MOBILE-3844 media: Hide download option in audio and videomain
commit
a143fbc61b
|
@ -32,7 +32,7 @@
|
|||
<ion-item *ngIf="shouldEmbed">
|
||||
<ion-label>
|
||||
<img *ngIf="isImage" [alt]="name" [src]="url">
|
||||
<video *ngIf="isVideo" [title]="name" controls>
|
||||
<video *ngIf="isVideo" [title]="name" controls controlsList="nodownload">
|
||||
<source [src]="url" [type]="mimetype">
|
||||
</video>
|
||||
<audio *ngIf="isAudio" [title]="name" controls>
|
||||
|
|
|
@ -678,6 +678,18 @@ export class CoreFormatTextDirective implements OnChanges {
|
|||
this.addMediaAdaptClass(element);
|
||||
this.addExternalContent(element);
|
||||
|
||||
// Hide download button if not hidden already.
|
||||
let controlsList = element.getAttribute('controlsList') || '';
|
||||
if (!controlsList.includes('nodownload')) {
|
||||
if (!controlsList.trim()) {
|
||||
controlsList = 'nodownload';
|
||||
} else {
|
||||
controlsList = controlsList.split(' ').concat('nodownload').join(' ');
|
||||
}
|
||||
|
||||
element.setAttribute('controlsList', controlsList);
|
||||
}
|
||||
|
||||
const sources = Array.from(element.querySelectorAll('source'));
|
||||
const tracks = Array.from(element.querySelectorAll('track'));
|
||||
|
||||
|
|
|
@ -15,7 +15,9 @@
|
|||
<video *ngIf="!isAudio" [hidden]="hasCaptured" class="core-webcam-stream" autoplay #streamVideo></video>
|
||||
|
||||
<!-- For video recording, use 2 videos and show/hide them because a CSS rule caused problems with the controls. -->
|
||||
<video *ngIf="isVideo" [hidden]="!hasCaptured" class="core-webcam-video-captured" controls #previewVideo></video>
|
||||
<video *ngIf="isVideo" [hidden]="!hasCaptured" class="core-webcam-video-captured" controls #previewVideo
|
||||
controlsList="nodownload">
|
||||
</video>
|
||||
|
||||
<!-- Canvas to treat the image and an img to show the result. -->
|
||||
<canvas *ngIf="isImage" class="core-webcam-image-canvas" #imgCanvas></canvas>
|
||||
|
@ -35,7 +37,7 @@
|
|||
</ion-button>
|
||||
|
||||
<!-- Audio player to listen to the result. -->
|
||||
<audio [hidden]="!hasCaptured" class="core-audio-captured" controls #previewAudio></audio>
|
||||
<audio [hidden]="!hasCaptured" class="core-audio-captured" controls #previewAudio controlsList="nodownload"></audio>
|
||||
</div>
|
||||
</div>
|
||||
</core-loading>
|
||||
|
|
|
@ -191,7 +191,7 @@ export class CoreMimetypeUtilsProvider {
|
|||
case 'audio':
|
||||
case 'video':
|
||||
return [
|
||||
`<${embedType} controls title="${filename}" src="${path}">`,
|
||||
`<${embedType} controls title="${filename}" src="${path}" controlsList="nodownload">`,
|
||||
`<source src="${path}" type="${mimeType}">`,
|
||||
`</${embedType}>`,
|
||||
].join('');
|
||||
|
|
Loading…
Reference in New Issue