Definition at line 41 of file video_manager.inc.
◆ deleteGallery()
static VideoManager::deleteGallery |
( |
|
$gallery | ) |
|
|
static |
When deleting a video gallery, we must also delete all videos linked to the gallery and any downloads of those videos.
- Parameters
-
Definition at line 497 of file video_manager.inc.
499 $tx =
new DataTransaction();
510 $download->joinTransaction(
$tx);
512 $download->delete(
"WHERE video_id={$video->video_id}");
◆ deleteUser()
static VideoManager::deleteUser |
( |
|
$user | ) |
|
|
static |
Respond to fired event DeleteUser.
Delete any records in this component that have dependencies on user object.
- Parameters
-
obj | $user | - class SiteUser or custom user class |
Definition at line 449 of file video_manager.inc.
454 trace(
"Component video is deleting objects dependent on user_id {$user_id}", 3);
456 $tx =
new DataTransaction();
475 $video->delete(
"WHERE user_id={$user_id}");
478 $download->joinTransaction(
$tx);
479 $download->delete(
"WHERE user_id={$user_id}");
static deleteGallery($gallery)
When deleting a video gallery, we must also delete all videos linked to the gallery and any downloads...
◆ displayVideoGallery()
static VideoManager::displayVideoGallery |
( |
|
$identifier, |
|
|
& |
$continue |
|
) |
| |
|
static |
Event handler to display an image gallery from the specified identifier.
- Parameters
-
string | $identifier | the identifier to match |
boolean | $continue | returns whether to continue processing this event |
Definition at line 409 of file video_manager.inc.
418 $_GET[
"gallery_id"] =
$gallery->video_gallery_id;
424 if (!checkRole(
$page->role))
430 echo $pageView->drawView();
434 catch(DataNotFoundException $e)
static findByIdentifier($identifier, $constraint="")
ComponentPageView generates the page content for a component page, substituting page fields,...
static storeRedirectPage()
Store the page from which a user has been redirected when prompted to login or create an account.
◆ enumerateItems()
static VideoManager::enumerateItems |
( |
|
$items | ) |
|
|
static |
◆ formatVideoURI()
static VideoManager::formatVideoURI |
( |
|
$video | ) |
|
|
static |
◆ getFrame()
VideoManager::getFrame |
( |
|
$idx | ) |
|
◆ getFrameHeight()
VideoManager::getFrameHeight |
( |
| ) |
|
Definition at line 254 of file video_manager.inc.
256 foreach($this->movieInfo->streams as $stream)
258 if ($stream->codec_type ==
"video")
return $stream->height;
FakoliException is the base exception class for all Fakoli errors.
◆ getFrameRate()
VideoManager::getFrameRate |
( |
| ) |
|
Definition at line 264 of file video_manager.inc.
266 foreach($this->movieInfo->streams as $stream)
268 if ($stream->codec_type ==
"video")
return $stream->r_frame_rate;
◆ getFrameWidth()
VideoManager::getFrameWidth |
( |
| ) |
|
Definition at line 244 of file video_manager.inc.
246 foreach($this->movieInfo->streams as $stream)
248 if ($stream->codec_type ==
"video")
return $stream->width;
◆ getVideoFolder()
static VideoManager::getVideoFolder |
( |
| ) |
|
|
static |
Definition at line 102 of file video_manager.inc.
109 if ($location ==
"Other")
113 if (!file_exists(
$dir))
118 else if ($location ==
"Web Folder")
121 if (!file_exists(
$dir))
129 if (!file_exists(
$dir))
static getValue($component, $name)
Retrieve the value of the specified Setting.
◆ getVideoURI()
static VideoManager::getVideoURI |
( |
|
$video | ) |
|
|
static |
Definition at line 141 of file video_manager.inc.
146 if ($location ==
"Web Folder")
150 return "/".$folder.
"/gallery_".
$video->video_gallery_id.
"/".
$video->video_file;
154 return "/action/video/stream?video_id=".$video->video_id;
◆ hasFFMPEG()
VideoManager::hasFFMPEG |
( |
| ) |
|
Definition at line 202 of file video_manager.inc.
208 trace(
"FFMPEG: path not set", 3);
212 $ffmpeg = $this->getExecutablePath(
"ffmpeg");
213 if (!file_exists($ffmpeg))
215 trace(
"FFMPEG: no executable at $ffmpeg", 3);
219 $ffprobe = $this->getExecutablePath(
"ffprobe");
220 if (!file_exists($ffprobe))
222 trace(
"FFMPEG: no executable at $ffprobe", 3);
226 trace(
"FFMPEG: executables detected in correct location", 3);
◆ imageLink()
VideoManager::imageLink |
( |
|
$video_id | ) |
|
Definition at line 304 of file video_manager.inc.
306 return "/action/video/show?image_id=$video_id";
◆ makeMultipleTwo()
VideoManager::makeMultipleTwo |
( |
|
$value | ) |
|
◆ onInitialize()
static VideoManager::onInitialize |
( |
| ) |
|
|
static |
Definition at line 65 of file video_manager.inc.
70 global $html_editor_extra_buttons;
74 $html_editor_extra_buttons[] =
75 array(
"name" =>
"video_picker",
76 "image" =>
"/fakoli/images/video_button.png",
77 "tooltip" =>
"Insert Video",
78 "handler" =>
"videoPicker");
88 $styles =
"<link href='//vjs.zencdn.net/4.12/video-js.css' rel='stylesheet'>" .
$styles;
89 $script =
"<script src='//vjs.zencdn.net/4.12/video.js'></script>" .
$script;
92 if ($useFlash && $flowPlayerScript)
94 $script .=
"<script type='text/javascript' src='$flowPlayerScript'></script>\n";
99 $script .=
"<script type='text/javascript'>\nvar flowplayerPath = '$flowPlayer';\n</script>\n";
if($config["default_content_type"]) $isAction
◆ open()
VideoManager::open |
( |
|
$file | ) |
|
Definition at line 231 of file video_manager.inc.
233 trace(
"Opening video '$file'", 3);
235 if (!file_exists(
$file))
240 $this->movieFile =
$file;
241 $this->movieInfo = json_decode($this->execute(
"ffprobe",
"-v quiet -print_format json -show_format -show_streams {$this->movieFile}"));
◆ registerTaxonomyClasses()
static VideoManager::registerTaxonomyClasses |
( |
|
$classes | ) |
|
|
static |
◆ renderThumbnail()
VideoManager::renderThumbnail |
( |
|
$video_id, |
|
|
|
$size = 0 , |
|
|
|
$width = 0 , |
|
|
|
$height = 0 |
|
) |
| |
Renders the Image specified by the image_id at the specified size.
Note that the size is the length of the major axis, and aspect ratio is maintained. The generated image is cached after rendering to speed subsequent accesses. The image file is output with the correct HTTP headers to ensure correct interpretation by the browser.
- Parameters
-
$image_id | the ID of the image to render |
$size | the size of the major axis, in pixels |
$width | the specific width of the rendered thumbnail (if $size is 0) |
$height | the specific height of the rendered thumbnail (if $size and $width are 0) |
Definition at line 321 of file video_manager.inc.
336 $dir =
$video->VideoGallery()->getGalleryDirectory();
338 $imageFile =
$dir . DIRECTORY_SEPARATOR .
$video->image_file;
339 $cacheFile =
$dir . DIRECTORY_SEPARATOR .
$video->video_id .
"_" . $suffix .
".png";
340 trace(
"renderThumbnail:: imageFile {$imageFile} and cacheDir {$cacheDir} and cacheFile {$cacheFile}", 3);
342 if (!file_exists($cacheFile) || (filemtime($cacheFile) < filemtime($imageFile)))
344 $src = imagecreatefrompng($imageFile);
347 $fullWidth = imagesx(
$src);
348 $fullHeight = imagesy(
$src);
352 if ($fullWidth > $fullHeight)
355 $newHeight = intval(($fullHeight *
$size) / $fullWidth);
360 $newWidth = intval(($fullWidth *
$size) / $fullHeight);
367 $newHeight = intval(($fullHeight *
$width) / $fullWidth);
372 $newWidth = intval(($fullWidth *
$height) / $fullHeight);
376 $newWidth = $fullWidth;
377 $newHeight = $fullHeight;
380 trace(
"Rendering $cacheFile @ $newWidth x $newHeight", 3);
382 $dst = imagecreatetruecolor($newWidth, $newHeight);
383 imagecopyresampled($dst,
$src, 0, 0, 0, 0, $newWidth, $newHeight, $fullWidth, $fullHeight);
385 if (file_exists($cacheFile))
388 trace(
"renderThumbnail:: unlinking cachefile", 3);
392 imagepng($dst, $cacheFile);
400 trace(
"renderThumbnail:: exiting", 3);
static sendFile($resource)
Sends the contents of the specified file to the client.
◆ saveFrame()
VideoManager::saveFrame |
( |
|
$offset, |
|
|
|
$out |
|
) |
| |
Definition at line 279 of file video_manager.inc.
281 if (!$this->movieFile)
throw new FakoliException(
"Movie File not loaded");
285 $this->execute(
"ffmpeg",
"-ss {$offset} -i {$this->movieFile} -t 1 -s {$width}x{$height} -f image2 {$out}");
◆ setDefaults()
static VideoManager::setDefaults |
( |
| ) |
|
|
static |
Definition at line 50 of file video_manager.inc.
52 Settings::setDefaultValue(
"video",
"video_folder",
"videos", String,
"Directory inside the web folder that is used to store the video files",
"Video Uploads");
54 "Indicate whether videos should be stored under the Web Folder or in the document upload area.".
55 "If you do not have mod_xsendfile installed, then Web Folder is strongly recommended",
56 "Video Uploads",
"Web Folder\nDocument Upload Folder\nOther");
57 Settings::setDefaultValue(
"video",
"video_upload_other_location",
"", String,
"Full path to alternate video location",
"Video Uploads");
58 Settings::setDefaultValue(
"video",
"use_HTML5_video",
false, Boolean,
"Check to enable support for HTML5 video",
"Video Player",
null, 1);
59 Settings::setDefaultValue(
"video",
"use_flash_video",
true, Boolean,
"Check to enable support for old-style FLV (requires Flowplayer Flash)",
"Video Player",
null, 2);
60 Settings::setDefaultValue(
"video",
"flowplayer_script",
"", String,
"URI for the Flowplayer script",
"Video Player",
null, 3);
61 Settings::setDefaultValue(
"video",
"flowplayer_player",
"", String,
"URI for the Flowplayer SWF file",
"Video Player",
null, 4);
62 Settings::setDefaultValue(
"video",
"ffmpeg_path",
"", String,
"Directory containing the ffmpeg binary executables",
"Video Transcoder");
static setDefaultValue($component, $name, $value, $field_type="String", $annotation="", $category="", $options="", $weight=0)
Sets the default value of the given component setting.
◆ thumbnailLink()
VideoManager::thumbnailLink |
( |
|
$video_id, |
|
|
|
$size |
|
) |
| |
Returns the URI that can be used to access the specified thumbnail of a video at the given size.
- Parameters
-
$video_id | the ID of the video |
$size | the size of the major axis in pixels |
- Returns
- string URI that can be used in an tag to view this image.
Definition at line 299 of file video_manager.inc.
301 return "/action/video/thumbnail?video_id=$video_id&size=$size";
◆ upgradeComponent()
static VideoManager::upgradeComponent |
( |
|
$version | ) |
|
|
static |
◆ videoGalleryTabs()
static VideoManager::videoGalleryTabs |
( |
|
$key | ) |
|
|
static |
Definition at line 525 of file video_manager.inc.
528 "Gallery" =>
"/admin/video_gallery_form",
529 "Permissions" =>
"/admin/video_gallery_permissions",
530 "Videos" =>
"/admin/videos",
531 "Statistics" =>
"/admin/video_gallery_stats",
534 $qs = ($key) ?
"video_gallery_id=$key" :
"";
535 return new TabBar(
"tabs",
$tabs,
$qs);
◆ VideoManager()
VideoManager::VideoManager |
( |
| ) |
|
◆ $movieFile
VideoManager::$movieFile = null |
The documentation for this class was generated from the following file: