|
jem_plugin_source_fs
This page describes the FileSystem Media Source plugin.
Phase-Deploy IntroductionThis plug in's main purpose is to scan local directories for media and add it to the the internal media list. In addition to adding media, if media that is found on the harddrive is missing/removed, it is automatically removed from the media list. Note: Any media found is only stored for that session and is lost when the server shuts down. For a persistent media list, please see the XML Media Source plugin (see jem_plugin_source_xml). ConfigurationThis plugin is set up in the modules section of the JemsConfig.xml file. <?xml version='1.0' encoding='utf-8'?>
<jems>
<modules>
...
<module name="FS Media Plugin" class="net.kodeninja.jem.server.content.fs.DirectoryMediaSource">
<refresh>180000</refresh>
<ignoreUnknown>true</ignoreUnknown>
<directory>C:/shared/</directory>
<directory>D:/shared/</directory>
<mimetype type="audio/mpeg" class="net.kodeninja.jem.server.content.mimetypes.MPEGAudioFile">
<extension>mp3</extension>
</mimetype>
<mimetype type="video/quicktime" class="net.kodeninja.jem.server.content.mimetypes.GenericFile">
<extension>mov</extension>
<extension>m4v</extension>
</mimetype>
<mimetype type="image/jpeg" class="net.kodeninja.jem.server.content.mimetypes.ImageFile">
<extension>jpeg</extension>
<extension>jpg</extension>
</mimetype>
</module>
...
</modules>
<services>
...
<service module="FS Media Plugin"/>
...
</services>
...
</jems>Figure 1.1 - Sample module definition The configuration for this module is split up in to 3 sections: Module Options, Directories, and Mimetype/Metadata Module mappings. Note: This plugin requires an entry in the services section. Module OptionsThere is currently two options for the module:
DirectoriesThe <directory> tag is used specify a directory to scan for media. You may specify as many directories as you wish, by repeating the tag. You are advised only to only select directories that contain media. (For example, don't specify an entire harddrive, if most of it isn't media you wished shared) Mimetype/Metadata Module mappingsBy default, the directory scanner knows nothing about the files its finding. To remedy this, we create mimetype/metadata module mappings based on file extensions. What does this mean? It means we are telling the scanning when it encounters a certain file extension (for example, .mp3) that this file is a music file and it should use the correct module to parse the ID3 tags and song length from the file. The type attribute is used to specify the file's mimetype. These are used to specify what is actually stored within the file as there can be multiple extensions for files of the same type. The class attribute specifies which java module to load parse the file for metadata. The current available ones are listed later. The extension sub tags are used to specify which file extensions to use to match a file to it's parent's metadata parser and mimetype. These tags can be specified multiple times, once for each extension to match on. For example, for matching 'jpg' and 'jpeg' as the same mimetype, would require 2 extension sub tags.
It is suggested that even though a file may not have a parser yet, that an entry is created for it with the correct mimetype as some plug ins may only use that file if the file has an associated mime type. | ||||||||||||||||||||||||||||||||||||||||