Enable loading video file as data URI (fixes #4830)

This commit is contained in:
Ilya Apasov 2019-10-29 19:02:56 +02:00 committed by GitHub
parent c25331cf30
commit abe3247e47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -259,12 +259,21 @@ VideoFile.getVideoURL = function (game, urls)
{
var url = GetFastValue(urls[i], 'url', urls[i]);
if (url.indexOf('blob:') === 0 || url.indexOf('data:') === 0)
if (url.indexOf('blob:') === 0)
{
return url;
}
var videoType = url.match(/\.([a-zA-Z0-9]+)($|\?)/);
var videoType;
if (url.indexOf('data:') === 0)
{
videoType = url.split(',')[0].match(/\/(.*?);/);
}
else
{
videoType = url.match(/\.([a-zA-Z0-9]+)($|\?)/);
}
videoType = GetFastValue(urls[i], 'type', (videoType) ? videoType[1] : '').toLowerCase();