new FileManager(source)
Allows for fast switching between a prefefined list of files (or 'sets' )
The filemanager allows you to load up a large number of video files and attach them to a VideoSource.
A 'set' is simply a .json file, with an array with sources like so:
[
"https://s3-eu-west-1.amazonaws.com/nabu/veejay/space/FC205_1.mp4",
"https://s3-eu-west-1.amazonaws.com/nabu/veejay/space/FC206_1.mp4",
"https://s3-eu-west-1.amazonaws.com/nabu/veejay/space/FC207_1.mp4",
"https://s3-eu-west-1.amazonaws.com/nabu/veejay/space/FC240_1.mp4",
"https://s3-eu-west-1.amazonaws.com/nabu/veejay/space/FC252_1.mp4",
"https://s3-eu-west-1.amazonaws.com/nabu/veejay/space/FC281_1.mp4"
]
Parameters:
Name | Type | Description |
---|---|---|
source |
Source#VideoSource | a reference to a (video) Source, or Gif source. Source needs to work with files |
- Implements:
- Source:
Example
var source1 = new VideoSource( renderer )
var myFilemanager = new FileManager( source1 )
myFilemanager.load_set( "myset.json")
// randomly choose one from the set.
myFilemanager.change()
Methods
change((optional))
selects another file from the set
if a parameter is given, it will select that file from the set
Parameters:
Name | Type | Description |
---|---|---|
(optional) |
integer | number of the file in the set |
- Source:
changeToNum()
select a file based on its number in the set
- Source:
changeToUrl()
select a file based on its url, regardless of the current set
- Source:
changez()
Alias for change
- Source:
load(reference)
update the current set of files in the filemanager
Parameters:
Name | Type | Description |
---|---|---|
reference |
string | to a json filewith the set |
- Source:
load_set(json)
select a source based on its number in the set
Parameters:
Name | Type | Description |
---|---|---|
json |
object | encoded array object |
- Source:
setSrc()
init, should be automatic, but you can always call gamepad.init() yourself
- Source: