The best way to allow video selection in an extension field is to use a custom field. For an introduction to custom fields, take a look at this article from Joomla! Documentation.
In its simplest form, you can simply extend the filelist
field type and make it list video files using the formats you want. Here's an example (based on the imagelist
field type):
File: /modules/mod_YOURMODULE/models/fields/videos.php
<?php
defined('JPATH_PLATFORM') or die;
JFormHelper::loadFieldClass('filelist');
class JFormFieldVideos extends JFormFieldFileList
{
protected $type = 'ImageList';
protected function getOptions()
{
// Define the vide file type filter. Edit as needed.
$this->filter = '\.mov$|\.mpg$|\.mp4$|\.ogv$|\.webm$|\.mts$|\.avi$|\.wmv$';
return parent::getOptions();
}
}
File: /modules/mod_YOURMODULE/mod_YOURMODULE.xml
<fieldset name="videos" addfieldpath="/modules/mod_YOURMODULE/models/fields">
<field name="videos" type="Videos" label="Select a video" description="" directory="images" />
</fieldset>
It's not as elegant as the media manager popup, but the same method can be used to create a more complex form if you know how.
The same can also be achieved by adding filters to the filelist
form field directly:
<field type="filelist" name="test" label="Video filter" directory="images" filter="\.mov$|\.mpg$|\.mp4$|\.ogv$|\.webm$|\.mts$|\.avi$|\.wmv$" />
(A related question with a couple of answers can be found here.)