octo-deno/lib/make/files.js

47 lines
1.9 KiB
JavaScript
Raw Normal View History

2017-04-22 22:49:49 +00:00
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
make.files = {
image: function () {
2017-05-02 20:37:06 +00:00
return utils.common.quote(random.pick([
'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=',
'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==',
'data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=',
'data:image/gif;base64,R0lGODlhAQABAAAAACw=',
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAAAAAA6fptVAAAACklEQVQYV2P4DwABAQEAWk1v8QAAAABJRU5ErkJggg==',
2017-05-02 20:37:06 +00:00
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII='
// Todo: load from filesystem randomly: 'media/images/*.{bmp|jpg|gif|png|webp}'
]))
2017-04-22 22:49:49 +00:00
},
video: function () {
2017-05-02 20:37:06 +00:00
return utils.common.quote(random.pick([
'media/video/video1.webm'
// Todo: load from filesystem randomly: 'media/videos/*.{webm|ogv|mp4}'
]))
2017-04-22 22:49:49 +00:00
},
audio: function () {
2017-05-02 20:37:06 +00:00
return utils.common.quote(random.pick([
'media/audio/mono-uncompressed-8bit-8000hz.wav',
'media/audio/mono-uncompressed-8bit-44100hz.wav',
'media/audio/mono-uncompressed-32bit-8000hz.wav',
'media/audio/mono-uncompressed-32bit-44100hz.wav'
2017-05-02 20:37:06 +00:00
// Todo: load from filesystem randomly: 'media/videos/*.{wav|ogg|mp3}'
]))
2017-04-22 22:49:49 +00:00
},
webvtt: function () {
2017-05-02 20:37:06 +00:00
return utils.common.quote(random.pick([
// 'data:text/vtt,' + encodeURIComponent('WEBVTT\n\n00:00:00.000 --> 00:00:00.001\ntest');,
'media/video/sample.vtt'
2017-05-02 20:37:06 +00:00
// Todo: load from filesystem randomly: 'media/videos/*.{vtt}'
]))
2017-04-22 22:49:49 +00:00
},
file: function () {
return random.pick([
make.files.image,
make.files.video,
make.files.audio
])
}
}