mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 13:13:43 +00:00
Enable loading video file as data URI (fixes #4830)
This commit is contained in:
parent
c25331cf30
commit
abe3247e47
1 changed files with 11 additions and 2 deletions
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in a new issue