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://some.domain.com/space/filename_1.mp4",
"https://some.domain.com/space/filename_2.mp4",
"https://some.domain.com/space/filename_3.mp4",
"https://some.domain.com/space/filename_4.mp4",
"https://some.domain.com/space/filename_5.mp4",
"https://some.domain.com/space/filename_6.mp4",
]
if you use streamable.com, that lets you upload files for free, you can use
the route for that, with the streamable id
[
"/streamable/39xt5t",
"/streamable/99gag3",
"/streamable/vwg6r2",
"/streamable/jbeixg",
"/streamable/8h2r0u"
]
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: