This commit is contained in:
Jaroslav Polakovič 2021-02-10 11:30:15 +01:00
Родитель 4950644f91
Коммит 89d47ac53f
2 изменённых файлов: 12 добавлений и 6 удалений

Просмотреть файл

@ -260,8 +260,6 @@ export default class extends HTMLElement {
/**
* Heuristic method to get video MIME type.
*
* @todo Implement properly, returning a hardcoded default now.
*
* @param {string} videoURL Video URL.
*
* @returns {string} Video MIME type string.
@ -273,7 +271,17 @@ export default class extends HTMLElement {
switch (extension) {
case 'mp4': return 'video/mp4';
default: return 'video/mp4';
case 'webm': return 'video/webm';
case 'ogv': return 'video/ogg';
case 'mpeg': return 'video/mpeg';
case 'mov': return 'video/quicktime';
case 'avi': return 'video/x-msvideo';
case 'ts': return 'video/mp2t';
case '3gp': return 'video/3gpp';
case '3g2': return 'video/3gpp2';
case 'wmv': return 'video/x-ms-wmv';
case 'flv': return 'video/x-flv';
default: return `video/${extension}`;
}
}

Просмотреть файл

@ -4,9 +4,7 @@ import IDBConnection from '../modules/IDBConnection.module';
/**
* Respond to a request to fetch offline video and contruct a response stream.
*
* @todo Support byte range requests properly.
*
* Currently the whole video is pushed to the stream and `206 Partial Content` is not sent.
* Includes support for `Range` requests.
*
* @param {Request} request Request object.
* @param {IDBConnection} db IDBConnection instance.