add video support 'mp4' 'WebM' 'Ogg'

This commit is contained in:
Eugenio Romano
2016-08-31 17:54:24 +01:00
parent 1f6898d043
commit 0ff549d0ac
6 changed files with 122 additions and 3 deletions

View File

@@ -216,6 +216,16 @@ describe('ViewerComponent', () => {
});
});
it('if extension file is a video the the media player should be loaded', (done) => {
component.urlFile = 'fake-url-file.mp4';
component.ngOnChanges().then(() => {
viewerComponentFixture.detectChanges();
expect(element.querySelector('media-player')).not.toBeNull();
done();
});
});
it('if extension file is a not supported the not supported div should be loaded', (done) => {
component.urlFile = 'fake-url-file.unsupported';
@@ -272,5 +282,27 @@ describe('ViewerComponent', () => {
done();
});
});
it('should display the media player if the file identified by mimetype is a media when the filename has wrong extension', (done) => {
component.urlFile = 'content.bin';
component.mimeType = 'video/mp4';
component.ngOnChanges().then(() => {
viewerComponentFixture.detectChanges();
expect(element.querySelector('media-player')).not.toBeNull();
done();
});
});
it('should display the media player if the file identified by mimetype is a media when the filename has no extension', (done) => {
component.urlFile = 'content';
component.mimeType = 'video/mp4';
component.ngOnChanges().then(() => {
viewerComponentFixture.detectChanges();
expect(element.querySelector('media-player')).not.toBeNull();
done();
});
});
});
});