mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
video uploader
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CMAPIAPIService } from './cmapi-api.service';
|
||||
|
||||
describe('CMAPIAPIService', () => {
|
||||
let service: CMAPIAPIService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(CMAPIAPIService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpServiceService } from 'src/app/services/http/http-service.service';
|
||||
import { HttpClient, HttpEvent, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CMAPIAPIService {
|
||||
|
||||
constructor( private HttpServiceService: HttpServiceService,
|
||||
private http: HttpClient,) { }
|
||||
|
||||
|
||||
getVideoHeader(url: string) {
|
||||
return this.http.head('http://localhost:3001/static/'+url, { observe: 'response' })
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { CMAPIService } from './cmapi.service';
|
||||
|
||||
describe('CMAPIService', () => {
|
||||
let service: CMAPIService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(CMAPIService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpServiceService } from 'src/app/services/http/http-service.service';
|
||||
import { HttpClient, HttpEvent, HttpHeaders, HttpParams } from '@angular/common/http';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CMAPIService {
|
||||
|
||||
constructor( private HttpServiceService: HttpServiceService,
|
||||
private http: HttpClient,) {
|
||||
window["CMAPIService"] = this
|
||||
}
|
||||
|
||||
getVideoHeader(url: string): Observable<Boolean> {
|
||||
return this.http.head(url, { observe: 'response' })
|
||||
.map(response => response.status === 200)
|
||||
.catch(() => Observable.of(false));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user