UNPKG

playable

Version:

Video player based on HTML5Video

21 lines 778 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getMimeByUrl = exports.getMimeByType = void 0; var constants_1 = require("../constants"); var getExtension = function (url) { if (url.lastIndexOf('.') === -1) { return null; } return url.split('.').pop(); }; var getMimeByType = function (type) { if (type === null) { return null; } var entry = Object.entries(constants_1.MimeToStreamTypeMap).find(function (x) { return x[1] === type.toUpperCase(); }); return Array.isArray(entry) ? entry[0] : null; }; exports.getMimeByType = getMimeByType; var getMimeByUrl = function (url) { return getMimeByType(getExtension(url)); }; exports.getMimeByUrl = getMimeByUrl; //# sourceMappingURL=get-mime-type.js.map