\VideoBlock
- Author: Donatas Navidonskis <donatas@navidonskis.com>
Synopsis
class VideoBlock
extends BaseBlock
{
- // members
- private static array $db = ;
- private static array $has_one = ;
- private static array $better_buttons_actions = ;
- private static bool $load_javascript_plugin = true;
- // Inherited members from BaseBlock
- protected static string $upload_directory;
- // methods
- public string singular_name()
- public string plural_name()
- public string getVideoType()
- public array getVideoTypes()
- public FieldList getCMSFields()
- public array fieldLabels()
- public string|false getVideoId()
- public bool|string getEmbedLink()
- protected ValidationResult validate()
- public Image|false getCoverImage()
- public FieldList getBetterButtonsActions()
- public bool|string getMp4VideoUrl()
- public bool|string getWebMVideoUrl()
- public bool|string getOggVideoUrl()
- public false fetchVideosPicture()
- public void getVideoOptions()
- // Inherited methods from BaseBlock
- public HTMLText isPublishedIcon()
- public string forTemplate()
- public bool|string Link()
- public string getUploadDirectory()
- public string getBlockName()
Hierarchy
Extends
Members
private
- $db — array
- $has_one — array
- $load_javascript_plugin
—
bool
Load javascript plugin to load all block features. Set to false and add yours. This will load /assets/javascript/video-block.js file.
protected
- $upload_directory
—
string
Default directory to upload your files.
Methods
protected
public
- fetchVideosPicture() — Fetching/downloading picture from the providers url address and saving as Image object.
- fieldLabels()
- getBetterButtonsActions() — Creating a button to fetch videos picture if cover image not exists.
- getCMSFields()
- getCoverImage()
- getEmbedLink() — Get embed link by the set of Type field. Method depends by VideoSliderItem::$embed_links property.
- getMp4VideoUrl()
- getOggVideoUrl()
- getVideoId() — This will get an id of the URL address or false if can't parsed, object type not one of supported providers or just empty url address field.
- getVideoOptions()
- getVideoType()
- getVideoTypes()
- getWebMVideoUrl()
- plural_name() — If the plural name is set in a private static $plural_name, it cannot be changed using the translation files for some reason. Fix it by defining a method that handles the translation.
- singular_name() — If the singular name is set in a private static $singular_name, it cannot be changed using the translation files for some reason. Fix it by defining a method that handles the translation.
Inherited from BaseBlock
public
- Link()
- forTemplate() — Renders this block with appropriate templates looks for templates that match BlockClassName_AreaName falls back to BlockClassName.
- getBlockName()
- getUploadDirectory()
- isPublishedIcon() — Re-add (un)publish images.