\LinksToVideo
Extension to easily allow a dataobject to link to a youtube or vimeo video.
This adds DB fields, but does not add any ui to the cms, rather you should do
something like this in getCMSFields:
$fields->addFieldsToTab('Root.Video', $this->getCMSFieldsForVideo());
This allows you to put them wherever you want (special tab, composite field, the main tab, etc).
- Author: Mark Guinn <mark@adaircreative.com>
Synopsis
class LinksToVideo
extends DataExtension
{
- // members
- private static array $db = ;
- private static array $youtube_params = ;
- private static array $vimeo_params = ;
- // methods
- public array getCMSFieldsForVideo()
- public string getVideoEmbedCode()
- protected string getEncodedParams()
- public string VideoEmbedCode()
- public string getVideoType()
- public bool hasVideo()
- protected string extractYouTubeID()
- protected string extractVimeoID()
- protected string retrieveThumbnailURL()
- public string getVideoThumbnail()
- public void onBeforeWrite()
- public void processVideoURL()
Hierarchy
Extends
- DataExtension
Members
private
- $db
- $vimeo_params
- $youtube_params
Methods
protected
public
- VideoEmbedCode()
- getCMSFieldsForVideo()
- getVideoEmbedCode()
- getVideoThumbnail()
- getVideoType()
- hasVideo()
- onBeforeWrite() — Extract the youtube/vimeo id if possible
- processVideoURL() — Extract the youtube/vimeo id if possible