video_functions.php
Table of Contents
Functions
- get_video_resolution() : array<string|int, mixed>
- Get video resolution and framerate using FFMpeg
- display_video_subtitles() : void
- Generate HTML to display subtitles in playback of a video resource.
- generate_videojs_options() : string|false
- Generate JSON array of VideoJS options to be used in the data-setup attribute
Functions
get_video_resolution()
Get video resolution and framerate using FFMpeg
get_video_resolution(string $file) : array<string|int, mixed>
Parameters
- $file : string
-
Path to video file
Tags
Return values
array<string|int, mixed>display_video_subtitles()
Generate HTML to display subtitles in playback of a video resource.
display_video_subtitles(int $ref, int $access) : void
Parameters
- $ref : int
-
Resource ID
- $access : int
-
Resource access level - e.g. 0 for open access
generate_videojs_options()
Generate JSON array of VideoJS options to be used in the data-setup attribute
generate_videojs_options(bool $view_as_gif, bool $play_on_hover, array<string|int, mixed> $video_preview_sources) : string|false
Parameters
- $view_as_gif : bool
-
True if the video is a GIF file
- $play_on_hover : bool
-
True if playing video on hover
- $video_preview_sources : array<string|int, mixed>
-
Array of preview sources, including URL, type and label