mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
fix open shared publication folder
This commit is contained in:
@@ -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/quicktime','video/mov', 'video/*']; // Add more if needed
|
||||
'video/mp4', 'video/webm', 'video/mpg', 'video/mpeg', 'video/ogg','video/quicktime', 'video/*']; // Add more if needed
|
||||
|
||||
// Check if it's an image
|
||||
if (imageExtensions.includes(lowerCaseType)) {
|
||||
|
||||
@@ -2,14 +2,17 @@ import { Filesystem } from '@capacitor/filesystem';
|
||||
import { SendIntent } from "send-intent";
|
||||
import { Router } from '@angular/router';
|
||||
import { CallbackScheduler } from './callbackScheduler';
|
||||
import { AlertController, Platform } from '@ionic/angular';
|
||||
|
||||
export class SendIntentService {
|
||||
|
||||
Router!: Router
|
||||
|
||||
callbackScheduler = new CallbackScheduler()
|
||||
alertController = new AlertController()
|
||||
|
||||
constructor() {
|
||||
constructor(
|
||||
) {
|
||||
|
||||
SendIntent.checkSendIntentReceived().then((result: any) => {
|
||||
// logger
|
||||
@@ -36,11 +39,32 @@ export class SendIntentService {
|
||||
|
||||
|
||||
private onReceive = this.callbackScheduler.function<any>((result)=> {
|
||||
this.Router.navigateByUrl("/home/publications");
|
||||
this.Router.navigateByUrl("/home/publications").then(() => {
|
||||
if(Platform.prototype.is('ios')) {
|
||||
this.alertIos();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
window["sharedContent"] = result;
|
||||
})
|
||||
|
||||
private alertIos() {
|
||||
this.alertController .create({
|
||||
header: 'Selecione uma acção para criar a publicação',
|
||||
message: '',
|
||||
buttons: [
|
||||
{
|
||||
text: 'Ok',
|
||||
handler: () => {
|
||||
}
|
||||
}
|
||||
]
|
||||
}).then(res => {
|
||||
res.present();
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export const sendIntent = new SendIntentService()
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { VideoconvertService } from './videoconvert.service';
|
||||
|
||||
describe('VideoconvertService', () => {
|
||||
let service: VideoconvertService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(VideoconvertService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,20 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { FFMpeg } from '@awesome-cordova-plugins/ffmpeg/ngx';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class VideoconvertService {
|
||||
|
||||
constructor(
|
||||
private ffmpeg: FFMpeg
|
||||
) { }
|
||||
|
||||
async convertVideo(inputPath, outputPath, formart) {
|
||||
const ffmpegCommand = `-i "${inputPath}" -c:v copy -c:a aac -strict experimental "${outputPath}output.${formart}"`;
|
||||
|
||||
const result = await this.ffmpeg.exec(ffmpegCommand)
|
||||
|
||||
console.log('Convert returns ', `${outputPath}output.${formart}`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user