This commit is contained in:
Peter Maquiran
2024-02-28 13:31:22 +01:00
77 changed files with 1463 additions and 1386 deletions
+18 -36
View File
@@ -106,8 +106,8 @@ export class HomePage implements OnInit {
private modalController: ModalController,
private zone: NgZone
// private ChunkService: ChunkService,
// private StreamService: StreamService
// private ChunkService: ChunkService,
// private StreamService: StreamService
) {
if (SessionStore.exist) {
this.user = SessionStore.user;
@@ -143,7 +143,6 @@ export class HomePage implements OnInit {
}
}
sendIntent.setRouteService(this.router)
}
@@ -160,49 +159,27 @@ export class HomePage implements OnInit {
SendIntent.checkSendIntentReceived().then((result: any) => {
alert('shared')
if (result) {
console.log('SendIntent received');
console.log(JSON.stringify(result));
console.log('SendIntent received');
console.log(JSON.stringify(result));
}
if (result.url) {
let resultUrl = decodeURIComponent(result.url);
Filesystem.readFile({path: resultUrl})
.then(async (content) => {
const modal = await this.modalController.create({
component: PublicationsPage,
componentProps: {
item: "item",
intent: content.data
},
cssClass: 'new-action modal modal-desktop',
backdropDismiss: false
});
modal.onDidDismiss().then(() => {
SendIntent.finish();
});
await modal.present();
console.log(content.data);
})
.catch((err) => console.error(err));
window["sharedContent"] = result;
this.zone.run(() => this.router.navigateByUrl("/home/publications"));
}
}).catch(err => console.error(err));
}).catch(err => console.error(err));
}
ngOnInit() {
if(window["sharedintend"]) {
/* if (window["sharedintend"]) {
this.router.navigateByUrl("/home/publication");
}
} */
window["this.router"] = this.router
/* this.checkSendIntentReceived() */
if (this.platform.is('ios'))
this.checkSendIntentReceived()
if ("serviceWorker" in navigator) {
navigator.serviceWorker.onmessage = (event) => {
@@ -298,8 +275,13 @@ export class HomePage implements OnInit {
if (!this.platform.is('desktop')) {
App.addListener('appStateChange', ({ isActive }) => {
if (isActive) {
sendIntent.setRouteService(this.router)
/* this.checkSendIntentReceived(); */
if (this.platform.is('ios')) {
this.checkSendIntentReceived();
} else if (this.platform.is('android')) {
sendIntent.setRouteService(this.router)
} else {
}
console.log('App is in the foreground');
/* this.checkSendIntentReceived() */
} else {
@@ -40,23 +40,19 @@
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'" [(ngModel)]="capturedImage"
name="image" ngDefaultControl [src]="'data:image/jpg;base64,' + seleted.Base64"
name="image" ngDefaultControl [src]="'data:image/jpg;base64,' + seleted.FileBase64"
(click)="imageSize(capturedImage)" style="height: 69px;"></ion-img>
<video class="55" *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video' && publicationTitle == ActionType.edit" width="70" height="70"
<video *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video'" width="70" height="70"
controls="controls" preload="metadata" autoplay="autoplay" webkit-playsinline="webkit-playsinline">
<source type="video/mp4" [src]="'data:video/mp4;base64,' + seleted.Base64">
<source type="video/mp4" [src]="seleted.FileBase64">
</video>
<video class="src" *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video' && publicationTitle != ActionType.edit" width="70" height="70"
controls="controls" preload="metadata" autoplay="autoplay" webkit-playsinline="webkit-playsinline">
<source type="video/mp4" [src]="seleted.url">
</video>
</div>
<!-- Display the blurred image and count if there are more images -->
<ion-thumbnail *ngIf="seletedContent.length > displayLimit" lot="start">
<ion-img [src]="'data:image/jpg;base64,' + seletedContent[displayLimit - 1].Base64"
<ion-img [src]="'data:image/jpg;base64,' + seletedContent[displayLimit - 1].base64"
style="filter: blur(5px);"></ion-img>
<p>mais {{ seletedContent.length - displayLimit }}</p>
@@ -87,7 +83,7 @@
</div> -->
<div class="ion-item-container-no-border pt-10">
<ion-label (click)="chossePhotoOrVideo()">
<ion-label (click)="takePicture()">
<div class="attach-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' "
src="assets/images/icons-add-photo.svg"></ion-icon>
@@ -96,14 +92,29 @@
</div>
<div class="attach-document">
<ion-label>Câmera</ion-label>
<ion-label>Tirar Fotografia</ion-label>
</div>
</ion-label>
</div>
<div *ngIf="photoOrVideo" class="container-multiselect pt-10">
<div class="ion-item-container-no-border pt-10">
<ion-label (click)="startVideoRecording()">
<div class="attach-icon">
<ion-icon *ngIf="ThemeService.currentTheme == 'default' "
src="assets/images/icons-add-photo.svg"></ion-icon>
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' "
src="assets/images/theme/gov/icons-add-photo.svg"></ion-icon>
</div>
<div class="attach-document">
<ion-label>Fazer Vídeo</ion-label>
</div>
</ion-label>
</div>
<!-- <div *ngIf="photoOrVideo" class="container-multiselect pt-10">
<button id="container-multiselect" class="multiselect-button" (click)="takePicture()">Fotografia</button>
<button id="container-multiselect" class="multiselect-button" (click)="startVideoRecording()">Video</button>
</div>
</div> -->
<!-- <div *ngIf="photoOrVideo" class="ion-item-container-no-border">
<ion-label (click)="takePicture()">
@@ -16,18 +16,25 @@ import { formatDate } from 'src/plugin/momentG.js'
import { ThemeService } from 'src/app/services/theme.service';
import { Camera, CameraResultType, CameraSource, Photo } from '@capacitor/camera';
import { Filesystem, Directory, Encoding, FilesystemDirectory } from '@capacitor/filesystem';
import { Filesystem, Directory, Encoding, FilesystemDirectory, FilesystemEncoding } from '@capacitor/filesystem';
import { NgxImageCompressService } from "ngx-image-compress";
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { PublicationFolderService } from 'src/app/store/publication-folder.service';
import { RouteService } from 'src/app/services/route.service';
import { FileService } from 'src/app/services/functions/file.service';
import { readAndCompressImage } from 'browser-image-resizer';
import { FilePicker } from '@capawesome/capacitor-file-picker';
import { CapacitorVideoPlayer } from 'capacitor-video-player';
import { CaptureImageOptions, MediaCapture } from '@awesome-cordova-plugins/media-capture/ngx';
import { CaptureError, CaptureImageOptions, MediaCapture, MediaFile } from '@awesome-cordova-plugins/media-capture/ngx';
import { Capacitor } from '@capacitor/core';
import { File } from '@ionic-native/file/ngx';
import { Media } from '@ionic-native/media/ngx';
import { checkFileTypeService } from 'src/app/services/checkFileType.service';
import { FileValidatorService } from "src/app/services/file/file-validator.service"
import { PublicationAttachmentEntity } from 'src/app/shared/publication/upload/upload-streaming.service';
import { App } from '@capacitor/app';
import { Router } from '@angular/router';
const config = {
quality: 0.5,
maxWidth: 800,
@@ -89,13 +96,6 @@ export class NewPublicationPage implements OnInit {
publicationTitle: string;
imgUrl: any;
ActionType = {
newRapid : "1",
new: "2",
edit: "3"
}
Defaultimage: any = '';
photo: SafeResourceUrl;
@@ -116,7 +116,7 @@ export class NewPublicationPage implements OnInit {
photoOrVideo: boolean = false;
fileType = "";
filecontent: boolean;
seletedContent: PublicationAttachmentEntity[] = []
seletedContent: any[] = []
// Set a limit for the number of images to display
displayLimit = 4;
filesSizeSum = 0;
@@ -137,7 +137,8 @@ export class NewPublicationPage implements OnInit {
public FileService: FileService,
private mediaCapture: MediaCapture,
public checkFileType: checkFileTypeService,
private FileValidatorService: FileValidatorService
private FileValidatorService: FileValidatorService,
private router: Router,
) {
this.publicationType = this.navParams.get('publicationType');
@@ -146,18 +147,6 @@ export class NewPublicationPage implements OnInit {
if (this.publication) {
this.seletedContent = this.publication.Files;
this.filecontent = true;
this.seletedContent = this.publication.Files.map(e => {
return new PublicationAttachmentEntity(
{
base64: e.FileBase64,
extension: e.FileExtension,
OriginalFileName: e.OriginalFileName,
FileType: this.checkFileType.checkFileType(e.FileExtension) as any
}
)
})
}
console.log('Edit', this.publication)
this.publicationTitle = 'Nova Publicação';
@@ -177,16 +166,16 @@ export class NewPublicationPage implements OnInit {
recursive: true
});
try {
document.addEventListener("click", clickOutside, false);
function clickOutside(e) {
const inside = document.getElementById('container-multiselect').contains(e.target);
this.photoOrVideo = false;
console.log(this.photoOrVideo)
}
} catch (error) {}
/* try {
document.addEventListener("click", clickOutside, false);
function clickOutside(e) {
const inside = document.getElementById('container-multiselect').contains(e.target);
this.photoOrVideo = false;
console.log(this.photoOrVideo)
}
} catch (error) {
console.log('click butto', error)
} */
}
// in use
@@ -213,14 +202,11 @@ export class NewPublicationPage implements OnInit {
console.log('take picture', this.removeTextBeforeSlash(picture, ','),)
this.filecontent = true;
this.photoOrVideo = false;
const fileObject = new PublicationAttachmentEntity({
base64: this.removeTextBeforeSlash(picture, ','),
extension: capturedImage.format,
FileType: 'image',
let fileObject = {
FileBase64: this.removeTextBeforeSlash(picture, ','),
FileExtension: capturedImage.format,
OriginalFileName: 'image'
})
}
this.seletedContent.push(fileObject)
@@ -260,31 +246,61 @@ export class NewPublicationPage implements OnInit {
let options: CaptureImageOptions = { limit: 1 }
const data: any = await this.mediaCapture.captureVideo(options)
this.video = data[0];
console.log(data)
console.log('video record', data)
data.forEach(async element => {
Capacitor.convertFileSrc(element.fullPath);
console.log('convert url', (Capacitor.convertFileSrc(element.fullPath)));
this.filesSizeSum = this.filesSizeSum + element.size
if (this.fileSizeToMB(this.filesSizeSum) <= 20) {
const savedFile = await Filesystem.copy({
from: element.fullPath, // directory prop removed, Capacitor parses filename for us
to: "video.mp4",
toDirectory: FilesystemDirectory.Data
});
console.log(savedFile.uri)
Filesystem.readFile({ path: savedFile.uri })
.then(async (content) => {
this.filecontent = true;
let fileObject = new PublicationAttachmentEntity({
base64: 'data:video/mp4;base64,'+content.data,
extension: 'mp4',
OriginalFileName: 'record',
FileType: 'video'
try {
if (this.platform.is('ios')) {
const result = await Filesystem.writeFile({
path: 'video.mov',
data: element.fullPath,
directory: FilesystemDirectory.Data,
encoding: FilesystemEncoding.UTF8
})
console.log('Wrote file', result);
Filesystem.readFile({ path: result.uri })
.then(async (content) => {
console.log(content.data)
this.filecontent = true;
let fileObject = {
FileBase64: 'data:video/mp4;base64,' + content.data,
FileExtension: 'mp4',
OriginalFileName: 'video'
}
this.seletedContent.push(fileObject)
})
.catch((err) => console.error(err));
} else {
const savedFile = await Filesystem.copy({
from: Capacitor.convertFileSrc(element.fullPath), // directory prop removed, Capacitor parses filename for us
to: "video.mp4",
toDirectory: FilesystemDirectory.Data
});
console.log(savedFile.uri)
Filesystem.readFile({ path: savedFile.uri })
.then(async (content) => {
this.filecontent = true;
let fileObject = {
FileBase64: 'data:video/mp4;base64,' + content.data,
FileExtension: 'mp4',
OriginalFileName: 'video'
}
this.seletedContent.push(fileObject)
})
.catch((err) => console.error(err));
}
} catch (e) {
console.error('Unable to write file', e);
}
this.seletedContent.push(fileObject)
})
.catch((err) => console.error(err));
} else {
if (this.seletedContent.length === 0)
this.filesSizeSum = 0
@@ -304,13 +320,16 @@ export class NewPublicationPage implements OnInit {
({
multiple: true,
});
console.log(result.files)
console.log(result.files)
result.files.forEach(element => {
this.filesSizeSum = this.filesSizeSum + element.size
if (this.fileSizeToMB(this.filesSizeSum) <= 20) {
console.log('pass size verificartion')
if (this.checkFileType.checkFileType(element.mimeType) == 'image' || this.checkFileType.checkFileType(element.mimeType) == 'video') {
let resultUrl = decodeURIComponent(element.path);
console.log('pass type verification ', resultUrl)
try {
Filesystem.readFile({ path: resultUrl })
@@ -319,29 +338,18 @@ export class NewPublicationPage implements OnInit {
console.log(content)
this.filecontent = true;
let fileObject;
if(this.removeTextBeforeSlash(element.mimeType, '/') == "mp4") {
const extension = this.removeTextBeforeSlash(element.mimeType, '/')
fileObject = new PublicationAttachmentEntity({
base64: content.data,
extension: extension,
OriginalFileName: 'video',
FileType: 'video'
})
if (this.removeTextBeforeSlash(element.mimeType, '/') == "mp4") {
fileObject = {
FileBase64: 'data:video/mp4;base64,' + content.data,
FileExtension: this.removeTextBeforeSlash(element.mimeType, '/'),
OriginalFileName: 'video'
}
} else {
const extension = this.removeTextBeforeSlash(element.mimeType, '/')
fileObject = new PublicationAttachmentEntity({
base64: content.data,
extension: extension,
OriginalFileName: 'image',
FileType: 'image'
})
fileObject = {
FileBase64: content.data,
FileExtension: this.removeTextBeforeSlash(element.mimeType, '/'),
OriginalFileName: 'image'
}
}
this.seletedContent.push(fileObject)
@@ -442,51 +450,52 @@ export class NewPublicationPage implements OnInit {
if (this.Form.invalid) return false
if (this.seletedContent.length != 0) {
if (this.publicationType == '3') {
const loader = this.toastService.loading()
if (this.publicationType == '3') {
const loader = this.toastService.loading()
// has file
if (this.PublicationFolderService.PublicationHasImage(this.publication)) {
this.publication = {
DateIndex: this.publication.DateIndex,
DocumentId: this.publication.DocumentId,
ProcessId: this.publication.ProcessId,
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: this.publication.DatePublication,
OriginalFileName: this.publication.OriginalFileName,
Files: this.seletedContent,
}
// has file
if (this.PublicationFolderService.PublicationHasImage(this.publication)) {
this.publication = {
DateIndex: this.publication.DateIndex,
DocumentId: this.publication.DocumentId,
ProcessId: this.publication.ProcessId,
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: this.publication.DatePublication,
OriginalFileName: this.publication.OriginalFileName,
Files: this.seletedContent,
}
/* } else if (this.capturedVideo != '' && this.capturedImage == '') {
this.publication = {
DateIndex: this.publication.DateIndex,
DocumentId: this.publication.DocumentId,
ProcessId: this.publication.ProcessId,
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: this.publication.DatePublication,
OriginalFileName: this.publication.OriginalFileName || 'video',
Files: this.seletedContent,
FileExtension: 'mp4',
}
} */
// no names
} else if (!this.PublicationFolderService.PublicationHasImage(this.publication)) {
this.publication = {
DateIndex: this.publication.DateIndex,
DocumentId: this.publication.DocumentId,
ProcessId: this.publication.ProcessId,
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: this.publication.DatePublication,
OriginalFileName: this.publication.OriginalFileName,
Files: this.seletedContent,
}
/* } else if (this.capturedVideo != '' && this.capturedImage == '') {
this.publication = {
DateIndex: this.publication.DateIndex,
DocumentId: this.publication.DocumentId,
ProcessId: this.publication.ProcessId,
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: this.publication.DatePublication,
OriginalFileName: this.publication.OriginalFileName || 'video',
Files: this.seletedContent,
FileExtension: 'mp4',
}
} */
// no names
} else if (!this.PublicationFolderService.PublicationHasImage(this.publication)) {
this.publication = {
DateIndex: this.publication.DateIndex,
DocumentId: this.publication.DocumentId,
ProcessId: this.publication.ProcessId,
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: this.publication.DatePublication,
OriginalFileName: this.publication.OriginalFileName,
Files: this.seletedContent,
}
} /* else {
} /* else {
this.publication = {
DateIndex: this.publication.DateIndex,
DocumentId: this.publication.DocumentId,
@@ -502,90 +511,96 @@ export class NewPublicationPage implements OnInit {
} */
try {
try {
const response = await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
const response = await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.httpErrorHandle.httpsSucessMessagge('Editar publicação')
console.log({ response })
this.httpErrorHandle.httpsSucessMessagge('Editar publicação')
console.log({ response })
this.close();
} catch (error) {
if (error.status == 404) {
this.PublicationFolderService.deletePost(this.publication.ProcessId, this.publication.DocumentId)
this.close();
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
}
else {
const date = formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss')
/* this.seletedContent = this.seletedContent.map((e) => {
if(e.FileExtension == "mp4") {
return {
FileBase64: e.FileBase64,
FileExtension: 'data:video/mp4;base64,'+e.FileExtension,
OriginalFileName: "video",
} catch (error) {
if (error.status == 404) {
this.PublicationFolderService.deletePost(this.publication.ProcessId, this.publication.DocumentId)
this.close();
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
return e
}) */
}
else {
const date = formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss')
/* this.seletedContent = this.seletedContent.map((e) => {
if(e.FileExtension == "mp4") {
return {
FileBase64: e.FileBase64,
FileExtension: 'data:video/mp4;base64,'+e.FileExtension,
OriginalFileName: "video",
}
}
return e
}) */
/* if (this.capturedImage != '') { */
this.publication = {
DateIndex: date,
DocumentId: null,
ProcessId: JSON.stringify(this.folderId),
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: date,
OriginalFileName: this.capturedImageTitle || 'foto',
Files: this.seletedContent,
/* FileExtension: 'jpeg', */
}
/* } else if (this.capturedVideo != '') {
this.publication = {
DateIndex: date,
DocumentId: null,
ProcessId: this.folderId,
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: date,
OriginalFileName: this.capturedImageTitle || 'video',
Files: this.seletedContent,
FileExtension: 'mp4',
}
} */
const loader = this.toastService.loading()
try {
await this.publications.CreatePublication(this.folderId, this.publication).toPromise();
this.httpErrorHandle.httpsSucessMessagge('Criar publicação')
if (window["sharedContent"]) {
this.router.navigate(['/home/publications', this.folderId]);
return
}
this.close();
} catch (error) {
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
/* if (this.capturedImage != '') { */
this.publication = {
DateIndex: date,
DocumentId: null,
ProcessId: this.folderId,
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: date,
OriginalFileName: this.capturedImageTitle || 'foto',
Files: this.seletedContent,
/* FileExtension: 'jpeg', */
}
/* } else if (this.capturedVideo != '') {
this.publication = {
DateIndex: date,
DocumentId: null,
ProcessId: this.folderId,
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: date,
OriginalFileName: this.capturedImageTitle || 'video',
Files: this.seletedContent,
FileExtension: 'mp4',
}
} */
const loader = this.toastService.loading()
try {
await this.publications.CreatePublication(this.folderId, this.publication).toPromise();
this.close();
this.httpErrorHandle.httpsSucessMessagge('Criar publicação')
window["sharedContent"] = null;
window["endSharedContent"] = null;
this.close();
} catch (error) {
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
this.PublicationFolderService.getPublicationsIds(this.folderId)
} else {
this.httpErrorHandle.validationMessagge("noFileSelected")
}
this.PublicationFolderService.getPublicationsIds(this.folderId)
}
@@ -593,6 +608,10 @@ export class NewPublicationPage implements OnInit {
this.modalController.dismiss(this.publication).then(() => {
this.showLoader = true;
});
if (window["sharedContent"]) {
this.closeApp();
}
}
clear() {
@@ -775,17 +794,30 @@ export class NewPublicationPage implements OnInit {
if (this.checkFileType.checkFileType(FileExtension) == 'image' || this.checkFileType.checkFileType(FileExtension) == 'video') {
let resultUrl = decodeURIComponent(element.url);
Filesystem.readFile({ path: resultUrl }).then(async (content) => {
let fileObject;
try {
if (this.checkFileType.checkFileType(FileExtension) == 'image') {
fileObject = {
FileBase64: this.removeTextBeforeSlash(content.data, ','),
FileExtension: FileExtension,
OriginalFileName: 'shared',
}
} else if (this.checkFileType.checkFileType(FileExtension) == 'video') {
fileObject = {
FileBase64: 'data:video/mp4;base64,' + this.removeTextBeforeSlash(content.data, ','),
FileExtension: FileExtension,
OriginalFileName: 'shared',
}
let fileObject = new PublicationAttachmentEntity(
{
base64: this.removeTextBeforeSlash(content.data, ','),
extension: FileExtension,
OriginalFileName: "share-content",
FileType: this.checkFileType.checkFileType(FileExtension) as any
}
)
console.log('shared base', content.data)
this.seletedContent.push(fileObject)
} catch (error) {
console.log('error shared filesystem', error)
}
this.seletedContent.push(fileObject)
})
} else {
this.httpErrorHandle.validationMessagge('filetype');
@@ -805,5 +837,10 @@ export class NewPublicationPage implements OnInit {
this.seletedContent.splice(index, 1)
}
closeApp() {
if (this.platform.is('android'))
App.exitApp()
}
}
@@ -83,6 +83,8 @@ export class PublicationsPage implements OnInit {
this.days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
this.intent = window["sharedContent"]
console.log('shared recived', this.intent)
}
ngOnInit() {
@@ -1,6 +1,6 @@
import { Component, ElementRef, OnInit, QueryList, ViewChild, ViewChildren } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { ModalController, IonicSlides } from '@ionic/angular';
import { ModalController, IonicSlides, Platform } from '@ionic/angular';
import { Publication } from 'src/app/models/publication';
import { PublicationFolder } from 'src/app/models/publicationfolder';
import { PublicationPipe } from 'src/app/pipes/publication.pipe';
@@ -68,7 +68,8 @@ export class ViewPublicationsPage implements OnInit {
public publicationFolderService: PublicationFolderService,
public checkFileType: checkFileTypeService,
private publicationVideoManagerService: PublicationVideoManagerService,
public stopvideoService: StopvideoService) {
public stopvideoService: StopvideoService,
private platform: Platform,) {
/* this.publicationVideoManagerService.setContainer(this.VideoManager.nativeElement) */
@@ -190,7 +191,8 @@ export class ViewPublicationsPage implements OnInit {
goBack() {
if (window["sharedContent"]) {
App.exitApp();
if (this.platform.is('android'))
App.exitApp();
return
}
this.router.navigate(['/home/publications']);
+1 -1
View File
@@ -18,7 +18,7 @@ export class checkFileTypeService {
const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp','tiff','tif',
'image/jpg', 'image/jpeg', 'image/png', 'image/gif', 'image/bmp','image/tiff','image/tif', 'image/*']; // Add more if needed
const videoExtensions = ['mp4', 'webm', 'mpg', 'mpeg', 'ogg',
'video/mp4', 'video/webm', 'video/mpg', 'video/mpeg', 'video/ogg', 'video/*']; // Add more if needed
'video/mp4', 'video/webm', 'video/mpg', 'video/mpeg', 'video/ogg','video/quicktime','video/mov', 'video/*']; // Add more if needed
// Check if it's an image
if (imageExtensions.includes(lowerCaseType)) {
@@ -19,13 +19,13 @@
</ion-header>
<ion-content class="d-flex width-100 height-100">
<ion-content>
<div class="d-flex height-100 width-100 overflow-hidden">
<div id="wrapper" class="height-100">
<div class="overflow-y-auto height-100 width-60 visionDesktop-block" style="overflow: hidden; margin-right:20px;">
<div class="overflow-y-auto height-100 width-60 visionDesktop-block mr-20" style="overflow: hidden; margin-right:20px;">
<app-viewer-attachment *ngIf="mergedArray.length >= 1" [showAttachmentList]=false [selectedIndex]="selectedIndex" [taskViewerAttachment]="mergedArray" class="height-100" ></app-viewer-attachment>
</div>
</div>
<div class=" flex-1 d-flex flex-column height-100 d-flex overflow-y-auto-desktop" >
<div class="upper-content" >
@@ -257,9 +257,9 @@ ion-button{
display: block !important;
}
.mobile-header {
.content-details {
display: flex;
justify-content: space-around;
justify-content: space-between;
}
.content-details {
@@ -286,6 +286,20 @@ ion-button{
}
@media screen and (orientation:landscape) {
ion-content {
display: flex;
width: 100%;
height: 100%;
}
ion-content #wrapper {
display: flex;
width: 100%;
height: 100%;
}
.visionDesktop-flex {
display: flex !important;
}
@@ -138,8 +138,6 @@
</div>
<video id="yourVideoElementId" >videoss</video>
</div>
</ion-content>